我正在处理由时间序列组成的数据集,包括Amount
列和各种其他变量。我想根据年度和季度对列进行分组,然后在这些特定的时间行中使用Amount
对这些列进行聚合。语法如下所示
ts_quarter = df.groupby(df['Date'].dt.year, df['Date'].dt.quarter).agg({'AmountInUSD'})['AmountInUSD']
它给出了以下错误:
TypeError: cannot concatenate 'str' and 'int' objects
我怎样才能解决这个问题?你知道吗
Tags:
目前没有回答
相关问题 更多 >
编程相关推荐