Skip to content Skip to sidebar Skip to footer

How Do I View Data Object Contents Within An Npz File?

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

Solution 1:

to obtain a list of all the constituent files, simply use:

$ data.files

Solution 2:

Try accessing each key in the dictionary as follows:

data['a']  
data['b']

Solution 3:

print(data.files) will give you a list of arrays contained within the npz file. you can then use the data['a'] to view contents of a, and data['b'] to view b, so on and so forth

Post a Comment for "How Do I View Data Object Contents Within An Npz File?"