Skip to content

Instantly share code, notes, and snippets.

@joonro
Created November 11, 2019 16:22
Show Gist options
  • Save joonro/8a4c609177c17afcb24028f2fdeed595 to your computer and use it in GitHub Desktop.
Save joonro/8a4c609177c17afcb24028f2fdeed595 to your computer and use it in GitHub Desktop.
[pandas groupby date and time] #python
# specify time frequency of groupby
groupby_freq = 'W'
gr = df.groupby(
pd.Grouper(key='date', freq=groupby_freq)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment