Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

variable_display_width sets the Column value instead of Width value in sav metadata sheet using pyreadstat.write_sav() #280

Open
kushal-s2c opened this issue Dec 13, 2024 · 1 comment
Labels
bug Something isn't working requires changes in Readstat waiting for changes in the C library Readstat to be reported in Readstat

Comments

@kushal-s2c
Copy link

kushal-s2c commented Dec 13, 2024

I want to set the Width of variables in the Metadata sheet of sav(spss) file.

To Reproduce
pyreadstat.write_sav(
merged_df,
file_path,
column_labels=meta.column_names_to_labels,
variable_value_labels=meta.variable_value_labels,
variable_display_width={"RespondentID": 25, "SurveyID": 29}
)

I am using this to set the Width of Columns - RespondentId and SurveyId but it changes the Columns column of metadata instead of width data.
Screenshot from 2024-12-13 17-50-02

I am not able to upload an sav file here.

Expected behavior
A way to set the Width of variables in the metadata sheet.

@ofajardo
Copy link
Collaborator

Unfortunately this is an issue that has to be corrected in the C backend "Readstat". You can submit a ticket there if you wish. Once corrected there, I can adapt pyreadstat to be correct as well.

@ofajardo ofajardo added bug Something isn't working requires changes in Readstat waiting for changes in the C library Readstat to be reported in Readstat labels Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working requires changes in Readstat waiting for changes in the C library Readstat to be reported in Readstat
Projects
None yet
Development

No branches or pull requests

2 participants