databricks/koalas

Cannot binary operations Index by Series.

Closed this issue · 1 comments

In pandas.

>>> pd.Index([1, 2, 3]) + pd.Series([10, 20, 30])
0    11
1    22
2    33
dtype: int64

>>> pd.Index([1, 2, 3]) - pd.Series([10, 20, 30])
0    -9
1   -18
2   -27
dtype: int64

>>> pd.Index([1, 2, 3]) / pd.Series([10, 20, 30])
0    0.1
1    0.1
2    0.1
dtype: float64

>>> pd.Index([1, 2, 3]) * pd.Series([10, 20, 30])
0    10
1    40
2    90
dtype: int64

whereas Koalas.

>>> ks.Index([1, 2, 3]) + ks.Series([10, 20, 30])
Traceback (most recent call last):
...
TypeError: object of type 'NoneType' has no len()

>>> ks.Index([1, 2, 3]) - ks.Series([10, 20, 30])
Traceback (most recent call last):
...
TypeError: object of type 'NoneType' has no len()

>>> ks.Index([1, 2, 3]) / ks.Series([10, 20, 30])
Traceback (most recent call last):
...
TypeError: object of type 'NoneType' has no len()

>>> ks.Index([1, 2, 3]) * ks.Series([10, 20, 30])
Traceback (most recent call last):
...
TypeError: object of type 'NoneType' has no len()

Good catch! I submitted a PR #2046.