title: Is there any way that I can insert columns in loop in numpy
body: <p>code in octave:</p>
  <pre><code> for j = 0:5
          k(:, end+1) = (X1.^j)
  </code></pre>
  <p>Code in numpy:</p>
  <pre><code> for j in range(0,5):
          k[?]=np.power(X1,j)
  </code></pre>
  <p>so here I want to add columns to k-array, suppose k=(10,1) dim and I want to make it (10,5) dim in the loop, above is code in octave and slicing is pretty much straight but is there any way that I can slice K and insert columns for every iteration. let me know if anyone helps clear this slicing better.</p>