title: How to delete empty matlab struct in python?
body: <p>I am working with matlab files in python and in some files, it contains structs that are empty and needs to be removed from the file. In matlab, it will look as follows: 1x1 struct, [],[],[],1x1 struct. The idea is to remove the empty structs in between and combine the 2 struct files. </p>
  
  <p>I can only print out the shape of the struct and access each struct to check if it is empty or not but I am not sure how to proceed from there to remove them in Python. </p>
  
  <pre class="lang-py prettyprint-override"><code>from scipy.io import loadmat
  
  file = 'filepath'
  dict = {}
  mat_file = hdf5storage.loadmat(file)
  dict.update(mat_file)
  
  a = dict['bt']
  b = a.shape
  print(b)
  
  #accessing the struct which is empty
  dict['bt'][0,1]
  </code></pre>
  
  <p>results = array([], shape=(0, 0), dtype=float64)</p>
  
  <p>b results in a shape of (1,200) with empty structs in between them and I would like to delete these empty structs and combine the ones that have values in them.</p>