How to convert .sav file into csv file
Asked Answered
E

2

5

How do you convert .sav into .csv, or .sav into pandas DataFrame? Is there a direct way or doing this or a package that can do this?

Evocator answered 11/9, 2019 at 20:33 Comment(2)
Which .sav format are you asking about? Which program or library was used to create the .sav file?Denmark
It's an old SPSS file, I just want to manipulate it with PandasEvocator
M
0

You are probably looking for the pyreadstat module, you can find some code snippet to start on the github page.

Mycology answered 11/9, 2019 at 20:46 Comment(4)
I've followed the code and get an error, "from .pyreadstat import read_sas7bdat, read_xport, read_dta, read_sav, read_por, read_sas7bcat ImportError: DLL load failed: The specified module could not be found."Evocator
did you install the module using pip?Mycology
Why would this make a difference? I just use Pycharm interface and manually install these libraries from thereEvocator
maybe this can help youMycology
H
7

GNU PSPP project (replacement for the proprietary program SPSS) has a helper tool to do this online - https://pspp.benpfaff.org/

To do this locally 1. Download GNU PSPP - http://www.gnu.org/software/pspp/get.html 2. Use command line to do the conversion

pspp-convert <input.sav> <output.csv>

Similar question - How to open spss data files in excel?

Hephzipa answered 11/9, 2019 at 20:43 Comment(0)
M
0

You are probably looking for the pyreadstat module, you can find some code snippet to start on the github page.

Mycology answered 11/9, 2019 at 20:46 Comment(4)
I've followed the code and get an error, "from .pyreadstat import read_sas7bdat, read_xport, read_dta, read_sav, read_por, read_sas7bcat ImportError: DLL load failed: The specified module could not be found."Evocator
did you install the module using pip?Mycology
Why would this make a difference? I just use Pycharm interface and manually install these libraries from thereEvocator
maybe this can help youMycology

© 2022 - 2024 — McMap. All rights reserved.