train_test_split() error: Found input variables with inconsistent numbers of samples
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:

&gt;&gt;&gt; X.shape
(1, 6, 29)
&gt;&gt;&gt; Y.shape
(29,)


To fix this error:


Remove the extra list from inside of np.array() when defining X or remove the extra dimension afterwards with the following command: X = X.reshape(X.shape[1:]). Now, the shape of X will be (6, 29).
Transpose X by running X = X.transpose() to get equal number of samples in X and Y. Now, the shape of X will be (29, 6) and the shape of Y will be (29,).