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
If I have multiple columns with same names(usually after I trim it to just 8 chars), I get a RecursionError: maximum recursion depth exceeded when running the following code.
importpandasaspdimportxportimportxport.v56df=pd.read_csv("temp.csv")
ds=xport.Dataset(df, name="DATA", label="Wonderful data")
ds=ds.rename(columns={k: k.upper()[:8] forkinds}) # <- can happen herelibrary=xport.Library({"DATA": ds})
withopen("example.xpt", "wb") asf:
xport.v56.dump(library, f) # <- or here
We will get recursion error on ds.rename line, but even if we were to use something like ds.columns = [c[:8] for c in ds.colums] we get a similar error in xport.v56.dump line. The csv file that I am using is relatively simple.
BIRTHDAY_DTC,BIRTHDAY_MONTH
12/10/1999,SEPT
pip freeze
pandas is not the latest but I had to pin it to that because otherwise the sas viewer was not showing labels, but I was also having this issue with pandas==1.2.4.
Thanks for reporting this, @meain . RecursionError: maximum recursion depth exceeded in __instancecheck__ confuses me. The other recursion bug was caused by trying to log a helpful message. This looks different.
I agree we could have a better error message. Checking for uniqueness and raising a specific error for duplicates would be much better.
If I have multiple columns with same names(usually after I trim it to just 8 chars), I get a
RecursionError: maximum recursion depth exceeded
when running the following code.We will get recursion error on
ds.rename
line, but even if we were to use something likeds.columns = [c[:8] for c in ds.colums]
we get a similar error inxport.v56.dump
line. The csv file that I am using is relatively simple.pip freeze
And here is the full logs.
The text was updated successfully, but these errors were encountered: