-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Implement Series.quantile #517
Conversation
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.
Only minor notes
@@ -1285,6 +1286,13 @@ def rename(self, index): | |||
return new_collection(expr.RenameSeries(self.expr, index)) | |||
raise NotImplementedError(f"passing index={type(index)} is not supported") | |||
|
|||
def quantile(self, q=0.5, method="default"): |
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.
Out of scope: this could get easily confused with the method
parameter of pandas.DataFrame.quantile
.
We should rename it both here and in dask/dask to dask_method
or something.
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.
Yep good point, but I’d rather do this not with all the other changes
Co-authored-by: crusaderky <[email protected]>
with pytest.raises(AssertionError): | ||
df.x.quantile(q=[]).compute() |
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 returns an empty series here. Doubt we care to diverge on such an edge case though.
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.
Yeah I thought this was kind of pointless, but I might put up a follow up anyway
We can't really test tdigest at the moment, it's not compatible with the newest NumPy and I don't want to create a new ci job for this.
Tested it locally and it works for now