I am a bit stuck on what’s happening with the index on the left– are the values in prev_rank_after (471.0, 234.0, etc) the same ones listed in prev_rank_before (159, 147, etc.) but updated somehow? Or is this a different set of index values pulled randomly from the dataset?
I will have to explore this deeper, but what I think is happening is that because other than the
33 counts the remaining
value_counts are all
1. So, pandas is randomly selecting 4 of those and showing them to us since they all have the same counts.