Introduction to DataFrames
Imagine that you're working on a dataset that contains hundreds of columns and thousands of rows, of which only a small subset – say a dozen rows and two or three columns – matter to you for a particular analysis. In such cases, it's better to isolate and focus on those rows and columns rather than working with the entire dataset. In data analysis and data science, you will constantly need to work with a subset of a larger dataset. Thankfully, pandas provides selection methods that make this process easy and efficient. You will learn about these methods in this chapter. We will start by revisiting DataFrames and then see how pandas selection methods apply to DataFrames.
So far in this book, you have learned about the basics of the pandas data structures (Chapter 2, Data Structures), how to get data in or out of pandas (Chapter 3, Data I/O), and the different data types in pandas (Chapter 4, Data Types). Now, it is time to integrate...