This chapter introduces you to the pandas
library and shows you the basics of working with DataFrame
objects.
There are six notebooks that we will work through, each numbered according to when they will be used:
1-pandas_data_structures.ipynb
: discusses the mainpandas
data structures and why we need them2-creating_dataframes.ipynb
: walks through creatingDataFrame
objects from a variety of data sources, such as flat files, SQL queries, and other Python objects3-making_dataframes_from_api_requests.ipynb
: shows how to collect data from an API and create aDataFrame
object with the result, using the USGS earthquake API4-inspecting_dataframes.ipynb
: illustrates how perform an initial inspection of the data, including displaying theDataFrame
object and summarizing the contents5-subsetting_data.ipynb
: showcases strategies for subsetting the data by rows, columns, and/or Boolean criteria6-adding_and_removing_data.ipynb
: provides examples of adding additional rows/columns and removing rows/columns from aDataFrame
object
All the datasets necessary for the aforementioned notebooks, along with information on them, can be found in the data/
directory. The end-of-chapter exercises will use these datasets as well; solutions to the exercises can be found in the repository's solutions/ch_02/
directory.