I have an numpy array of form
a = [1,2,3]
which I want to save to a .txt file such that the file looks like:
1 2 3
If I use numpy.savetxt then I get a file like:
1
2
3
There should be a easy solution to this I suppose, any suggestions?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If
numpy >= 1.5, you can do:Edit
several 1D arrays with same length
several 1D arrays with variable length