Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.to_csv fails: "line_terminator" has been renamed to "lineterminator" in pandas-1.5.0 #13

Open
GabiBaumann opened this issue Nov 10, 2023 · 0 comments

Comments

@GabiBaumann
Copy link

.to_csv fails with the message:

"""
<spss_converter.Metadata.Metadata object at 0x7fa53c6ebf90>
Traceback (most recent call last):
File "/home/andre/Python/Export_CSV/converter-skeleton.py", line 6, in
bla = spss_converter.to_csv('source.sav', line_terminator = '\n')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andre/Python/Export_CSV/venv/lib/python3.11/site-packages/spss_converter/read.py", line 428, in to_csv
result = df.to_csv(target,
^^^^^^^^^^^^^^^^^
TypeError: NDFrame.to_csv() got an unexpected keyword argument 'line_terminator'
"""

The pandas doc [1] tells me:
"""
lineterminator str, optional

The newline character or character sequence to use in the output file. Defaults to os.linesep, which depends on the OS in which this method is called (’\n’ for linux, ‘\r\n’ for Windows, i.e.).

Changed in version 1.5.0: Previously was line_terminator, changed for consistency with read_csv and the standard library ‘csv’ module.

"""
[1]: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_csv.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant