Numpy | Sololearn: Learn to code for FREE!

+4

Numpy

How can i create an array using data from another file?

4/10/2019 9:14:03 PM

Ahshshshshshsh

2 Answers

New Answer

+4

If you have a file called data.txt with the lines: 1 2 3 4 5 6 7 8 9 You could read it in numpy as a matrix with: matrix=numpy.loadtxt("data.txt") With one line in data.txt you get an array: 1 2 3 4 5 6 returned types in both cases are numpy.ndarray

0

how can I solve 7 simultaneous equations