Skip to content

Commit c471b84

Browse files
committed
fixed truediv issue in DataFrame with importing division from __future__
1 parent 2db763f commit c471b84

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

pandas/core/frame.py

+4
Original file line numberDiff line numberDiff line change
@@ -567,12 +567,16 @@ def __contains__(self, key):
567567
__sub__ = arith_method(operator.sub, '__sub__', default_axis=None)
568568
__mul__ = arith_method(operator.mul, '__mul__', default_axis=None)
569569
__div__ = arith_method(operator.div, '__div__', default_axis=None)
570+
__truediv__ = arith_method(operator.truediv, '__truediv__',
571+
default_axis=None)
570572
__pow__ = arith_method(operator.pow, '__pow__', default_axis=None)
571573

572574
__radd__ = arith_method(operator.add, '__radd__', default_axis=None)
573575
__rmul__ = arith_method(operator.mul, '__rmul__', default_axis=None)
574576
__rsub__ = arith_method(lambda x, y: y - x, '__rsub__', default_axis=None)
575577
__rdiv__ = arith_method(lambda x, y: y / x, '__rdiv__', default_axis=None)
578+
__rtruediv__ = arith_method(lambda x, y: y / x, '__rtruediv__',
579+
default_axis=None)
576580
__rpow__ = arith_method(lambda x, y: y ** x, '__rpow__', default_axis=None)
577581

578582
def __neg__(self):

pandas/core/series.py

+1
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ def copy(self):
351351
__sub__ = _seriesOpWrap('__sub__')
352352
__mul__ = _seriesOpWrap('__mul__')
353353
__div__ = _seriesOpWrap('__div__')
354+
__truediv__ = _seriesOpWrap('__truediv__')
354355
__pow__ = _seriesOpWrap('__pow__')
355356

356357
# Inplace operators

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
]
4848

4949
MAJOR = 0
50-
MINOR = 3
50+
MINOR = 4
5151
MICRO = 0
52-
ISRELEASED = True
52+
ISRELEASED = False
5353
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
5454

5555
FULLVERSION = VERSION

0 commit comments

Comments
 (0)