train_test_split() error: Found input variables with inconsistent numbers of samples
$begingroup$
Fairly new to Python but building out my first RF model based on some classification data. I've converted all of the labels into int64 numerical data and loaded into X and Y as a numpy array, but I am hitting an error when I am trying to train the models.
Here is what my arrays look like:
>>> X = np.array([[df.tran_cityname, df.tran_signupos, df.tran_signupchannel, df.tran_vmake, df.tran_vmodel, df.tran_vyear]])
>>> Y = np.array(df['completed_trip_status'].values.tolist())
>>> X
array([[[ 1, 1, 2, 3, 1, 1, 1, 1, 1, 3, 1,
3, 1, 1, 1, 1, 2, 1, 3, 1, 3, 3,
2, 3, 3, 1, 1, 1, 1],
[ 0, 5, 5, 1, 1, 1, 2, 2, 0, 2, 2,
3, 1, 2, 5, 5, 2, 1, 2, 2, 2, 2,
2, 4, 3, 5, 1, 0, 1],
[ 2, 2, 1, 3, 3, 3, 2, 3, 3, 2, 3,
2, 3, 2, 2, 3, 2, 2, 1, 1, 2, 1,
2, 2, 1, 2, 3, 1, 1],
[ 0, 0, 0, 42, 17, 8, 42, 0, 0, 0, 22,
0, 22, 0, 0, 42, 0, 0, 0, 0, 11, 0,
0, 0, 0, 0, 28, 17, 18],
[ 0, 0, 0, 70, 291, 88, 234, 0, 0, 0, 222,
0, 222, 0, 0, 234, 0, 0, 0, 0, 89, 0,
0, 0, 0, 0, 40, 291, 131],
[ 0, 0, 0, 2016, 2016, 2006, 2014, 0, 0, 0, 2015,
0, 2015, 0, 0, 2015, 0, 0, 0, 0, 2015, 0,
0, 0, 0, 0, 2016, 2016, 2010]]])
>>> Y
array(['NO', 'NO', 'NO', 'YES', 'NO', 'NO', 'YES', 'NO', 'NO', 'NO', 'NO',
'NO', 'YES', 'NO', 'NO', 'YES', 'NO', 'NO', 'NO', 'NO', 'NO', 'NO',
'NO', 'NO', 'NO', 'NO', 'NO', 'NO', 'NO'],
dtype='|S3')
>>> X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=0.3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/sklearn/cross_validation.py", line
2039, in train_test_split
arrays = indexable(*arrays)
File "/Library/Python/2.7/site-packages/sklearn/utils/validation.py", line
206, in indexable
check_consistent_length(*result)
File "/Library/Python/2.7/site-packages/sklearn/utils/validation.py", line
181, in check_consistent_length
" samples: %r" % [int(l) for l in lengths])
ValueError: Found input variables with inconsistent numbers of samples: [1, 29]
python scikit-learn sampling
$endgroup$
add a comment |
$begingroup$
Fairly new to Python but building out my first RF model based on some classification data. I've converted all of the labels into int64 numerical data and loaded into X and Y as a numpy array, but I am hitting an error when I am trying to train the models.
Here is what my arrays look like:
>>> X = np.array([[df.tran_cityname, df.tran_signupos, df.tran_signupchannel, df.tran_vmake, df.tran_vmodel, df.tran_vyear]])
>>> Y = np.array(df['completed_trip_status'].values.tolist())
>>> X
array([[[ 1, 1, 2, 3, 1, 1, 1, 1, 1, 3, 1,
3, 1, 1, 1, 1, 2, 1, 3, 1, 3, 3,
2, 3, 3, 1, 1, 1, 1],
[ 0, 5, 5, 1, 1, 1, 2, 2, 0, 2, 2,
3, 1, 2, 5, 5, 2, 1, 2, 2, 2, 2,
2, 4, 3, 5, 1, 0, 1],
[ 2, 2, 1, 3, 3, 3, 2, 3, 3, 2, 3,
2, 3, 2, 2, 3, 2, 2, 1, 1, 2, 1,
2, 2, 1, 2, 3, 1, 1],
[ 0, 0, 0, 42, 17, 8, 42, 0, 0, 0, 22,
0, 22, 0, 0, 42, 0, 0, 0, 0, 11, 0,
0, 0, 0, 0, 28, 17, 18],
[ 0, 0, 0, 70, 291, 88, 234, 0, 0, 0, 222,
0, 222, 0, 0, 234, 0, 0, 0, 0, 89, 0,
0, 0, 0, 0, 40, 291, 131],
[ 0, 0, 0, 2016, 2016, 2006, 2014, 0, 0, 0, 2015,
0, 2015, 0, 0, 2015, 0, 0, 0, 0, 2015, 0,
0, 0, 0, 0, 2016, 2016, 2010]]])
>>> Y
array(['NO', 'NO', 'NO', 'YES', 'NO', 'NO', 'YES', 'NO', 'NO', 'NO', 'NO',
'NO', 'YES', 'NO', 'NO', 'YES', 'NO', 'NO', 'NO', 'NO', 'NO', 'NO',
'NO', 'NO', 'NO', 'NO', 'NO', 'NO', 'NO'],
dtype='|S3')
>>> X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=0.3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/sklearn/cross_validation.py", line
2039, in train_test_split
arrays = indexable(*arrays)
File "/Library/Python/2.7/site-packages/sklearn/utils/validation.py", line
206, in indexable
check_consistent_length(*result)
File "/Library/Python/2.7/site-packages/sklearn/utils/validation.py", line
181, in check_consistent_length
" samples: %r" % [int(l) for l in lengths])
ValueError: Found input variables with inconsistent numbers of samples: [1, 29]
python scikit-learn sampling
$endgroup$
$begingroup$
In the future, please post programming questions to stackoverflow. This Q&A is about data science, not programming.
$endgroup$
– Ricardo Cruz
Aug 23 '18 at 21:21
add a comment |
$begingroup$
Fairly new to Python but building out my first RF model based on some classification data. I've converted all of the labels into int64 numerical data and loaded into X and Y as a numpy array, but I am hitting an error when I am trying to train the models.
Here is what my arrays look like:
>>> X = np.array([[df.tran_cityname, df.tran_signupos, df.tran_signupchannel, df.tran_vmake, df.tran_vmodel, df.tran_vyear]])
>>> Y = np.array(df['completed_trip_status'].values.tolist())
>>> X
array([[[ 1, 1, 2, 3, 1, 1, 1, 1, 1, 3, 1,
3, 1, 1, 1, 1, 2, 1, 3, 1, 3, 3,
2, 3, 3, 1, 1, 1, 1],
[ 0, 5, 5, 1, 1, 1, 2, 2, 0, 2, 2,
3, 1, 2, 5, 5, 2, 1, 2, 2, 2, 2,
2, 4, 3, 5, 1, 0, 1],
[ 2, 2, 1, 3, 3, 3, 2, 3, 3, 2, 3,
2, 3, 2, 2, 3, 2, 2, 1, 1, 2, 1,
2, 2, 1, 2, 3, 1, 1],
[ 0, 0, 0, 42, 17, 8, 42, 0, 0, 0, 22,
0, 22, 0, 0, 42, 0, 0, 0, 0, 11, 0,
0, 0, 0, 0, 28, 17, 18],
[ 0, 0, 0, 70, 291, 88, 234, 0, 0, 0, 222,
0, 222, 0, 0, 234, 0, 0, 0, 0, 89, 0,
0, 0, 0, 0, 40, 291, 131],
[ 0, 0, 0, 2016, 2016, 2006, 2014, 0, 0, 0, 2015,
0, 2015, 0, 0, 2015, 0, 0, 0, 0, 2015, 0,
0, 0, 0, 0, 2016, 2016, 2010]]])
>>> Y
array(['NO', 'NO', 'NO', 'YES', 'NO', 'NO', 'YES', 'NO', 'NO', 'NO', 'NO',
'NO', 'YES', 'NO', 'NO', 'YES', 'NO', 'NO', 'NO', 'NO', 'NO', 'NO',
'NO', 'NO', 'NO', 'NO', 'NO', 'NO', 'NO'],
dtype='|S3')
>>> X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=0.3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/sklearn/cross_validation.py", line
2039, in train_test_split
arrays = indexable(*arrays)
File "/Library/Python/2.7/site-packages/sklearn/utils/validation.py", line
206, in indexable
check_consistent_length(*result)
File "/Library/Python/2.7/site-packages/sklearn/utils/validation.py", line
181, in check_consistent_length
" samples: %r" % [int(l) for l in lengths])
ValueError: Found input variables with inconsistent numbers of samples: [1, 29]
python scikit-learn sampling
$endgroup$
Fairly new to Python but building out my first RF model based on some classification data. I've converted all of the labels into int64 numerical data and loaded into X and Y as a numpy array, but I am hitting an error when I am trying to train the models.
Here is what my arrays look like:
>>> X = np.array([[df.tran_cityname, df.tran_signupos, df.tran_signupchannel, df.tran_vmake, df.tran_vmodel, df.tran_vyear]])
>>> Y = np.array(df['completed_trip_status'].values.tolist())
>>> X
array([[[ 1, 1, 2, 3, 1, 1, 1, 1, 1, 3, 1,
3, 1, 1, 1, 1, 2, 1, 3, 1, 3, 3,
2, 3, 3, 1, 1, 1, 1],
[ 0, 5, 5, 1, 1, 1, 2, 2, 0, 2, 2,
3, 1, 2, 5, 5, 2, 1, 2, 2, 2, 2,
2, 4, 3, 5, 1, 0, 1],
[ 2, 2, 1, 3, 3, 3, 2, 3, 3, 2, 3,
2, 3, 2, 2, 3, 2, 2, 1, 1, 2, 1,
2, 2, 1, 2, 3, 1, 1],
[ 0, 0, 0, 42, 17, 8, 42, 0, 0, 0, 22,
0, 22, 0, 0, 42, 0, 0, 0, 0, 11, 0,
0, 0, 0, 0, 28, 17, 18],
[ 0, 0, 0, 70, 291, 88, 234, 0, 0, 0, 222,
0, 222, 0, 0, 234, 0, 0, 0, 0, 89, 0,
0, 0, 0, 0, 40, 291, 131],
[ 0, 0, 0, 2016, 2016, 2006, 2014, 0, 0, 0, 2015,
0, 2015, 0, 0, 2015, 0, 0, 0, 0, 2015, 0,
0, 0, 0, 0, 2016, 2016, 2010]]])
>>> Y
array(['NO', 'NO', 'NO', 'YES', 'NO', 'NO', 'YES', 'NO', 'NO', 'NO', 'NO',
'NO', 'YES', 'NO', 'NO', 'YES', 'NO', 'NO', 'NO', 'NO', 'NO', 'NO',
'NO', 'NO', 'NO', 'NO', 'NO', 'NO', 'NO'],
dtype='|S3')
>>> X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=0.3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/sklearn/cross_validation.py", line
2039, in train_test_split
arrays = indexable(*arrays)
File "/Library/Python/2.7/site-packages/sklearn/utils/validation.py", line
206, in indexable
check_consistent_length(*result)
File "/Library/Python/2.7/site-packages/sklearn/utils/validation.py", line
181, in check_consistent_length
" samples: %r" % [int(l) for l in lengths])
ValueError: Found input variables with inconsistent numbers of samples: [1, 29]
python scikit-learn sampling
python scikit-learn sampling
edited 13 mins ago
Damini Jain
1073
1073
asked Jul 6 '17 at 5:17
josh_grayjosh_gray
68114
68114
$begingroup$
In the future, please post programming questions to stackoverflow. This Q&A is about data science, not programming.
$endgroup$
– Ricardo Cruz
Aug 23 '18 at 21:21
add a comment |
$begingroup$
In the future, please post programming questions to stackoverflow. This Q&A is about data science, not programming.
$endgroup$
– Ricardo Cruz
Aug 23 '18 at 21:21
$begingroup$
In the future, please post programming questions to stackoverflow. This Q&A is about data science, not programming.
$endgroup$
– Ricardo Cruz
Aug 23 '18 at 21:21
$begingroup$
In the future, please post programming questions to stackoverflow. This Q&A is about data science, not programming.
$endgroup$
– Ricardo Cruz
Aug 23 '18 at 21:21
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
You are running into that error because your X and Y don't have the same length (which is what train_test_split requires), i.e., X.shape[0] != Y.shape[0]. Given your current code:
>>> X.shape
(1, 6, 29)
>>> Y.shape
(29,)
To fix this error:
- Remove the extra list from inside of
np.array()when definingXor remove the extra dimension afterwards with the following command:X = X.reshape(X.shape[1:]). Now, the shape ofXwill be (6, 29). - Transpose
Xby runningX = X.transpose()to get equal number of samples inXandY. Now, the shape ofXwill be (29, 6) and the shape ofYwill be (29,).
$endgroup$
1
$begingroup$
Amazing this worked for me! Thanks Tuomastik! I really appreciate the guidance :)
$endgroup$
– josh_gray
Jul 13 '17 at 12:45
add a comment |
$begingroup$
Isn't train_test_split expecting both X and Y to be a list of same length? Your X has length of 6 and Y has length of 29. May be try converting that to pandas dataframe (with 29x6 dimension) and try again?
Given your data, it looks like you have 6 features. In that case, try to convert your X to have 29 rows and 6 columns. Then pass that dataframe to train_test_split. You can convert your list to dataframe using pd.DataFrame.from_records.
$endgroup$
$begingroup$
Thanks for the help Sal! You're right, I just had to convert it to the same lengths. My X.shape was (1, 6, 29) and Y.shape was (29, ). I just had to reshape them and it all worked fine for me :)
$endgroup$
– josh_gray
Jul 13 '17 at 12:47
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "557"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f20199%2ftrain-test-split-error-found-input-variables-with-inconsistent-numbers-of-sam%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
You are running into that error because your X and Y don't have the same length (which is what train_test_split requires), i.e., X.shape[0] != Y.shape[0]. Given your current code:
>>> X.shape
(1, 6, 29)
>>> Y.shape
(29,)
To fix this error:
- Remove the extra list from inside of
np.array()when definingXor remove the extra dimension afterwards with the following command:X = X.reshape(X.shape[1:]). Now, the shape ofXwill be (6, 29). - Transpose
Xby runningX = X.transpose()to get equal number of samples inXandY. Now, the shape ofXwill be (29, 6) and the shape ofYwill be (29,).
$endgroup$
1
$begingroup$
Amazing this worked for me! Thanks Tuomastik! I really appreciate the guidance :)
$endgroup$
– josh_gray
Jul 13 '17 at 12:45
add a comment |
$begingroup$
You are running into that error because your X and Y don't have the same length (which is what train_test_split requires), i.e., X.shape[0] != Y.shape[0]. Given your current code:
>>> X.shape
(1, 6, 29)
>>> Y.shape
(29,)
To fix this error:
- Remove the extra list from inside of
np.array()when definingXor remove the extra dimension afterwards with the following command:X = X.reshape(X.shape[1:]). Now, the shape ofXwill be (6, 29). - Transpose
Xby runningX = X.transpose()to get equal number of samples inXandY. Now, the shape ofXwill be (29, 6) and the shape ofYwill be (29,).
$endgroup$
1
$begingroup$
Amazing this worked for me! Thanks Tuomastik! I really appreciate the guidance :)
$endgroup$
– josh_gray
Jul 13 '17 at 12:45
add a comment |
$begingroup$
You are running into that error because your X and Y don't have the same length (which is what train_test_split requires), i.e., X.shape[0] != Y.shape[0]. Given your current code:
>>> X.shape
(1, 6, 29)
>>> Y.shape
(29,)
To fix this error:
- Remove the extra list from inside of
np.array()when definingXor remove the extra dimension afterwards with the following command:X = X.reshape(X.shape[1:]). Now, the shape ofXwill be (6, 29). - Transpose
Xby runningX = X.transpose()to get equal number of samples inXandY. Now, the shape ofXwill be (29, 6) and the shape ofYwill be (29,).
$endgroup$
You are running into that error because your X and Y don't have the same length (which is what train_test_split requires), i.e., X.shape[0] != Y.shape[0]. Given your current code:
>>> X.shape
(1, 6, 29)
>>> Y.shape
(29,)
To fix this error:
- Remove the extra list from inside of
np.array()when definingXor remove the extra dimension afterwards with the following command:X = X.reshape(X.shape[1:]). Now, the shape ofXwill be (6, 29). - Transpose
Xby runningX = X.transpose()to get equal number of samples inXandY. Now, the shape ofXwill be (29, 6) and the shape ofYwill be (29,).
edited Jan 6 at 23:46
answered Jul 6 '17 at 6:21
tuomastiktuomastik
763420
763420
1
$begingroup$
Amazing this worked for me! Thanks Tuomastik! I really appreciate the guidance :)
$endgroup$
– josh_gray
Jul 13 '17 at 12:45
add a comment |
1
$begingroup$
Amazing this worked for me! Thanks Tuomastik! I really appreciate the guidance :)
$endgroup$
– josh_gray
Jul 13 '17 at 12:45
1
1
$begingroup$
Amazing this worked for me! Thanks Tuomastik! I really appreciate the guidance :)
$endgroup$
– josh_gray
Jul 13 '17 at 12:45
$begingroup$
Amazing this worked for me! Thanks Tuomastik! I really appreciate the guidance :)
$endgroup$
– josh_gray
Jul 13 '17 at 12:45
add a comment |
$begingroup$
Isn't train_test_split expecting both X and Y to be a list of same length? Your X has length of 6 and Y has length of 29. May be try converting that to pandas dataframe (with 29x6 dimension) and try again?
Given your data, it looks like you have 6 features. In that case, try to convert your X to have 29 rows and 6 columns. Then pass that dataframe to train_test_split. You can convert your list to dataframe using pd.DataFrame.from_records.
$endgroup$
$begingroup$
Thanks for the help Sal! You're right, I just had to convert it to the same lengths. My X.shape was (1, 6, 29) and Y.shape was (29, ). I just had to reshape them and it all worked fine for me :)
$endgroup$
– josh_gray
Jul 13 '17 at 12:47
add a comment |
$begingroup$
Isn't train_test_split expecting both X and Y to be a list of same length? Your X has length of 6 and Y has length of 29. May be try converting that to pandas dataframe (with 29x6 dimension) and try again?
Given your data, it looks like you have 6 features. In that case, try to convert your X to have 29 rows and 6 columns. Then pass that dataframe to train_test_split. You can convert your list to dataframe using pd.DataFrame.from_records.
$endgroup$
$begingroup$
Thanks for the help Sal! You're right, I just had to convert it to the same lengths. My X.shape was (1, 6, 29) and Y.shape was (29, ). I just had to reshape them and it all worked fine for me :)
$endgroup$
– josh_gray
Jul 13 '17 at 12:47
add a comment |
$begingroup$
Isn't train_test_split expecting both X and Y to be a list of same length? Your X has length of 6 and Y has length of 29. May be try converting that to pandas dataframe (with 29x6 dimension) and try again?
Given your data, it looks like you have 6 features. In that case, try to convert your X to have 29 rows and 6 columns. Then pass that dataframe to train_test_split. You can convert your list to dataframe using pd.DataFrame.from_records.
$endgroup$
Isn't train_test_split expecting both X and Y to be a list of same length? Your X has length of 6 and Y has length of 29. May be try converting that to pandas dataframe (with 29x6 dimension) and try again?
Given your data, it looks like you have 6 features. In that case, try to convert your X to have 29 rows and 6 columns. Then pass that dataframe to train_test_split. You can convert your list to dataframe using pd.DataFrame.from_records.
answered Jul 6 '17 at 6:21
SalSal
1366
1366
$begingroup$
Thanks for the help Sal! You're right, I just had to convert it to the same lengths. My X.shape was (1, 6, 29) and Y.shape was (29, ). I just had to reshape them and it all worked fine for me :)
$endgroup$
– josh_gray
Jul 13 '17 at 12:47
add a comment |
$begingroup$
Thanks for the help Sal! You're right, I just had to convert it to the same lengths. My X.shape was (1, 6, 29) and Y.shape was (29, ). I just had to reshape them and it all worked fine for me :)
$endgroup$
– josh_gray
Jul 13 '17 at 12:47
$begingroup$
Thanks for the help Sal! You're right, I just had to convert it to the same lengths. My X.shape was (1, 6, 29) and Y.shape was (29, ). I just had to reshape them and it all worked fine for me :)
$endgroup$
– josh_gray
Jul 13 '17 at 12:47
$begingroup$
Thanks for the help Sal! You're right, I just had to convert it to the same lengths. My X.shape was (1, 6, 29) and Y.shape was (29, ). I just had to reshape them and it all worked fine for me :)
$endgroup$
– josh_gray
Jul 13 '17 at 12:47
add a comment |
Thanks for contributing an answer to Data Science Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f20199%2ftrain-test-split-error-found-input-variables-with-inconsistent-numbers-of-sam%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
In the future, please post programming questions to stackoverflow. This Q&A is about data science, not programming.
$endgroup$
– Ricardo Cruz
Aug 23 '18 at 21:21