insightindustry / spss-converter

A simple utility that converts SPSS data to / from Pandas DataFrames, CSV, Excel, JSON, YAML, and dict.
https://spss-converter.readthedocs.io/en/latest/
MIT License
9 stars 4 forks source link

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

Open GabiBaumann opened 11 months ago

GabiBaumann commented 11 months ago

.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.

"""