-
Notifications
You must be signed in to change notification settings - Fork 928
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
Add_suffix and add_prefix for DataFrames and Series #9846
Add_suffix and add_prefix for DataFrames and Series #9846
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.
As a general comment, I think it might be cleaner to move this up a level to IndexedFrame
. That way we can have a unified docstring as in pandas instead of one for series and one for dataframe.
@brandon-b-miller Thanks for the comment/reviews, I was following Let me know your thoughts, happy to discuss more on this. |
Co-authored-by: GALI PREM SAGAR <[email protected]> Co-authored-by: Charles Blackmon-Luca <[email protected]>
…/cudf into add_suffix_prefix
Apologies, I didn't notice that the series version of this appends prefixes/suffixes to the series index and the dataframe one appends to the column names. That makes it hard to make one implementation in Still, I think it might be worth creating |
@gpucibot merge |
This PR fixes #9590, by adding
add_suffix
andadd_prefix
forcudf.DataFrame
andcudf.Series
.To make things concise, we unify the docstrings of these methods in both
Series
andDataFrame
by defining them withinIndexedFrame
(with a unified docstring and raisingNotImplementedError
, asking the user to refer to the implementations inSeries
orDataFrame
)Its preferred to raise
NotImplementedError
so that if someone later creates another class by inheriting fromIndexedFrame
, it clarifies that they must reimplementadd_suffix
andadd_prefix