python : Bootstrapping by random sampling
<p>I have an array like this,</p>

<pre><code>[[  5.80084178e-05   1.20779787e-02  -2.65970238e-02]
 [ -1.36810406e-02   6.85722519e-02  -2.60280724e-01]
 [  4.21996519e-01  -1.43644036e-01   2.12904690e-01]
 [  3.03098198e-02   1.50170659e-02  -1.09683402e-01]
 [ -1.50776089e-03   7.22369575e-03  -3.71181228e-02]
 [ -3.04448275e-01  -3.66987035e-01   1.44618682e-01]
 [ -1.46744916e-01   3.47112167e-01   3.09550267e-01]
 [  1.16567762e-03   1.72858807e-02  -9.39297514e-02]
 [  1.25896836e-04   1.61310167e-02  -6.00253128e-02]
 [  1.65062798e-02   1.96933143e-02  -4.26540031e-02]
 [ -3.78020965e-03   7.51770012e-03  -3.67852984e-02]]
</code></pre>

<p>And I want to select any <code>n</code> (ex: 1000) number of random rows from these so the output will be:</p>

<pre><code>[[ -1.36810406e-02   1.72858807e-02  -4.26540031e-02]
 [  1.16567762e-03   7.51770012e-03  -2.60280724e-01]
  ....
  ....
  ....                                               ]]
</code></pre>

<p>i.e. the output rows are made by randomly selecting values from each column. The number of possible samples from above 11x3 array is 11*11*11 .</p>

<p>Can someone help me to do this in python?</p>

<p>If the above initial 11x3 array is 'A' ,</p>

<pre><code>import random

arr=np.zeros(shape=(1000,5))

for k in range(0,1000) :
  B=[]
  for i in range(0,3):
    B.append(random.choice(A.transpose()[i]))
  arr[k]=B
</code></pre>

<p>simply, 'arr' will give me what I am looking for. But isn't there a better, existing algorithm for this?</p>

python