Skip to content

Instantly share code, notes, and snippets.

@smaroukis
Created November 17, 2017 09:15
Show Gist options
  • Save smaroukis/e815b072615106fe73b88272b33e2703 to your computer and use it in GitHub Desktop.
Save smaroukis/e815b072615106fe73b88272b33e2703 to your computer and use it in GitHub Desktop.
# for DateTimeIndexed DataFrames
for name, group in df.groupby([lambda x: x.date(), 'Some Feature']):
# within groupby object
# for dropping duplicate indices (sometimes a problem with DateTimeIndices)
group=group[~group.index.duplicated(keep = 'first')]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment