(c) 2016 - present. Enplus Advisors, Inc.
import numpy as np
import pandas as pd
pd.set_option('display.float_format', '{:,.1f}'.format)
dat = pd.read_csv('data/weather-6m.csv')
Exercise:
Calculate the average air_temp
by month
.
Exercise:
Compute summary statistics on air_temp
and dew_point
using
the describe
method.
Exercise:
For January and February and 0 - 11 hours, calculate the average and standard deviation of air_temp
grouping by month and hour of the day. Name your result columns air_temp_mean
and air_temp_sd
.
Your result DataFrame
should have 24 rows, the number of months (2) times the number of hours (12).
2∗12=24
Exercise:
By month, calculate quantiles for air_temp
using the quantiles defined in breaks
.
Hint: Use the quantile
method defined on a Series
(pd.Series.quantile
).
breaks = [0.01, 0.25, 0.5, 0.75, 0.99]