Index values in series

Screen Link: https://app.dataquest.io/m/381/exploring-data-with-pandas%3A-fundamentals/11/creating-new-columns

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.

1 Like