text_plain_output_1.png
from sklearn.model_selection import train_test_split

import pandas as pd

train = pd.read_csv('../input/30-days-of-ml/train.csv', index_col=0)
test = pd.read_csv('../input/30-days-of-ml/test.csv', index_col=0)
sub = pd.read_csv('/kaggle/input/30-days-of-ml/sample_submission.csv')

y = train.target
X_all = pd.get_dummies(train.drop(['target'], axis=1).append(test)).copy()
X, X_test = (X_all[:300000], X_all[300000:])

from sklearn.model_selection import train_test_split
X_train, X_valid, y_train, y_valid = train_test_split(X[:5000], y[:5000], test_size=0.2, random_state=42)
print(X_train.shape, y_train.shape, X_valid.shape, y_valid.shape)