9951 explained code solutions for 126 technologies


python-numpyHow to load Numpy array from text file


import numpy as np

array = np.loadtxt('/tmp/numpy.txt')ctrl + c
import numpy as np

load Numpy module for Python

.loadtxt

load array from text file

/tmp/numpy.txt

path to text file that was previously saved with savetxt()

array

will contain loaded array