首页 > 解决方案 > Python Pandas 聚合数据

问题描述

    import pandas as pd

df=pd.read_csv('txn.csv')
print(df)

#printing the data

     Date                   debit           credit
0  01-12-2019             100.00           0.00
1  05-12-2019             200.00       500.00
2  01-12-2019             105.00       200.00
3  05-12-2019               10.00       100.00

我想打印汇总数据,即借方总和,贷方如下所述。

Date                    debit           credit
01-12-2019             205.00        200.00
05-12-2019             210.00       600.00

有什么建议吗

标签: python

解决方案



推荐阅读