Skip to content

Instantly share code, notes, and snippets.

@shotleft
Last active December 30, 2018 12:27
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/0532dd6ad95a3a3ffef3df58b4635180 to your computer and use it in GitHub Desktop.
Save shotleft/0532dd6ad95a3a3ffef3df58b4635180 to your computer and use it in GitHub Desktop.
Avoid_for_loops_1
df = pd.DataFrame({'Type' : ['click', 'buy', 'click', 'buy',
'click', 'buy', 'click', 'click'],
'Event' : ['one', 'one', 'two', 'three',
'two', 'two', 'one', 'three'],
'Statistic 1' : np.random.randn(8),
'Statistic 2' : np.random.randn(8)}).sort_values("Type")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment