Skip to content
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

Line breaks not consistent #57

Open
subsurfaceiodev opened this issue Mar 15, 2024 · 2 comments
Open

Line breaks not consistent #57

subsurfaceiodev opened this issue Mar 15, 2024 · 2 comments

Comments

@subsurfaceiodev
Copy link

Hi! We've noticed that calamine handles line breaks different than all other engines when reading excel files via pandas, running the following code:

data.xlsx

import pandas as pd

df = pd.read_excel('data.xlsx')
print(df)

df_calamine = pd.read_excel('data.xlsx', engine='calamine')
print(df_calamine)

we get:

print(df):
header1 header2 header\nwith break
0 1 4 7
1 2 5 8
2 3 6 9

print(df_calamine):
header1 header2 header\r\nwith break
0 1 4 7
1 2 5 8
2 3 6 9

As you can see, calamine is representing line breaks as r\n\ while other engines consider usual \n break.

@dimastbk
Copy link
Owner

It's bug (?) in upstream.

@NathanDWalsh
Copy link

Hi, I have observed this issue in an inconsistent way. In my case the line breaks are not in the headers but in the table cells.

When I run tests directly with pytest, line breaks are imported as the expected \n. However when I run tests with tox on the same Windows machine (validating the requirements/dependencies are consistent), I get line breaks coming in as \r\n.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants