Skip to content

write_sav: variable_display_width always 0 #72

@josmos

Description

@josmos

The Parameter for setting the display width is ignored:

import pandas as pd
import pyreadstat

df = pd.DataFrame({
    "v1": {
        "10001": """Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ac pretium sem. Fusce aliquet
        augue rhoncus consequat pulvinar. In est ex, porta congue diam sed, laoreet suscipit purus. Phasellus mollis
        lobortis tellus at vehicula. Etiam egestas augue id massa bibendum volutpat id et ipsum. Praesent ut lorem
        rhoncus, pharetra risus sed, pharetra sem. In pulvinar egestas erat, id condimentum tortor tempus sed. Duis
         ornare lacus ut ligula congue, non convallis urna dignissim. Etiam vehicula turpis sit amet nisi finibus
         laoreet. Duis molestie consequat nulla, non lobortis est tempus sit amet. Quisque elit est,
         congue non commodo vitae, porttitor ac erat. """,
        "10002": "fgsdghshsgh",
        "10003": "gsfdgsdg",
    },
    "v2": {
        "10001": "gsfdgsfdgsfg",
        "10002": "fgsdghshsgh",
        "10003": "gsfdgsdg",
    },

})

pyreadstat.write_sav(df, "export.sav", variable_display_width={"v1": 100})

df, meta = pyreadstat.read_sav("export.sav")
print(meta.variable_display_width)
#{'v1': 0, 'v2': 0}

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