9951 explained code solutions for 126 technologies


python-numpyHow to save array to file


import numpy as np

array = np.array([1,2,3])
np.save('/tmp/numpy', array)ctrl + c
import numpy as np

load Numpy module for Python

np.array

declare Numpy array

.save

save array to file

/tmp/numpy

path to file to save array to (file will have npy extension)

array

array to save to file