Skip to content

BUG/API: floordiv by zero in Int64Dtype #61715

Closed
@jbrockmendel

Description

@jbrockmendel

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

ser = pd.Series([0, 1])
ser2 = ser.astype("Int64")

>>> ser // 0
0    NaN
1    inf
dtype: float64

>>> ser2 // 0
0    0
1    0
dtype: Int64

# with int64[pyarrow] this just raises pyarrow.lib.ArrowInvalid: divide by zero

Issue Description

We patch the results of floordiv in dispatch_fill_zeros, but don't do this for the masked dtypes, and the pyarrow one raises.

Expected Behavior

Ideally these would be consistent across backends.

Installed Versions

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

Metadata

Metadata

Assignees

Labels

BugNeeds TriageIssue that has not been reviewed by a pandas team member

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions