使用pandas GroupBy和求和时为空结果?

时间:2019-06-11 21:23:10

标签: python pandas

我试图从熊猫数据框中求和一列,然后得到这个奇怪的输出。 我的代码如下:

DataFrame.groupby('column1').column2.sum()

我没有得到column2的总和,而是得到了以下输出:

Series([], Name: column2, dtype: int64)

为什么会得到这个结果?

0 个答案:

没有答案