【发布时间】:2018-07-05 22:15:16
【问题描述】:
我尝试实施here 提供的解决方案,但我收到“无效语法” 我正在尝试获取最大值 + 第一/最后一个值。
我的代码如下所示:
groups = df[df['isTrade'] == 1].groupby('dateTime_s')
print(groups.agg({
'Volume': np.sum,
'tradePrice':[np.max,lambda x: x.iloc[0]],
}).head(160))
感谢您的帮助!
【问题讨论】: