-
Notifications
You must be signed in to change notification settings - Fork 171
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
[DEPR] Deprecate functions #1212
Conversation
🚀 Deployed on https://deploy-preview-1212--pyjanitor.netlify.app |
Codecov Report
@@ Coverage Diff @@
## dev #1212 +/- ##
==========================================
+ Coverage 97.67% 97.69% +0.02%
==========================================
Files 78 78
Lines 3693 3730 +37
==========================================
+ Hits 3607 3644 +37
Misses 86 86 |
…evs/pyjanitor into samukweku/deprecate
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.
Wow, extensive work, @samukweku! Thank you for handling the deprecations!
janitor/functions/fill.py
Outdated
from multipledispatch import dispatch | ||
|
||
|
||
message = "This function will be deprecated in a 1.x release. " | ||
message += "Kindly use `pd.DataFrame.assign` " | ||
message += "or `jn.transform_column` instead." |
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.
Hmmm, in trying to write an example for how to write fill_direction
using df.assign
or df.transform_column
, I wasn't able to easily replicate the functionality that you had here. Are we sure we want to deprecate fill_direction
?
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.
fill_direction
can be replicated with assign
:
In [175]: >>> df = pd.DataFrame(
...: {
...: 'col1': [1, 2, 3, 4],
...: 'col2': [None, 5, 6, 7],
...: 'col3': [8, 9, 10, None],
...: 'col4': [None, None, 11, None],
...: 'col5': [None, 12, 13, None]
...: }
...: )
...: df
Out[175]:
col1 col2 col3 col4 col5
0 1 NaN 8.0 NaN NaN
1 2 5.0 9.0 NaN 12.0
2 3 6.0 10.0 11.0 13.0
3 4 7.0 NaN NaN NaN
In [176]: df.assign(
col2 = df.col2.bfill(),
col3 = df.col3.ffill(),
col4 = df.col4.ffill().bfill(),
col5 = df.col5.bfill().ffill())
Out[176]:
col1 col2 col3 col4 col5
0 1 5.0 8.0 11.0 12.0
1 2 5.0 9.0 11.0 12.0
2 3 6.0 10.0 11.0 13.0
3 4 7.0 10.0 11.0 13.0
Okie dokes, this PR has been open long enough. Let's merge, @samukweku? |
@ericmjl yes pls |
Please describe the changes proposed in the pull request:
Add deprecation warnings for :
process_text
,rename_column
,rename_columns
,filter_on
,remove_columns
,fill_direction
add_column
add_columns
toset
find_replace
join_apply
change_type
fill_empty
groupby_agg
This PR is related to #1045 .
Please tag maintainers to review.