Working with time series data
With time series data, we have some additional operations we can use, for anything from selection and filtering to aggregation. We will be exploring some of this functionality in the 4-time_series.ipynb
notebook. Let's start off by reading in the Facebook data from the previous sections:
>>> import numpy as np >>> import pandas as pd >>> fb = pd.read_csv( ...     'data/fb_2018.csv', index_col='date', parse_dates=True ... ).assign(trading_volume=lambda x: pd.cut( ...     x.volume, bins=3, labels=['low', 'med', 'high']     ... ))
We will begin this section by discussing the selection and filtering of time series data before moving on to shifting, differencing, resampling, and finally merging based on time. Note that it's important to set the index to our date (or datetime) column, which...