Closed JinYang88 closed 3 years ago
Hello,
When you reshape an array into n dimensions, you only need to specify n-1 dimensions, the remaining one will be automatically computed (when you set -1).
m = df or np array m.shape = (10,20) m.reshape(10, 10, 2) == m.reshape(-1, 10, 2) == m.reshape(10,-1,2) == m.reshape(10,10,-1)
Cheers.
Thanks, that is really helpful!
What is the meaning of the -1 in df = df.reshape(-1,timesteps,n_dim) #use 3D input, n_dim = 1 for 1D time series?
Thanks!