Skip to content

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

@kushal-s2c

Description

@kushal-s2c

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingrequires changes in Readstatwaiting for changes in the C library Readstat

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions