@@ -35,6 +35,10 @@ def _arith_method(op, name):
35
35
'__sub__' : '__rsub__' ,
36
36
'__div__' : '__rdiv__' ,
37
37
'__mul__' : '__rmul__' ,
38
+ '__radd__' : '__add__' ,
39
+ '__rsub__' : '__sub__' ,
40
+ '__rdiv__' : '__div__' ,
41
+ '__rmul__' : '__mul__' ,
38
42
}
39
43
def wrapper (self , other ):
40
44
from pandas .core .frame import DataFrame
@@ -445,6 +449,14 @@ def copy(self):
445
449
__div__ = _arith_method (operator .div , '__div__' )
446
450
__truediv__ = _arith_method (operator .truediv , '__truediv__' )
447
451
__pow__ = _arith_method (operator .pow , '__pow__' )
452
+ __truediv__ = _arith_method (operator .truediv , '__truediv__' )
453
+
454
+ __radd__ = _arith_method (operator .add , '__add__' )
455
+ __rmul__ = _arith_method (operator .mul , '__mul__' )
456
+ __rsub__ = _arith_method (lambda x , y : y - x , '__sub__' )
457
+ __rdiv__ = _arith_method (lambda x , y : y / x , '__div__' )
458
+ __rtruediv__ = _arith_method (lambda x , y : y / x , '__truediv__' )
459
+ __rpow__ = _arith_method (lambda x , y : y ** x , '__pow__' )
448
460
449
461
# Inplace operators
450
462
__iadd__ = __add__
0 commit comments