Last active
March 14, 2019 10:27
-
-
Save harmtemolder/5d034649b05798187c5f1ce738336fa6 to your computer and use it in GitHub Desktop.
Split a dataframe between a train and test dataframe using only numpy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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