Hello ! I have written the following code in order to determine which subhalos have the same DescendentID for a given halo at snapshot 98. Something seems to be wrong with my code because a few of the outputs say that over 50 different subhalos have the same descendent - when at most it should be 2 subhalos that have merged. I would greatly appreciate any feedback on my code. I have a feeling it has something to do with how I am extracting subhaloIDs from each halo (my first block of code).
Hello ! I have written the following code in order to determine which subhalos have the same DescendentID for a given halo at snapshot 98. Something seems to be wrong with my code because a few of the outputs say that over 50 different subhalos have the same descendent - when at most it should be 2 subhalos that have merged. I would greatly appreciate any feedback on my code. I have a feeling it has something to do with how I am extracting subhaloIDs from each halo (my first block of code).

