title: Saving dictionary of numpy arrays
body: <p>So I have a DB with a couple of years worth of site data. I am now attempting to use that data for analytics - plotting and sorting of advertising costs by keyword, etc.</p>
  
  <p>One of the data grabs from the DB takes minutes to complete. While I could spend some time optimizing the SQL statements I use to get the data I'd prefer to simply leave that class and it's SQL alone, grab the data, and save the results to a data file for faster retrieval later. Most of this DB data isn't going to change so I could write a separate python script to update the file every 24 hours and then use that file for this long running task.</p>
  
  <p>The data is being returned as a dictionary of numpy arrays. When I use <code>numpy.save('data', data)</code> the file is saved just fine. When I use <code>data2 = numpy.load('data.npy')</code> it loads the file without error. However, the output <code>data2</code> doesn't not equal the original <code>data</code>.</p>
  
  <p>Specifically the line <code>data == data2</code> returns false. Additionally, if I use the following:</p>
  
  <pre><code>for key, key_data in data.items():
    print key
  </code></pre>
  
  <p>it works. But when I replace <code>data.items()</code> with <code>data2.items()</code> then I get an error:</p>
  
  <pre><code>AttributeError: 'numpy.ndarray' object has no attribute 'items'
  </code></pre>
  
  <p>Using <code>type(data)</code> I get <code>dict</code>. Using <code>type(data2)</code> I get <code>numpy.ndarray</code>.</p>
  
  <p>So how do I fix this? I want the loaded data to equal the data I passed in for saving. Is there an argument to numpy.save to fix this or do I need some form of simple reformatting function to reformat the loaded data into the proper structure?</p>
  
  <p>Attempts to get into the <code>ndarray</code> via for loops or indexing all lead to errors about indexing a 0-d array. Casting like this <code>dict(data2)</code> also fails for iterating over a 0-d array. However, Spyder shows value of the array and it includes the data I saved. I just can't figure out how to get to it.</p>
  
  <p>If I need to reformat the loaded data I'd appreciate some example code on how to do this.</p>