当应用np.sum时,我得到一个ValueError,这是我产生聚合价值所需的.有什么建议可以解决这个问题吗?顺便说一句,这个逻辑以前对我来说是正确的.
df1 =
self_id | id | rating | comment |
1 820 (blank) (blank)
2 823 strong good performance
3 826 weak (blank)
#Pivoting the NaNs/unique values
ndf1 = pd.pivot_table(data=df1, index=['self_id'],
aggfunc={'id':np.unique,
'Ratings':np.sum,
'Comments':np.sum})
ValueError: Must produce aggregated value
提前谢谢您!