Read all the data from one row of matrix
<p>I am reading a .mat file using python  </p>

<pre><code>mat= sio.loadmat('C:/Users/machine-learning-ex3/ex3/ex3data1')
print(mat['X'])
print(mat['X'].shape)  
</code></pre>

<p>The out put looks like  </p>

<pre><code>[[ 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.]]
(5000, 400)  
</code></pre>

<p>How can I check only all the data of one row.<br>
While trying it gives error like:  </p>

<pre><code>TypeError: unhashable type: 'slice'
</code></pre>

<p>From <a href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.io.loadmat.html" rel="nofollow">reference</a>, loadmat returns dictionary with key as variable name and value as the loaded matrix. From your print statements,
mat['X'] is a 2-d array.</p>

<p>For showing ith row, simply write</p>

<pre><code>mat['X'][i] 
</code></pre>

<p>Where i is the index of the row.</p>

<p>PS: you didn't mention what did you try to get that error. If you still have problems, mention that too.</p>

python