Skip to content

DOC: Improve documentation for mode parameter in to_csv() method #47058

Closed
@kevinxperese

Description

@kevinxperese

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/dev/reference/api/pandas.DataFrame.to_csv.html

Documentation problem

The description for the mode parameter is too sparse. Additional information on other acceptable values would be helpful, especially mode='a'.

Suggested fix for documentation

Proposed change:
mode : str, default 'w'
String character(s) to indicate the mode in which the file is opened for writing. Valid values include: 'w' for "write" access, 'w+' or 'r+' for read and write access, 'x' or 'x+' for exclusive creation access, and 'a' or 'a+' for append access. All strings have an implied 't' for text access; binary access is not permitted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsIO CSVread_csv, to_csvNeeds TriageIssue that has not been reviewed by a pandas team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions