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
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}
The text was updated successfully, but these errors were encountered:
Thanks for the report. It is the length of the string, if it is less than 256 characters, then variable_display_width is written correctly. If 256 or more then you get 0.
This looks like coming from the C code (Readstat, so I'll file an issue over there on your behalf)
The Parameter for setting the display width is ignored:
The text was updated successfully, but these errors were encountered: