如何按给定的频率分组,例如说每小时,并为时间序列数据集中的一列创建一组箱形图?
range = pd.date_range('2015-01-01', '2015-12-31', freq='1min')
df = pd.DataFrame(index = range)
# Average speed in miles per hour
df['speed'] = np.random.randint(low=0, high=60, size=len(df.index))
# Distance in miles (speed * 0.5 hours)
df['distance'] = df['speed'] * 0.25
# Cumulative distance travelled
df['cumulative_distance'] = df.distance.cumsum()
df.head()
如何按给定频率分组,例如说每小时,并创建一组速度箱图?下面给出了示例输出。