-
Notifications
You must be signed in to change notification settings - Fork 915
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
Adding feature Truncate to DataFrame and Series #11435
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.
Hi @VamsiTallam95, thanks for the PR! I have some preliminary feedback. Please let me know if you have any questions and I look forward to iterating on this feature with you!
python/cudf/cudf/core/dataframe.py
Outdated
@@ -2886,6 +2886,112 @@ def axes(self): | |||
""" | |||
return [self._index, self._data.to_pandas_index()] | |||
|
|||
@_cudf_nvtx_annotate | |||
def truncate(self, before=None, after=None, axis=0, copy=True): |
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 method probably belongs in python/cudf/cudf/core/indexed_frame.py
if the implementation is identical for DataFrame
and Series
. Those methods will be inherited by both DataFrame
and 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.
I tried to move the code to indexed_frame.py and was not successful due to missing functionalities.
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.
What functionality was missing? Did it attempt to call functions that don't exist in Series
? If so, we may just need to move them up from DataFrame
.
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 is done now.
In addition to the great suggestions from @bdice , could we add |
Co-authored-by: Bradley Dice <[email protected]>
Co-authored-by: Bradley Dice <[email protected]>
Co-authored-by: Bradley Dice <[email protected]>
Co-authored-by: Bradley Dice <[email protected]>
Co-authored-by: Bradley Dice <[email protected]>
Co-authored-by: Bradley Dice <[email protected]>
Co-authored-by: Bradley Dice <[email protected]>
Codecov ReportBase: 87.47% // Head: 88.11% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## branch-22.12 #11435 +/- ##
================================================
+ Coverage 87.47% 88.11% +0.63%
================================================
Files 133 135 +2
Lines 21826 22021 +195
================================================
+ Hits 19093 19404 +311
+ Misses 2733 2617 -116
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
rerun tests |
1 similar comment
rerun tests |
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.
I see @vyasr re-requested my review but there are previous comments from my last review that are still open. @VamsiTallam95 Can you take a look at those comments and reply / address them, please?
@bdice apologies, it looked like @VamsiTallam95 was just waiting on reviews to continue. It looks like he is currently blocked, though? |
This PR has been labeled |
Can one of the admins verify this patch? Admins can comment |
ok to test Whoops I don't think I can do that, will request. |
ok to test |
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.
Final request/comment here: #11435 (comment)
Otherwise approved!
@gpucibot merge |
In #11435, the `truncate` API was added but I had a review comment(to add it docs) that I forgot to publish. This PR adds `truncate` to the docs page. Authors: - GALI PREM SAGAR (https://github.com/galipremsagar) Approvers: - Bradley Dice (https://github.com/bdice) URL: #12109
Description
This PR closes #9629 by adding truncate feature to DataFrame and Series. Truncates a DataFrame or Series before and after some index value. If the index being truncated contains only datetime values, before and after may be specified as strings instead of Timestamps.
Checklist