Fixed IntegerArray division by 0 by TomAugspurger · Pull Request #30183 · pandas-dev/pandas (original) (raw)

As an aside, floor division by zero looks a little suspicious to me. I'm not 100% sure what the expected behavior for it should be, but off the top of my head I think your test case should return the same values? Certainly doesn't need to be part of this PR though.

In [7]: a // 0 Out[7]: [0, 0, 0, NaN] Length: 4, dtype: Int64

In [8]: a // -0 Out[8]: [0, 0, 0, NaN] Length: 4, dtype: Int64

In [9]: a // 0.0 Out[9]: array([nan, nan, nan, nan])

In [10]: a // -0.0 Out[10]: array([nan, nan, nan, nan])