From 0277d9fca07a767cad2efa100c47e02cea06a1f0 Mon Sep 17 00:00:00 2001 From: Brock Mendel Date: Thu, 25 Jan 2018 10:21:56 -0800 Subject: [PATCH] add ipython output to whatsnew --- doc/source/whatsnew/v0.23.0.txt | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/doc/source/whatsnew/v0.23.0.txt b/doc/source/whatsnew/v0.23.0.txt index 2d305ab736d97..b0cbbe54d09ea 100644 --- a/doc/source/whatsnew/v0.23.0.txt +++ b/doc/source/whatsnew/v0.23.0.txt @@ -187,11 +187,30 @@ Previous Behavior: .. code-block:: ipython - index = pd.Index([-1, 0, 1]) - index / 0 + In [6]: index = pd.Index([-1, 0, 1]) - index = pd.UInt64Index([0, 1]) - index / np.array([0, 0], dtype=np.uint64) + In [7]: index / 0 + Out[7]: Int64Index([0, 0, 0], dtype='int64') + + In [8]: index = pd.UInt64Index([0, 1]) + + In [9]: index / np.array([0, 0], dtype=np.uint64) + Out[9]: UInt64Index([0, 0], dtype='uint64') + + In [10]: pd.RangeIndex(1, 5) / 0 + --------------------------------------------------------------------------- + ZeroDivisionError Traceback (most recent call last) + in () + ----> 1 pd.RangeIndex(1, 5) / 0 + + /usr/local/lib/python2.7/site-packages/pandas/core/indexes/range.pyc in _evaluate_numeric_binop(self, other) + 592 if step: + 593 with np.errstate(all='ignore'): + --> 594 rstep = step(self._step, other) + 595 + 596 # we don't have a representable op + + ZeroDivisionError: integer division or modulo by zero Current Behavior: @@ -199,11 +218,15 @@ Current Behavior: index = pd.Index([-1, 0, 1]) index / 0 + + # The result of division by zero should not depend on whether the zero is int or float index / 0.0 index = pd.UInt64Index([0, 1]) index / np.array([0, 0], dtype=np.uint64) + pd.RangeIndex(1, 5) / 0 + .. _whatsnew_0230.enhancements.other: Other Enhancements