I am using Spyder IDE and Python 2.7.
I have a npz file called data.npz which was given to me. I want to load this file into Spyder and view whatever is inside.
To start I've done this:
import numpy as np
data = np.load('data.npz')
In my Variable Explorer in Spyder, I have a variable with the name "data" and the type "object". When I double-click on this variable, Spyder gives an error saying "object arrays are currently not supported".
When I just type
data
I get something like this:
array({'a': array([ 1,2,3, ...,
4,5,6]), 'b': 10, 'c': array([-1,-2,-3]), 'd': 25, 'e': 1}, dtype=object)
How do I access 'a', 'b', 'c', 'd', etc?
to obtain a list of all the constituent files, simply use:
$ data.files
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With