Skip to content

BUG: pd.read_excel error when a cell contains string "INF" #33853

Closed
@josephernest

Description

@josephernest

Here is how to reproduce the bug: run this script:

import pandas as pd
pd.read_excel('test.xlsx')
# idem with pd.read_excel('test.xlsx', engine='openpyxl')
# so it's not specific to xlrd or openpyxl

with this test.xlsx file:

a b
12 1
14 1
15 1
16 INF

Error:

OverflowError: cannot convert float infinity to integer

Why does this happen / why is there a integer conversion? No automatic integer parsing has been asked.


PS: Congrats for this great project!

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