title: Adding results to a numpy array
body: <p>I am using python-3.x, and I want to create a numpy array called result_array that hold the binary result from each loop (minimum_arrray)</p>
  
  <pre><code># The code:
  import random
  import numpy as np
  np.set_printoptions(threshold=np.nan)
  i = 0
  ii= 0
  e = 2
  y = 2
  x = 2
  bin_arrray_size = 5
  # result_array = np.ndarray(shape=(), dtype=int)
  # result_array = np.ndarray(shape=(), dtype=int)
  for ii in range (e):
      bin_arrray = np.random.randint (2, size=(bin_arrray_size, y*x))
      print ("bin_arrray:" '\n', bin_arrray)
  
      flot= np.zeros ((bin_arrray_size, 1))
      for i in range (bin_arrray_size):
          X = bin_arrray[i]
  
          decimal=int(''.join(map(str,X[:].tolist())), 2)
          flot[i]  = (decimal * 2.324)
  
  #        print ("flot:" '\n', flot)
      for flot in np.nditer(flot, flags=['external_loop','buffered'], order='F'):
          print (" the flot :" '\n', flot)
      minimum_arrray = bin_arrray[flot.argpartition(0)[:1]]
  
      print ("Minimum_arrray:" '\n', minimum_arrray)
  #   result_array = np.vstack (result_array, minimum_arrray)
  
  print ("bin_arrray type:" '\n',type(bin_arrray))
  print("bin_arrray shape:" '\n', bin_arrray.shape)
  print ("flot type:" '\n', type(flot))
  print("flot shape:" '\n', flot.shape)
  print ("minimum_arrray type:" '\n', type(minimum_arrray))
  print("minimum_arrray shape:" '\n', minimum_arrray.shape)
  </code></pre>
  
  <p></p>
  
  <pre><code> ########## the Result #######
  bin_arrray:
   [[1 0 0 0]
   [0 0 0 1]
   [0 1 0 0]
   [0 1 0 1]
   [1 0 1 1]]
   the flot :
   [ 18.592   2.324   9.296  11.62   25.564]
  Minimum_arrray:
   [[0 0 0 1]]         ################ First result
  bin_arrray:
   [[0 1 0 0]
   [0 1 0 1]
   [0 0 0 1]
   [1 0 0 1]
   [1 0 0 0]]
   the flot :
   [  9.296  11.62    2.324  20.916  18.592]
  Minimum_arrray:
   [[0 0 0 1]]          ################ Second Result
  bin_arrray type:
   &lt;class 'numpy.ndarray'&gt;
  bin_arrray shape:
   (5, 4)
  flot type:
   &lt;class 'numpy.ndarray'&gt;
  flot shape:
   (5,)
  minimum_arrray type:
   &lt;class 'numpy.ndarray'&gt;
  minimum_arrray shape:
   (1, 4)
  </code></pre>
  
  <p></p>
  
  <p>I have tried this befor the loop:</p>
  
  <pre><code>result_array = np.random.random((2,4))
  </code></pre>
  
  <p>and this</p>
  
  <pre><code>result_array = np.ndarray(shape=(), dtype=int)
  </code></pre>
  
  <p>after the loop</p>
  
  <pre><code>result_array = np.vstack (result_array, minimum_arrray)
  </code></pre>
  
  <p>but none of them worked</p>
  
  <p>What I want to see a new array called (result_array) and look like this:</p>
  
  <pre><code>result_array:
      [[0 0 0 1]
      [0 0 0 1]]
  </code></pre>