Skip to content

Instantly share code, notes, and snippets.

@harmtemolder
Last active March 14, 2019 10:27
Show Gist options
  • Save harmtemolder/5d034649b05798187c5f1ce738336fa6 to your computer and use it in GitHub Desktop.
Save harmtemolder/5d034649b05798187c5f1ce738336fa6 to your computer and use it in GitHub Desktop.
Split a dataframe between a train and test dataframe using only numpy
np.random.seed(seed=42) # makes result reproducible
msk = np.random.rand(len(df)) < 0.8
train_df = df[msk]
eval_df = df[~msk]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment