-
Notifications
You must be signed in to change notification settings - Fork 366
Implement Series.between #997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Softagram Impact Report for pull/997 (head commit: 6b6f73c)⭐ Change Overview
📄 Full report
Impact Report explained. Give feedback on this report to [email protected] |
Codecov Report
@@ Coverage Diff @@
## master #997 +/- ##
==========================================
+ Coverage 94.84% 94.84% +<.01%
==========================================
Files 34 34
Lines 6516 6524 +8
==========================================
+ Hits 6180 6188 +8
Misses 336 336
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, LGTM.
left : scalar or list-like | ||
Left boundary. | ||
right : scalar or list-like | ||
Right boundary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test if we can support list-like?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, pandas only support scalar
value? https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.between.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pandas supports list-like.
pandas-dev/pandas#28435
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool!
Then shall we add tests for them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
>>> a = ks.Series([1, 2, 3])
>>> b = ks.Series([4, 5, 6])
>>> a > b
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/harutaka/Desktop/projects/koalas/databricks/koalas/base.py", line 66, in wrapper
return align_diff_series(apply_func, self, *args, how="full")
File "/Users/harutaka/Desktop/projects/koalas/databricks/koalas/utils.py", line 255, in align_diff_series
combined = combine_frames(this_series.to_frame(), *cols, how=how)
File "/Users/harutaka/Desktop/projects/koalas/databricks/koalas/utils.py", line 116, in combine_frames
raise ValueError("Cannot combine column argument because "
ValueError: Cannot combine column argument because it comes from a different dataframe
I got this error when I tried to compare two different series.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works.
>>> df = ks.DataFrame({
'a': [1, 2, 3],
'b': [4, 5, 6],
'c': [7, 8, 9]
})
>>> df.a < df.b
0 True
1 True
2 True
Name: a, dtype: bool
>>> df.b < df.c
0 True
1 True
2 True
Name: b, dtype: bool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For different dataframe, you can add the tests under test_ops_on_diff_frames.py
. compute.ops_on_diff_frames
option allows operations on different DataFrames.
Let me just merge - it looks pretty straightforward. |
@HyukjinKwon Thanks. I'll create a PR to add tests. |
Add `Series.between` to the doc in #997.
Implement Series.between