title: Converting 2d array into 3d array in python
body: <p>Sorry for asking this question,if it is asked already, but in my case I have a special matrix of size 3000000x50 that I want to split it into 300 matrices of size 10000x50. I tried this but it is not working</p>
  
  <pre><code>&gt;&gt;&gt;import numpy as np
  &gt;&gt;&gt;data=np.random.randn(3000000,50)
  &gt;&gt;&gt;D=np.matrix.conjugate(data)
  &gt;&gt;&gt;ts=50
  &gt;&gt;&gt;ts=int(ts)       #number of time series that we have from our data
  &gt;&gt;&gt;lw=1e4
  &gt;&gt;&gt;lw=int(lw)    #length of each window 
  &gt;&gt;&gt;l=len(data)/lw   #l is number of windows
  &gt;&gt;&gt;l=np.floor(l)
  &gt;&gt;&gt;l=int(l)
  #Dc is used to seperate each time series in l windows
  &gt;&gt;&gt;Dc=np.zeros((l,lw,ts))
  &gt;&gt;&gt;for i in range(l):
      Dc[i][0:lw-1][0:ts-1]=D[(lw)*(i):(lw*(i+1))-1][0:ts-1]
  </code></pre>