我有一个1分钟的酒吧OHLC价格CSV文件,我正试图重新采样到15分钟酒吧。我使用的代码来自
link
,如下所示:
ohlc_dict = {'open':'first', 'high':'max', 'low':'min', 'close': 'last'}
price15m = df.resample('15Min', how=ohlc_dict, closed='right').dropna(how='any')
我得到了预期的重采样数据帧,但也有以下警告:
FutureWarning: how in .resample() is deprecated
the new syntax is .resample(...)..apply(<func>)
ohlc_dict = {'open':'first', 'high':'max', 'low':'min', 'close': 'last'}
建议使用此语法,但我不确定如何:
the new syntax is .resample(...)..apply(<func>)
有人能给我指出正确的方向吗?非常感谢!