Exporting my python dataframe to SPSS gives me extra variables coming from too-long strings

Viewed 35

I have an SPSS file where some variables contain long strings. When I import the data into python, everything runs smoothly. However, when I export my dataframe from python to SPSS, I suddenly see 43 extra variables in my SPSS dataset.

I guess the extra variables come from strings that are too long. My string variables are divided into 3 or 4 variables in the exported SPSS file.

How can I prevent this from happening?

The encoding is 'utf-8' and this is my export code:

%% Export pyreadstat.write_sav(recordings, export_result_path, compress =True , column_labels = meta.column_names_to_labels , variable_value_labels = meta.variable_value_labels

0 Answers
Related