In this video we go over how to sort a pandas DataFrame based on a single column or multiple columns. We also discuss how to sort a single column of a DataFrame (not the entire DataFrame) and a Series that is not associated with a DataFrame. We also discuss how to sort ascending and descending and how to handle missing data when sorting.
Have you ever sorted strings and upper case values were sorted ahead of lower case values. We discuss how to fix this solution!
Did you find this video helpful? Consider subscribing for weekly tips, tricks, and tutorials.
/ @chartexplorers
Data from FiveThirtyEight
https://fivethirtyeight.com/features/...
Link to data
https://bit.ly/2JkVM6v
0:00 Intro
0:21 Data
0:58 Sort DF, single col
1:26 Ascending/Descending
1:46 na_position
2:21 Sort DF, multiple cols
3:12 Sort col
3:33 Independent Series