Created
April 20, 2018 18:57
-
-
Save alexrutherford/e81e9558b1fd019c6988b35379ca51f7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import sklearn.model_selection | |
import pandas as pd | |
df = pd.DataFrame(data={'A':[1,2,3],'B':[4,5,6],'C':[1,0,1]}) | |
res = sklearn.model_selection.train_test_split(df[['A','B']],df['C']) | |
# Returns 4 things | |
res[0].shape | |
# (2,2) | |
res[1].shape | |
# (1,2) | |
res[2].shape | |
# (2,) | |
res[3].shape | |
# (1,) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment