Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
Just upgraded to WinPython 3.8.5 and now an extra line is added with the Pandas DataFrame to_csv() method.
import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.randint(0,15,size=(15, 4)), columns=list('ABCD'))
df.to_csv('d://data//df.csv')
# gives
,A,B,C,D
0,2,3,0,1
1,0,1,2,0
2,0,4,2,0
3,0,0,3,2
Where as with the line_terminator explicitly referenced:
df.to_csv('d://data//test.csv',line_terminator='\n')
# gives the normal output expected
,A,B,C,D
0,2,3,0,1
1,0,1,2,0
2,0,4,2,0
3,0,0,3,2
4,4,4,0,4
Did upgrade to pandas 1.1.1 from 1.1.0 but had no effect and looks like non-expectant behaviour.
–
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.