Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Sounds weird but... I can save to csv by using matplotlib.mlab.rec2csv, and then read to ndarray by using numpy.loadtxt. My case is simpler as I already have csv file. Here is an example how it works. </p> <pre><code>&gt;&gt;&gt; a = np.loadtxt( 'name.csv', skiprows=1, delimiter=',', converters = {0: lambda x: 0} ) &gt;&gt;&gt; a array([[ 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0.29, 0.29, 0.43, 0.29, 0. ], [ 0. , 0.71, 0.29, 0.57, 0. , 0. ], [ 0. , 1. , 0.57, 0.71, 0. , 0. ], [ 0. , 0.43, 0.29, 0.14, 0.14, 0. ], [ 0. , 1. , 0.43, 0.71, 0. , 0. ], [ 0. , 0.57, 0.57, 0.29, 0.14, 0. ], [ 0. , 1.43, 0.43, 0.86, 0.43, 0. ], [ 0. , 1. , 0.71, 0.57, 0. , 0. ], [ 0. , 1.14, 0.57, 0.29, 0. , 0. ], [ 0. , 1.43, 0.29, 0.71, 0.29, 0.29], [ 0. , 1.14, 0.43, 1. , 0.29, 0.29], [ 0. , 0.43, 1.14, 0.86, 0.43, 0.14], [ 0. , 1.14, 0.86, 0.86, 0.29, 0.29]]) &gt;&gt;&gt; t = a.any( axis = 1 ) &gt;&gt;&gt; t array([False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True], dtype=bool) &gt;&gt;&gt; a.ndim 2 </code></pre> <p>Also in my case I don't need a first column for making a decision. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload