-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
ENH: Include df.attrs
in to_json
output
#51012
Comments
I like this idea, though of course it will only work with objects that are serializable. How this will interact with json validators should be considered. As you say, |
Me too! Seems like a no-brainer. Being able to store metadata directly with a serialized dataframe will be a big deal imo! |
take |
Just to make sure that I understand what the enhancement request is, whenever a data frame is written to a .json file using And I know that we stated that |
Yes to both questions! 👍 |
xref discussion in #52166. |
Just to make sure, are we okay with implementing this under the assumption that the Referencing PR #53409 |
The exact status of I think we have decided to keep it but drop propagating |
Feature Type
Adding new functionality to pandas
Changing existing functionality in pandas
Removing existing functionality in pandas
Problem Description
Persist dataset metadata
Feature Description
df.attrs
is still experimental but would be great if it was written to JSON as metadata alongside the dataframe's content bydf.to_json
.Alternative Solutions
Slightly clunky: Writing metadata to new line in same JSON file as df exported to manually. This limits the read options (e.g. can no longer import the file in NodeJS since invalid JSON).
https://stackoverflow.com/a/33113390
Additional Context
No response
The text was updated successfully, but these errors were encountered: