You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, not sure how to tell if this is an issue in the c library or pyreadstat. Apologies if it is the former.
As the title says, the "Values" column becomes "None" for a String variable in SPSS if any value is longer than 8 characters.
To reproduce:
import pandas as pd
import pyreadstat
var_values = {'mycol':{'-111':'err1'}}
# I thought setting var_format might have an effect but it seems it does not
# just leaving this here in case you want to compare
var_format = {} # {'mycol':'A50'}
pyreadstat.write_sav(df=pd.DataFrame({'mycol':['-111', '123456789']}), # 2nd value is 9 chars
dst_path='var_values_is_none.sav',
variable_value_labels=var_values,
variable_format=var_format)
pyreadstat.write_sav(df=pd.DataFrame({'mycol':['-111', '12345678']}), # 2nd value is 8 chars
dst_path='var_values_is_NOT_none.sav',
variable_value_labels=var_values,
variable_format=var_format)
Hi, not sure how to tell if this is an issue in the c library or pyreadstat. Apologies if it is the former.
As the title says, the "Values" column becomes "None" for a String variable in SPSS if any value is longer than 8 characters.
To reproduce:
Relevant versions:
python 3.12.3
pyreadstat 1.2.7
pandas 2.2.2
The text was updated successfully, but these errors were encountered: