Created
May 12, 2018 21:32
-
-
Save grohith327/0a1c10ca4d3f33e4b57d1b5e4ca3caad to your computer and use it in GitHub Desktop.
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
from sklearn.model_selection import train_test_split | |
x_train = [] | |
y_train = [] | |
x_test = [] | |
y_test = [] | |
X = [] | |
Y = [] | |
for row in rows: | |
X.append(int(''.join(row[0].split('/')))) | |
Y.append(row[3]) | |
x_train, x_test, y_train, y_test = train_test_split(X,Y,train_size=0.9,test_size=0.1) # split training and test data | |
# Convert lists into numpy arrays | |
x_train = np.array(x_train) | |
y_train = np.array(y_train) | |
x_test = np.array(x_test) | |
y_test = np.array(y_test) | |
# reshape the values as we have only one input feature | |
x_train = x_train.reshape(-1,1) | |
x_test = x_test.reshape(-1,1) |
the same error is happening here X.append(int(''.join(row[0].split('/'))))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I'm running this code I get this error: " X.append(int(''.join(row[0].split('/'))))
ValueError: invalid literal for int() with base 10: '16:00''