Skip to content

DOC: read_csv: date_format #59557

Closed
@igurin-invn

Description

@igurin-invn

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

Documentation problem

When using read_csv, I came across a UserWarning: Could not infer format.... I tried to resolve it by providing a date_format, but the warning wouldn't go away. Then I realized that my problem was that I was providing specifically the date format but not the time format.

The documentation for this parameter is confusing. It starts with what appear to be two alternate and contradictory definitions of the parameter:

  • "Format to use for parsing dates when used in conjunction with parse_dates."
  • "The strftime to parse time, e.g. "%d/%m/%Y"."

Suggested fix for documentation

Say something like this:

"Format to use for parsing dates and/or times. Used in conjunction with parse_dates. See strftime documentation for more information on choices..."

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