@@ -187,23 +187,46 @@ Previous Behavior:
187187
188188.. code-block:: ipython
189189
190- index = pd.Index([-1, 0, 1])
191- index / 0
190+ In [6]: index = pd.Index([-1, 0, 1])
192191
193- index = pd.UInt64Index([0, 1])
194- index / np.array([0, 0], dtype=np.uint64)
192+ In [7]: index / 0
193+ Out[7]: Int64Index([0, 0, 0], dtype='int64')
194+
195+ In [8]: index = pd.UInt64Index([0, 1])
196+
197+ In [9]: index / np.array([0, 0], dtype=np.uint64)
198+ Out[9]: UInt64Index([0, 0], dtype='uint64')
199+
200+ In [10]: pd.RangeIndex(1, 5) / 0
201+ ---------------------------------------------------------------------------
202+ ZeroDivisionError Traceback (most recent call last)
203+ <ipython-input-10-4c5e91d516f3> in <module>()
204+ ----> 1 pd.RangeIndex(1, 5) / 0
205+
206+ /usr/local/lib/python2.7/site-packages/pandas/core/indexes/range.pyc in _evaluate_numeric_binop(self, other)
207+ 592 if step:
208+ 593 with np.errstate(all='ignore'):
209+ --> 594 rstep = step(self._step, other)
210+ 595
211+ 596 # we don't have a representable op
212+
213+ ZeroDivisionError: integer division or modulo by zero
195214
196215Current Behavior:
197216
198217.. ipython:: python
199218
200219 index = pd.Index([-1, 0, 1])
201220 index / 0
221+
222+ # The result of division by zero should not depend on whether the zero is int or float
202223 index / 0.0
203224
204225 index = pd.UInt64Index([0, 1])
205226 index / np.array([0, 0], dtype=np.uint64)
206227
228+ pd.RangeIndex(1, 5) / 0
229+
207230.. _whatsnew_0230.enhancements.other:
208231
209232Other Enhancements
0 commit comments