Reputation: 111
How do I open .NPY files in python so that I can read them? I've been trying to run some code I've found but it outputs in .NPY files so I can't tell if its working.
Upvotes: 9
Views: 52229
Reputation: 159
Late reply but I think NPYViewer
is a tool that can help you, as it allows you to quickly visualize the contents of .npy
files without having to write code. It also has options to visualize 2D .npy arrays as grayscale images as well as 3D point clouds.
Reference: https://github.com/csmailis/NPYViewer
Upvotes: 6
Reputation: 219
*.npy files are binary files to store numpy arrays. They are created with
import numpy as np
data = np.random.normal(0, 1, 100)
np.save('data.npy', data)
And read in like
import numpy as np
data = np.load('data.npy')
Upvotes: 17