Skip to content

Instantly share code, notes, and snippets.

@khuangaf
Created May 28, 2019 03:19
Show Gist options
  • Save khuangaf/55e317df96958f661d1e245c7fd3cd57 to your computer and use it in GitHub Desktop.
Save khuangaf/55e317df96958f661d1e245c7fd3cd57 to your computer and use it in GitHub Desktop.
#randomly sample a couple of them
sampled_session_id = np.random.choice(df.session_id.unique(), 1000000, replace=False)
df = df.loc[df.session_id.isin(sampled_session_id)]
df.nunique()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment