pandas - Iterate on Groupby Object's fields -
I want to be able to iterate over a group object:
grouped = Df Groupby ('zzz') question_list = [a, b, c] How do I get a list of values for:
grouped .grouped.b grouped.c but using a for-loop?
You can either remove such a key
print Df Groupby ('zzz'). Groups.keys () To capture the grouped. You can do this ...
print df.groupby ('Zzz') group ['A'] or you can open the key, For this type of group
key, in df.groupby group ('Zzz'): print key # group key
Comments
Post a Comment