title: Open .mat (matlab data) using python
body: <p>I tried to import and read .mat file from Python. I have tried two ways but been unsuccessful.</p>
  <p>Method 1 (In Python):</p>
  <pre class="lang-python prettyprint-override"><code>import scipy.io as sio    
  mat = sio.loadmat('path/tmpPBworkspace.mat')
  </code></pre>
  <p>I get a message similar to:</p>
  <pre><code>{'None': MatlabOpaque([ (b'rateQualityOutTrim', b'MCOS', b'dataset', array([[3707764736],
          [         2],
          [         1],
          [         1],
          [         1],
          [         1]], dtype=uint32))],
                dtype=[('s0', 'O'), ('s1', 'O'), ('s2', 'O'), ('arr', 'O')]),
   '__function_workspace__': array([[ 0,  1, 73, ...,  0,  0,  0]], dtype=uint8),
   '__globals__': [],
   '__header__': b'MATLAB 5.0 MAT-file, Platform: GLNXA64, Created on: Thu May 10 07:11:52 2018',
   '__version__': '1.0'}
  </code></pre>
  <p>I am not sure what went wrong there? I was hoping to see a data frame. Also to add, in Method 1, I have saved the .mat in a version compatible with SciPy.</p>
  <p>In Matlab:</p>
  <pre class="lang-matlab prettyprint-override"><code>save('path/tmpPBworkspace.mat','rateQualityOutTrim','-v7')
  </code></pre>
  <p>Also tried the other way:</p>
  <p>Method 2: h5py</p>
  <p>In Matlab:</p>
  <pre class="lang-matlab prettyprint-override"><code>save('path/tmpPBworkspaceH5.mat','rateQualityOutTrim','-v7.3')
  </code></pre>
  <p>In Python:</p>
  <pre class="lang-python prettyprint-override"><code>import numpy as np
  import h5py
  f = h5py.File('/GAAR/ustr/projects/PBF/tmpPBworkspaceH5.mat','r')
  data = f.get('rateQualityOutTrim/date')
  data = np.array(data)
  </code></pre>
  <p>I get</p>
  <pre><code>f
  Out[154]: &lt;HDF5 file &quot;tmpPBworkspaceH5.mat&quot; (mode r)&gt;
  
  data
  array(None, dtype=object)
  </code></pre>
  <p>The array is empty. Not sure how I can access the data here as well.</p>