Skip to content

ENH: Include df.attrs in to_json output #51012

Open
@janosh

Description

@janosh

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 by df.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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions