Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open an .npz file

Tags:

python

file

Someone sent me an .npz file. How can I open that file using Python, and read the data from it?

like image 567
blabla4321 Avatar asked Jul 12 '15 14:07

blabla4321


People also ask

How do I open a .NPZ file in Windows?

If you cannot open your NPZ file correctly, try to right-click or long-press the file. Then click "Open with" and choose an application. You can also display a NPZ file directly in the browser: Just drag the file onto this browser window and drop it.

What is an .NPZ file?

npz file format is a zipped archive of files named after the variables they contain. The archive is not compressed and each file in the archive contains one variable in . npy format.


1 Answers

use this in python3:

from numpy import load  data = load('out.npz') lst = data.files for item in lst:     print(item)     print(data[item]) 
like image 147
N.S Avatar answered Oct 09 '22 02:10

N.S