pandas.DataFrame.sort_values Flashcards
Describe what the method .sort_values does:
sort by values along either axis
what is the first parameter in .sort_values()
by
what are the acceptable inputs for the parameter by?
Name or list of names to sort by.
what is the second parameter of the method .sort_values()?
axis=
what are the acceptable inputs to the paramerter axis?
str or integers
what does the paramerter axis do?
it determines by what axis to sort by. default is 0
what is the third parameter of the method .sort_values()?
ascending=
what is the acceptable input of the parameter ascending?
a boolean , True or False
what does the parameter ascending determine?
whether to sort ascending or descending. Default is descending.
If I want to ignore the existing axis what parameter would I use?
ignore_index=
what data type does the parameter ignore_index accept?
boolean
what does the method .sort_values() return?
A dataframe with sorted values or none if inplace is true