9951 explained code solutions for 126 technologies

python-numpyHow to load Numpy matrix from text file

import numpy as np

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

load Numpy module for Python


load array from text file


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


will contain loaded matrix