title: Creating 2D array with values in python with values from another array
body: <p>i am trying to get better at coding in python and am stuck at a fairly standard problem.
  I have a given array, and need to create an array with double the lines. The new array should correspond to the original in such a way, that two lines in the new array contain the same values as one value in the original.
  I am working with Python 3.7 and numpy arrays.</p>
  <p>Example:</p>
  <pre><code>original_array = [[1,2,3],
                    [4,5,6],
                    [7,8,9]]
  result = [[1,2,3],
            [1,2,3],
            [4,5,6],
            [4,5,6],
            [7,8,9],
            [7,8,9]]
  </code></pre>
  <p>There is a manual way to do that:</p>
  <pre><code>result = np.zeros((original_array.shape[0]*2, original_array.shape[1]))
  for i in range(result.shape[0]):
      result[i]=original_array[i//2]
  </code></pre>
  <p>However since my application deals with very large arrays, i am trying to use library-functions as much as possible. After searching for a bit, i came up with the following:</p>
  <pre><code>result = np.fromfunction(lambda i,j: original_array[i//2][j], 
                           (original_array.shape[0]*2, original_array.shape[1]),
                           dtype=int)
  </code></pre>
  <p>However, this call produces a 4D array where most of the values are only from the first line, so it obviously does not work in the intended way.</p>
  <p>Why does this call fail and how can i achieve the wanted effect?</p>
  <p>Edit:</p>
  <p>I found out why the call failed. np.fromfunction(...) does not iterate directly over the indices, it gives them as arrays. When the resulting array differs from the original in size, then the access of the original array over indices does not work anymore in the intended way.</p>
  <p>Using np.repeat(...) as StupidWolf suggested works.</p>