You now know how to use two core methods of the pandas library: .sort_values()
and .sort_index()
. With this knowledge, you can perform basic data analysis with a DataFrame. While there are a lot of similarities between these two methods, seeing the difference between them makes it clear which one to use for different analytical tasks.
In this video course, you’ve learned how to:
- Sort a pandas DataFrame by the values of one or more columns
- Use the
ascending
parameter to change the sort order - Sort a DataFrame by its
index
using.sort_index()
- Organize missing data while sorting values
- Sort a DataFrame in-place using
inplace
set toTrue
For more information on concepts covered in this course, you can check out:
- The pandas DataFrame: Working With Data Efficiently
- Discover bpython: A Python REPL With IDE-Like Features
- bpython
- Introduction to Sorting Algorithms in Python
- pandas documentation
- Combining Data in pandas With merge(), .join(), and concat()
- Using pandas to Make a Gradebook in Python
- Sorting Data With Python
Congratulations, you made it to the end of the course! What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment in the discussion section and let us know.