In this tutorial, you will learn how to resample time series with pandas.
We will download the daily price time series data for AAPL and resample it into monthly data by computing the mean. We will do this by creating a pandas
DataFrame and calling its
DataFrame, we need to create a
DatetimeIndexobject to pass to the
DataFrameconstructor. Create the index from the downloaded quotes data, as follows:
dt_idx = pandas.DatetimeIndex(quotes.date)
df = pandas.DataFrame (quotes.close, index=dt_idx, columns=[symbol])