Created
November 25, 2018 04:37
-
-
Save niazangels/af6de108611118ea82237ed5481d6609 to your computer and use it in GitHub Desktop.
A pythonic train test split using 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
sample = np.random.choice(processed_data.index, size=int(len(processed_data)*0.9), replace=False) | |
train_data, test_data = processed_data.iloc[sample], processed_data.drop(sample) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment