Skip to content

Instantly share code, notes, and snippets.

@vegarsti
Last active May 9, 2018 09:11
Show Gist options
  • Save vegarsti/e598ec9844ca2311be8765c7fca0224d to your computer and use it in GitHub Desktop.
Save vegarsti/e598ec9844ca2311be8765c7fca0224d to your computer and use it in GitHub Desktop.
  • To count occurrences when aggregating (e.g. in pivot_table), use len as aggfunc!

  • To drop a row: Cheatsheet

    • df[df.name != 'Tina']
    • df.drop(df.index[2])
  • c['a'].shift(periods=1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment