I get ‘TypeError:: ‘type’ object is not iterable’ when I use pandas.groupby

EDIT:

There was problem with pandas version, so for pandas 0.22 need change:

d=df.groupby('variable')['date_time'].agg(list).to_dict()

to:

d=df.groupby('variable')['date_time'].apply(list).to_dict()

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top