Skip to content

BUG:Characters like '/' are being replaced by '_' when importing a CSV file into Python with pandas. #58257

@harishvspeaker

Description

@harishvspeaker

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd 
data =pd.reas_csv(r"csvfilepath.csv")

Issue Description

say i have a string row "he/him" when loaded into python it automatically gets converted into "he_him" and when the same data frame is saved back into a csv format "_" is retained

Expected Behavior

/...

Installed Versions

Replace this line with the output of pd.show_versions()

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIO CSVread_csv, to_csvNeeds InfoClarification about behavior needed to assess issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions