Split train and test set

Hi everyone! I have a dataset (input) that is a matrix H * W(ndarray) and a ndarray (target) of dimension H. I tried to split the dataset in train and test set:

    X_train, X_test, y_train, y_test = train_test_split(M, L, test_size=0.3)

where M is the matrix and L is the array containing the labels. The code works but the most of the rows of X_train and y_train are zero. Where am I wrong?

Are you sure that W and L are non-zero? train_test_split() does not change the data.

I used a function to create the matrix. I also did the debug and M has many rows(H=100000) and 25 columns (W) and it has not zero elements. L is H dimensional array.