Iterate over groups — Permalink. To iterate over dataframe groups in groupby() , the object returned by the call itself can be used as an iterator:.
pandas-groupby-iterate
Code: print df for name, group in df.groupby('l_customer_id_i').agg(lambda x: ','.join(x)): print name print group. I'm trying to just loop over the aggregated data, .... Not sure this is correct, you will have to check it. In any case you might get some ideas, for example how to Group by id and timeinterval. 3925e8d270
pandas groupby iterate, pandas groupby multiple columns iterate, pandas iterate groupby count, pandas groupby iteration order, pandas groupby loop groups
Comments