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]])
2

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.