Index Alignment with Pandas

I am confused as to where the index labels are coming from. With the Fortune 500 dataset in the Exploring Data with pandas: Intermediate course, what were the index labels (after selecting the non-null values) when we added the rank change column.

Hi @adcexperiment1234, please provide the screen link.

1 Like

Hi adcexperiment1234
When you check the variable inspector you could find the index labels for rank_change Series, previously_ranked DataFrame, and f500 DataFrame.

The index labels are unique for each row and it remains unchanged whether we create a new DataFrame or add/remove/reorder the rows.

To avoid confusion, you can check the rear end of rank_change and previously_ranked, and compare it with f500 to observe the changes.

Hope its clear now.