我想问你如何保存在不同的数据框中
我有以下两个数据集:
Account Verified Paid Col1 Col2 Col3
1234 True True ... ... ...
1237 False True
1234 True True
4211 True True
1237 False True
312 False False
数据集2
Account Verified Paid Col1 Col2 Col3
41 True True ... ... ...
314 False False
41 True True
65 False False
To pass through all dataframes in my list, without replacing my df[i]
, and extract unique rows I used the following code:
filt = []
for i in range(0,1):
filt.append(df[i].groupby(list(df[I].Account)).agg('first').reset_index())
However, I would be also interested in passing through all dataframes in my list and, still not replacing my df, extract rows with duplicates.
For example, in the example above, I should have a dataframe that includes accounts 1234
and 1237
, and a dataframe that includes only 41
.
如何获得这两个数据集?