1

I'm working with the python programming language

Suppose I have a file named "data.txt", written in the format below (the text is already written in the format of np.array):

([[0.0000000,   1.0893900,  0.0000000], [0.0000000, 1.0820800,  0.0000000], [0.0000000, 1.0815400,  0.0000000]])

How could I load the information from this file and save that data in an np.array variable?

What I need is something like loading the information from the txt file in the form below:

variable = np.array([[0.0000000,    1.0893900,  0.0000000], [0.0000000, 1.0820800,  0.0000000], [0.0000000, 1.0815400,  0.0000000]])
Emerson P L
  • 141
  • 6
  • https://stackoverflow.com/questions/14676265/how-to-read-a-text-file-into-a-list-or-an-array-with-python Here is the answer... – Tomas Crosta Mar 18 '21 at 03:35
  • To work arround my problem, i just cleaned the "(", "[", "]", and ")" symbols and use this answer https://stackoverflow.com/questions/42857861/load-txt-file-into-numpy-array Thank you anyways! – Emerson P L Mar 18 '21 at 04:00

1 Answers1

0

To work arround my problem, i just cleaned the "(", "[", "]", and ")" symbols and use this answer Load txt file into numpy array

Emerson P L
  • 141
  • 6