Skip to content

DOC: to_json for stream object #61280

Closed
Closed
@loicdiridollou

Description

@loicdiridollou

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_json.html

Documentation problem

Currently the docs for to_jsonmethod only mentions about file-like object, yet we can pass buffer which are more like stream object. This was raised on the stubs repo (pandas-dev/pandas-stubs#1179).
Should the docs reflect the ability of not just file-like but also stream-like? It seems to be supported at run time for sure.

Thanks!

Suggested fix for documentation

Add mention of stream-like object for the path_or_buf argument.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Closing CandidateMay be closeable, needs more eyeballsDocsIO JSONread_json, to_json, json_normalize

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions