Skip to content

DOC: na_values defaults for read_csv don't match STR_NA_VALUES correctly #55803

@johnmreynolds

Description

@johnmreynolds

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.read_csv.html

Documentation problem

In https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html the list of na_values is supposed to match the list in STR_NA_VALUES.

However, in d4889bc the change to double quotes broke the first one, which is now incorrectly displayed as " ", i.e. a single space, rather than the correct "".

Curiously, read_excel still shows the first value as ‘’, so it hasn't had the change to double quotes.

Suggested fix for documentation

I think this bug got introduced due to adding a space so the triple double-quote could correctly end the string.

One fix could be to change the line:

NaN: " """

to something like

NaN: """ + '"'

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