Skip to content

_check_for_bom at parsers.py remove all the fields behind BOM #31609

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
limitspro opened this issue Feb 3, 2020 · 1 comment
Closed

_check_for_bom at parsers.py remove all the fields behind BOM #31609

limitspro opened this issue Feb 3, 2020 · 1 comment
Labels
IO CSV read_csv, to_csv
Milestone

Comments

@limitspro
Copy link

Code Sample, a copy-pastable example if possible

import pandas as pd # version 0.23.0, the same as 1.0.0
df=pd.read_csv("1.csv",sep=r",") # 1.csv treat first row as header, which start with BOM due to some unknow reason.
print(df.columns)

Problem description

_check_for_bom will not just remove BOM, but also remove all the fields except for the first one.
due to code:

first_row = first_row[0] // line 2571 at parsers.py @0.23.0
first_row_bom = first_row[0] // line 2758 at parsers.py @latest code at github

Solution:
Change line 2775 at parsers.py @latest code at github to

return [first_row_bom[1:]]+first_row[1:]
@jreback
Copy link
Contributor

jreback commented Sep 19, 2020

closed by #36365

@jreback jreback added this to the 1.2 milestone Sep 19, 2020
@jreback jreback closed this as completed Sep 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO CSV read_csv, to_csv
Projects
None yet
Development

No branches or pull requests

3 participants