答案 0 :(得分:1)
尝试一下:
uniq_accounts = differenc['AccountID'].unique()
grped = differenc.groupby('AccountID')
## You can get the grouped data for a certain AccountId like this and store in a dictionary:
d = {}
for account in uniq_accounts:
d[account] = grped.get_group(account)
##Now, dictionary has all accounts data in separate dataframes. You can access like this:
for key in d.keys():
print(d[key])
## If you want to fetch data for a particular AccountID(lets say 316001718201), you can do:
print(d['316001718201'])
让我知道是否有帮助。
答案 1 :(得分:0)
使用DataFrame的groupby函数应该可以实现,在这种情况下,该函数可能为differenc.groupby('AccountID')