title: Python: Create a multidimensional array by stacking a 1D array in a loop
body: <p>Its been 2 days since I have been working on this problem but cannot break through. In the below code the inside for loop creates <code>pathwiseminS</code> an array of (252,) everytime it runs. </p>
  
  <p>What I want is when this loop ends to stack this in another array (row by row or column by column, anything that works!). In the end creating a multidimensional array called <code>total</code> which should be either (200,252) or (252,200). </p>
  
  <p>I have tried <code>np.concatenate</code>, '<code>np.vstack</code>, etc. but cannot get this right.</p>
  
  <pre><code>class pricing_lookback:
  def __init__(self, spot, rate, sigma, time, sims, steps):
      self.spot = spot
      self.rate = rate
      self.sigma = sigma
      self.time = time
      self.sims = sims
      self.steps = steps
      self.dt = self.time / self.steps
  
  def call_floatingstrike(self):
  
      simulationS = np.array([])
      simulationSt = np.array([])
      call2 = np.array([])
      total = np.array([])
      # total = np.empty(shape=[self.steps, self.sims])
      # total = np.empty(shape=self.steps,).reshape(self.steps)
      for j in range(self.sims):
          sT = self.spot
          pathwiseminS = np.array([])
          for i in range(self.steps):
              phi = np.random.normal()
              sT *= np.exp(
                  (self.rate - 0.5 * self.sigma * self.sigma) * self.dt + self.sigma * phi * np.sqrt(self.dt))
              pathwiseminS = np.append(pathwiseminS, sT)
              total = pathwiseminS.copy()
  
          # print(np.shape(pathwiseminS))
          total = np.append([total],[total], axis=0)
          # np.hstack((total,pathwiseminS.transpose()))
          # print(np.size(b), np.shape(b))
          call2 = np.append(call2, max(pathwiseminS[self.steps - 1] - self.spot, 0))
          # print (pathwiseminS[self.steps-1])
          # print(call2)
          simulationSt = np.append(simulationSt, pathwiseminS[self.steps - 1])
          simulationS = np.append(simulationS, min(pathwiseminS))
      # print(b)
      call = max(np.average(simulationSt) - np.average(simulationS), 0)
      return call, total  # ,call2,
  </code></pre>
  
  <p>If I print <code>total</code> in the end I get <code>(2,252)</code> matrix</p>