Skip to content

Instantly share code, notes, and snippets.

@warrienelly
Last active November 15, 2019 01:30
Show Gist options
  • Save warrienelly/170f6c313e43cae6ea3092d0b4a11ada to your computer and use it in GitHub Desktop.
Save warrienelly/170f6c313e43cae6ea3092d0b4a11ada to your computer and use it in GitHub Desktop.
Sampling with Python
import pandas as pd
import numpy as np
# Read dataset
data = pd.read_csv("data.csv")
## Getting 100 random sample from a dataset
rand_sample = data.sample()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment