Skip to main content

设置

设置行列不忽略

pd.set_option('display.max_rows',10000)
pd.set_option('display.max_columns',10)

pandas.DataFrame.resample 按照时间汇总

df_week = pd.DateFrame()
df_week['open'] = df['open'].resample('W').first() # 周一的开盘价
df_week['close'] = df['close'].resample('W').last()
df_week['high'] = df['high'].resample('W').max()
df_week['low'] = df['low'].resample('W').min()