Data_2d = data.reshape(-1, 1)

reshape(-1,1) ??? it works, but why?

I answer myself:
from stackoverflow

1 Like

It creates a second dimension and therefore gets a data matrix of shape (n_samples, 1) from a 1d-vector of shape (n_samples,).

1 Like

thanks for sharing! This is a great thread with detailed explanation. Clarified how reshape works to me.