title: How to preserve matlab struct when accessing in python?
body: <p>I have a mat-file that I accessed using </p>
  
  <pre><code>from scipy import io
  mat = io.loadmat('example.mat')
  </code></pre>
  
  <p>From matlab, example.mat contains the following struct</p>
  
  <pre><code>    &gt;&gt; load example.mat
      &gt;&gt; data1
  
      data1 =
  
              LAT: [53x1 double]
              LON: [53x1 double]
              TIME: [53x1 double]
              units: {3x1 cell}
  
  
      &gt;&gt; data2
  
      data2 = 
  
              LAT: [100x1 double]
              LON: [100x1 double]
              TIME: [100x1 double]
              units: {3x1 cell}
  </code></pre>
  
  <p>In matlab, I can access data as easy as data2.LON, etc.. It's not as trivial in python. It give me several option though like </p>
  
  <pre><code>mat.clear       mat.get         mat.iteritems   mat.keys        mat.setdefault  mat.viewitems   
  mat.copy        mat.has_key     mat.iterkeys    mat.pop         mat.update      mat.viewkeys    
  mat.fromkeys    mat.items       mat.itervalues  mat.popitem     mat.values      mat.viewvalues    
  </code></pre>
  
  <p>Is is possible to preserve the same structure in python? If not, how to best access the data? The present python code that I am using is very difficult to work with. </p>
  
  <p>Thanks  </p>