Welcome back.
I wanted to do a really quick lecture on something that I realized after recording and the previous
lecture, and it's related to what these two parameters accept.
In addition to python lists like we're using here.
In fact, they accept any array like object.
So remember with columns here, we started with players columns, which was a Penas index object of
strength.
And then we established that it was eatable and therefore eligible for these sorted python method.
And out of that out of that method call, we got a python list of strings, which we passed to the columns
parameter in our reenacts method to do the selection.
And with this new information, the fact that it can be it doesn't need to be a python list, but it
can be an array like object.
We have identified another approach to do this.
So instead of saying sorted player's columns, we can say player's columns and then call sort values
on that object itself.
Notice that Claires columns.
Remember, that was the index.
If we call sort of values on this, you will just return us a new index where these strings mislabels
have been sorting.
Excellent.
And this is exactly what we need, because this is another array like object.
It's not a python list.
It's a pangas index object.
But both of them are array vike.
And so it would work for our reinfect method call.
And sure enough, we get exactly the same output under both approaches.
So, yeah, nothing wrong with what we did here and in the previous lecture.
In fact, I prefer this.
But there is a pure panda's way of solving the problem as well.
OK.