-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
df.to_json segfaults with categorical column types #10778
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
Comments
If I convert using |
xref #10321 This has not been implemented. pull-requests are welcome. |
👍 |
My apologies if this is simply extra noise, but I think I came across the same issue in (maybe) a slightly different situation. Thought this might help to give more insight into this issue. With me this happens when trying to convert a DataFrame with binned data into JSON. The kernel reports back the following: Jan 30 18:18:04 debian kernel: [ 1632.371968] python[24794]: segfault at ffffffffffffffff ip 00007f58f570655d sp 00007ffe13a8c410 error 7 in multiarray.so[7f58f55bf000+1d9000] Version info:
Greatly simplified piece of code which reproduces the error:
Converting the "age_cat" column with |
Apologies for the noise, came across this issue two weeks ago when I was converting a json file to a pandas data frame using pd.DataFrame.from_records. I had a large json file that I pulled from multiple webpages into one file that I was trying to parse through and separate using a loop and the pandas function. One of the webpages did not load and it went into my larger file as an empty list-unbeknownst to me. That empty list when read into pandas caused the seg fault. Took me forever to figure that out and eventually adding a try and except to my code solved the issue. Not sure if this is the appropriate place to post this, but this was the first forum that came up when I googled "seg fault json pandas" and I wanted to put this out there incase someone in future ran into the problem I had and might be able to save some time. One the developer site though, just a recommendation, it might be nice if a try and except could be added to the "from records" function that would give an output when an empty list is encountered because that seg fault had me messing with my python framework thinking something was very wrong. |
This code from the Categorical tutorial:
Will segfault when
df.to_json
is called. Tested on:The text was updated successfully, but these errors were encountered: