【发布时间】:2020-01-15 22:35:21
【问题描述】:
我在尝试将我的 CSV 拆分为 CSV 文件的最小值时遇到了问题,因此每个文件中只有唯一的 ID
通过运行
count = df['id'].value_counts().max()
我已经知道我应该创建的 csv 文件的数量(file1、file2、file3、file4)
我的预期输出应该是
文件1
person_name id Total Paid Date No
Deniss 55227 1191,75 0,00 21/08/2019 15/06/2018
RINALDS 56002 169,00 0,00 21/08/2019 15/06/2018
OLGA 54689 812,90 0,00 21/08/2019 15/05/2018
文件2
person_name id Total Paid Date No
Deniss 55227 1191,75 0,00 21/08/2019 20180615
RINALDS 56002 169,00 0,00 21/08/2019 20180615
OLGA 54689 812,90 0,00 21/08/2019 20180515
文件3
person_name id Total Paid Date No
Deniss 55227 1191,75 0,00 21/08/2019 20180613
RINALDS 56002 169,00 0,00 21/08/2019 20180614
文件4
person_name id Total Paid Date No
Deniss 55227 1191,75 0,00 21/08/2019 20180612
【问题讨论】:
标签: python pandas numpy csv pandas-groupby