Skip to content

Instantly share code, notes, and snippets.

@niazangels
Created November 25, 2018 04:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niazangels/af6de108611118ea82237ed5481d6609 to your computer and use it in GitHub Desktop.
Save niazangels/af6de108611118ea82237ed5481d6609 to your computer and use it in GitHub Desktop.
A pythonic train test split using numpy
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