resample Pandas dataframe and merge strings in column

我们两清 提交于 2019-12-06 10:53:03

Your agg function for column 'C' should be a join

d.resample('D').agg({'A': sum, 'B': np.mean, 'C': ' - '.join})

              A     B           C
2017-01-31  1.0  10.0          ok
2017-02-01  NaN   NaN            
2017-02-02  NaN   NaN            
2017-02-03  5.0  25.0  merge - us
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!