-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG:Clip with a list-like threshold with a nan is broken (GH19992) #21921
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
Changes from 1 commit
287a400
c5dfbfc
5c9f634
4eea624
2f50555
ff434ac
0ef2e4d
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 |
---|---|---|
|
@@ -2237,13 +2237,20 @@ def test_clip_with_na_args(self): | |
"""Should process np.nan argument as None """ | ||
# GH # 17276 | ||
tm.assert_frame_equal(self.frame.clip(np.nan), self.frame) | ||
tm.assert_frame_equal(self.frame.clip(upper=[1, 2, np.nan]), | ||
self.frame) | ||
tm.assert_frame_equal(self.frame.clip(lower=[1, np.nan, 3]), | ||
self.frame) | ||
tm.assert_frame_equal(self.frame.clip(upper=np.nan, lower=np.nan), | ||
self.frame) | ||
|
||
# GH #19992 | ||
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. can you comment under the commit number what this is testing use
do the tests in order for axis=0, axis=0, IOW so you don't have the df1, df2 variables 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. Amended. Your format is better. Thanks. |
||
df = DataFrame({'col_0': [1, 2, 3], 'col_1': [4, 5, 6], | ||
'col_2': [7, 8, 9]}) | ||
df1 = DataFrame({'col_0': [4, 5, np.nan], 'col_1': [4, 5, np.nan], | ||
'col_2': [7, 8, np.nan]}) | ||
df2 = DataFrame({'col_0': [4, 4, 4], 'col_1': [5, 5, 6], | ||
'col_2': [np.nan, np.nan, np.nan]}) | ||
|
||
tm.assert_frame_equal(df.clip(lower=[4, 5, np.nan], axis=0), df1) | ||
tm.assert_frame_equal(df.clip(lower=[4, 5, np.nan], axis=1), df2) | ||
|
||
# Matrix-like | ||
def test_dot(self): | ||
a = DataFrame(np.random.randn(3, 4), index=['a', 'b', 'c'], | ||
|
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.
can you add the ref for DataFrame, use double back-ticks on
NaN
(and sp)