我有一个1分钟的OHLC价格CSV文件,我正在尝试将其重新采样为15分钟的柱形图。我使用的代码来自这个链接,如下所示:
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>)
有人能指导我正确的方向吗?非常感谢!