Some arithmetic operators for IndexOpsMixin don't work with magic method.
See original GitHub issueAssuming that we have Series like the below.
>>> pser = pd.Series([1, 2, 3])
>>> kser = ks.from_pandas(pser)
and there is an issue for some cases with arithmetic ops like the below.
- rfloordiv
>>> pser.__rfloordiv__(pser) # it's okay for pandas
0 1
1 1
2 1
Name: 0, dtype: int64
>>> kser.__rfloordiv__(kser) # but doesn't work for koalas
Traceback (most recent call last):
...
TypeError: Column is not iterable
- rsub
>>> pser.__rsub__(pser)
0 0
1 0
2 0
Name: 0, dtype: int64
>>> kser.__rsub__(kser)
Traceback (most recent call last):
...
TypeError: Column is not iterable
I think there are more cases have same issue.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
A Guide to Python's Magic Methods « rafekettler.com
A guide to all the Magic Methods in Python. ... Introduction; Construction and Initialization; Making Operators Work on Custom Classes. Comparison magic ...
Read more >Magic or Dunder Methods in Python - TutorialsTeacher
Magic methods are most frequently used to define overloaded behaviours of predefined operators in Python. For instance, arithmetic operators by default operate ...
Read more >python: reverse the elements of magic methods that affect ...
Everything works fine but i'm having problems with making the object interact with mathematical operators. This is how you can reproduce the ...
Read more >Magic Methods - Cambridge Spark
Arithmetic operators. Just like with comparison methods, python allows you to overload arithmetic operators as well. Here we will take a look at...
Read more >Where are operators mapped to magic methods in Python?
Magic methods are not intended to be invoked directly by you, ... For example, arithmetic operators, by default, operate on numeric operands ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yes right. i just found them very coincidently, and also think it’s not so have high priority to solve for now.
It might be better to fix anyway but I was wondering if it causes a real issue because these dunder methods are not supposed to called directly.