This chapter teaches you how to query and merge DataFrame
objects, perform complex operations on them, including rolling calculations and aggregations, and how to work effectively with time series data.
There are four notebooks that we will work through, each numbered according to when they will be used:
1-querying_and_merging.ipynb
: showcases how to query and mergeDataFrame
objects2-dataframe_operations.ipynb
: walks through a variety of data enrichment operations, such as binning and window calculations, and how to perform them efficiently with theapply()
andpipe()
methods3-aggregations.ipynb
: discusses how to perform aggregations on the data, including pivot tables, crosstabs, and calculations based on group membership with thegroupby()
method4-time_series.ipynb
: illustrates how to work effectively with time series
There is also a bonus notebook that uses interactive widgets to give you a better understanding of window calculations: understanding_window_calculations.ipynb
.
In addition to the aforementioned notebooks, we have two additional files:
0-weather_data_collection.ipynb
: (optional) contains the code used to collect the weather data used in the chapterwindow_calc.py
: contains a function that uses pipes to perform a variety of window calculations
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 the datasets in the exercises/
directory; solutions to these exercises can be found in the repository's solutions/ch_04/
directory.