title: How can I divide a numpy array into n sub-arrays using a sliding window of size m?
body: <p>I have a big NumPy array that I want to divide into many subarrays by moving a window of a particular size, here's my code in the case of subarrays of size 11:</p>
  
  <pre><code>import numpy as np
  
  x = np.arange(10000)
  T = np.array([])
  
  for i in range(len(x)-11):
      s = x[i:i+11]
      T = np.concatenate((T, s), axis=0)
  </code></pre>
  
  <p>But it is very slow for arrays having more than 1 million entries, is there any tip to make it faster?</p>