title: How to replicate array to specific length array
body: <p>I want replicate a small array to specific length array</p>
  
  <p>Example:</p>
  
  <pre><code>var = [22,33,44,55] # ==&gt; len(var) = 4
  n = 13
  </code></pre>
  
  <p>The new array that I want would be: </p>
  
  <pre><code>var_new = [22,33,44,55,22,33,44,55,22,33,44,55,22]
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>import numpy as np
  var = [22,33,44,55]
  di = np.arange(13)
  var_new = np.empty(13)
  var_new[di] = var
  </code></pre>
  
  <p>I get error message:</p>
  
  <blockquote>
    <p>DeprecationWarning: assignment will raise an error in the future, most likely because your index result shape does not match the value array shape. You can use <code>arr.flat[index] = values</code> to keep the old behaviour.</p>
  </blockquote>
  
  <p>But I get my corresponding variable:</p>
  
  <pre><code>var_new
  array([ 22.,  33.,  44.,  55.,  22.,  33.,  44.,  55.,  22.,  33.,  44.,
      55.,  22.])
  </code></pre>
  
  <p>So, how to solve the error? Is there an alternative?</p>