Use of sort_index() function when looking at the null values in data

Hi all,
In the lesson1, we see the below code patch where the ratio of nulls of all the columns are sorted by index and are displayed.

Could anyone please explain the purpose of using ‘sort_index()’ in this context?
I feel, instead if we can use ‘sort_values(ascending=False)’ ,so that we can see those columns with highest number of nulls on top.

Hi Ashwini, have you check out this StackOverflow post for the "Difference between sort_values and sort_index"?

I think you will find the answer there.