-3

I am running a Python code and need to save the data in csv format. However, just can't success. I write the code or save the data as below:

np.save('clear-m.csv', [SEn_thg, bta_thg])
np.save('blur-m.csv', [SEn_3ph, bta_3ph])

but what I get is still an NPY file instead of a csv file as below:

clear-m.csv.npy
blur-m.csv.npy

Please suggest me how to do that right?

1

1 Answer 1

1

Try savetxt() method:

np.savetxt("clear-m.csv", [SEn_thg, bta_thg], delimiter=",")
Sign up to request clarification or add additional context in comments.

1 Comment

Questions that can be answered with a simple google search have usually already been asked and answered on Stack Overflow. In such cases, it's better to flag / vote to close this question as a duplicate instead of adding your own answer.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.