pandas.DataFrame.sort_values Flashcards

1
Q

Describe what the method .sort_values does:

A

sort by values along either axis

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is the first parameter in .sort_values()

A

by

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what are the acceptable inputs for the parameter by?

A

Name or list of names to sort by.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is the second parameter of the method .sort_values()?

A

axis=

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what are the acceptable inputs to the paramerter axis?

A

str or integers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what does the paramerter axis do?

A

it determines by what axis to sort by. default is 0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what is the third parameter of the method .sort_values()?

A

ascending=

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what is the acceptable input of the parameter ascending?

A

a boolean , True or False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what does the parameter ascending determine?

A

whether to sort ascending or descending. Default is descending.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

If I want to ignore the existing axis what parameter would I use?

A

ignore_index=

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what data type does the parameter ignore_index accept?

A

boolean

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what does the method .sort_values() return?

A

A dataframe with sorted values or none if inplace is true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly