I’m using the savetxt function (description here) to save a matrix to a txt file, and I wonder what does the ‘newline’ parameter do? Also the ‘header’ parameter doesn’t seem to work with the latest numpy version.
Share
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.
It’s for setting how the end of a line is represented for interoperability between Mac/Linux/Windows.
Windows typically represents a line end with a carriage return character followed by a linefeed character (\r\n).
Mac used to use just a carriage return, and much Microsoft Mac software still saves files this way, but has used a linefeed for the past decade or so (\n).
Linux has always used a linefeed as far as I know (\n).