Skip to content

Instantly share code, notes, and snippets.

@shotleft
Last active December 30, 2018 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shotleft/8e9712e1b7736d148793d5d5f7cbf741 to your computer and use it in GitHub Desktop.
Save shotleft/8e9712e1b7736d148793d5d5f7cbf741 to your computer and use it in GitHub Desktop.
Avoid_for_loops_2
df_grouped = df.groupby("Type")
df_list_events = df_grouped['Event'].apply(lambda x: list(x)).to_frame().reset_index()
df_list_events
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment