Median of each columns in python
<p>I am trying to find median of each column of my list in python. Here is my code snippet-</p>

<pre><code>X_train1=np.array(X_train1).astype(np.float)
median1= X_train1.median(axis=0)
</code></pre>

<p>But I am getting the following error-</p>

<pre><code>AttributeError: 'numpy.ndarray' object has no attribute 'median'
</code></pre>

<p>Here is my X_train1 array-</p>

<pre><code>[[  100.           100.           100.         ...,   100.           100.
    100.        ]
 [   91.56786232    96.62190102    98.08459941 ...,   100.4891341
     99.60223361    93.26315789]
 [   92.90859973    97.64075269   103.1123983  ...,    96.08483893
     99.20446722    86.42105263]
 ..., 
 [ 1193.656511      43.95921162   204.9478628  ...,   260.0710993
    196.0911803     12.53894737]
 [ 1199.482215      44.61122178   207.833733   ...,   266.2309527
    196.7031286     12.66526316]
 [ 1226.497073      44.64553811   209.5192855  ...,   267.744815
    199.6481297     13.01894737]]
</code></pre>

<p>You should use np.median.  e.g.:</p>

<pre><code>np.median(X_train1,axis=0)
</code></pre>

python numpy