Skip to content

Thousands separator for to_csv #30045

@ghisvail

Description

@ghisvail

Pandas exposes a thousands optional parameter to read_csv used to specify a custom thousands separator, so that 1,000 or 1_000 can be successfully parsed to a numeral in the resulting DataFrame.

Unfortunately, Pandas is missing the very same parameter for to_csv, so that a DataFrame containing 1000 ends up serialized to csv as 1,000 or 1_000.

I understand the general issue of custom float formatting in Pandas remains open (see #4668) and may not even find a solution. However, this particular use case sounds a bit more accessible, since it has been done successfully for read_csv.

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