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

Convert csv into spss file problem #5

Closed Abhishekberma closed 2 years ago

Abhishekberma commented 3 years ago

i convert file by using spss-converter, i import your functions but this function is not working i show you my error.... Error Traceback (most recent call last): File "test.py", line 4, in spss_converter.from_csv('sample-data.csv', target = 'sample-data.sav') File "/usr/local/lib/python3.8/dist-packages/spss_converter/write.py", line 170, in from_csv result = from_dataframe(df, File "/usr/local/lib/python3.8/dist-packages/spss_converter/write.py", line 91, in from_dataframe pyreadstat.write_sav(df = df, File "pyreadstat/pyreadstat.pyx", line 773, in pyreadstat.pyreadstat.write_sav File "pyreadstat/_readstat_writer.pyx", line 610, in pyreadstat._readstat_writer.run_write File "/usr/lib/python3.8/os.py", line 806, in fsencode filename = fspath(filename) # Does type-checking of filename. TypeError: expected str, bytes or os.PathLike object, not _io.BufferedWriter

how i manage this error please ans

schanzel commented 2 years ago

This could fix it https://github.com/insightindustry/spss-converter/pull/6

insightindustry commented 2 years ago

Thanks, @schanzel : This issue was fixed with your PR #6 , and it has been released in v.0.1.2 ( #8 )