Workspace
Roger Goh Chee Keen/

Course Notes: Manipulating Time Series Data in Python

0
Beta
Spinner
resample()

add text here

# Import and inspect data here
stocks = pd.read_csv('stocks.csv', parse_dates=['date'], index_col='date')
print(stocks.info())

# Calculate and plot the monthly averages
monthly_average = stocks.resample('M').mean()
monthly_average.plot(subplots=True);
plt.show();