title: Add an extra column to ndarray in python
body: <p>I have a ndarray as follows.</p>
  
  <pre><code>feature_matrix = [[0.1, 0.3], [0.7, 0.8], [0.8, 0.8]]
  </code></pre>
  
  <p>I have a position ndarray as follows.</p>
  
  <pre><code>position = [10, 20, 30]
  </code></pre>
  
  <p>Now I want to add the position value at the beginning of the feature_matrix as follows.</p>
  
  <pre><code>[[10, 0.1, 0.3], [20, 0.7, 0.8], [30, 0.8, 0.8]]
  </code></pre>
  
  <p>I tried the answers in this: <a href="https://stackoverflow.com/questions/8486294/how-to-add-an-extra-column-to-an-numpy-array">How to add an extra column to an numpy array</a></p>
  
  <pre><code>E.g.,
  
  feature_matrix = np.concatenate((feature_matrix, position), axis=1)
  </code></pre>
  
  <p>However, I get the error saying that;</p>
  
  <pre><code>ValueError: all the input arrays must have same number of dimensions
  </code></pre>
  
  <p>Please help me to resolve this prblem.</p>