-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
Bug : Fixes #20911 #24467
Bug : Fixes #20911 #24467
Changes from 2 commits
9605547
3dabccf
cf86de4
0f5faf8
fd20ff8
2ddb60f
9ee4b89
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1964,6 +1964,13 @@ def test_clip_against_frame(self, axis): | |
tm.assert_frame_equal(clipped_df[lb_mask], lb[lb_mask]) | ||
tm.assert_frame_equal(clipped_df[ub_mask], ub[ub_mask]) | ||
tm.assert_frame_equal(clipped_df[mask], df[mask]) | ||
# GH 20911, clipping now preserves types | ||
df1 = DataFrame(np.random.randn(1000,4), columns=['A', 'B','C','D']) | ||
df2 = DataFrame(np.random.randn(1000,4), columns=['D', 'A','B','C']) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you have some lint errors. |
||
|
||
res1 = df1.clip(lower=0,upper=df2) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use result= and expected= There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will do pardon me for such a rookie mistake.... |
||
res2 = df1.clip(lower=0,upper=df2[df1.columns]) | ||
tm.assert_frame_equal(res1,res2) | ||
|
||
def test_clip_with_na_args(self, float_frame): | ||
"""Should process np.nan argument as None """ | ||
|
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.
make this a new test