title: How to save dictionaries and arrays in the same archive (with numpy.savez)
body: <p>first question here. I'll try to be concise.</p>
  
  <p>I am generating multiple arrays containing feature information for a machine learning application. As the arrays do not have equal dimensions, I store them in a dictionary rather than in an array. There are two different kinds of features, so I am using two different dictionaries.</p>
  
  <p>I also generate labels to go with the features. These labels are stored in arrays. Additionally, there are strings containing the exact parameters used for running the script and a timestamp. </p>
  
  <p>All in all it looks like this:</p>
  
  <pre><code>import numpy as np    
  
  feature1 = {}
  feature2 = {}
  label1 = np.array([])
  label2 = np.array([])
  docString = 'Commands passed to the script were...'
  
  # features look like this:
  feature1 = {'case 1': np.array([1, 2, 3, ...]),
              'case 2': np.array([2, 1, 3, ...]),
              'case 3': np.array([2, 3, 1, ...]),
              and so on... }
  </code></pre>
  
  <p>Now my goal would be to do this:</p>
  
  <pre><code>np.savez(outputFile, 
           saveFeature1 = feature1, 
           saveFeature2 = feature2, 
           saveLabel1 = label1, 
           saveLabel2 = label2,
           saveString = docString)
  </code></pre>
  
  <p>This seemingly works (i.e. such a file is saved with no error thrown and can be loaded again). However, when I try to load for example the feature from the file again:</p>
  
  <pre><code>loadedArchive = np.load(outFile)
  loadedFeature1 = loadedArchive['saveFeature1']
  loadedString = loadedArchive['saveString']
  </code></pre>
  
  <p>Then instead of getting a dictionary back, I get a numpy array of shape (0) where I don't know how to access the contents:</p>
  
  <pre><code>In []: loadedFeature1
  Out[]: 
         array({'case 1': array([1, 2, 3, ...]), 
                'case 2': array([2, 3, 1, ...]), 
                ..., }, dtype=object)
  </code></pre>
  
  <p>Also strings become arrays and get a strange datatype:</p>
  
  <pre><code>In []: loadedString.dtype
  Out[]: dtype('|S20')
  </code></pre>
  
  <p>So in short, I am assuming this is not how it is done correctly. However I would prefer not to put all variables into one big dictionary because I will retrieve them in another process and would like to just loop over the dictionary.keys() without worrying about string comparison.</p>
  
  <p>Any ideas are greatly appreciated.
  Thanks</p>