Skip to content
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:Clip with a list-like threshold with a nan is broken (GH19992) #21921

Merged
merged 7 commits into from
Jul 18, 2018

Conversation

makbigc
Copy link
Contributor

@makbigc makbigc commented Jul 15, 2018

@codecov
Copy link

codecov bot commented Jul 15, 2018

Codecov Report

Merging #21921 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #21921   +/-   ##
=======================================
  Coverage   91.96%   91.96%           
=======================================
  Files         166      166           
  Lines       50329    50329           
=======================================
  Hits        46287    46287           
  Misses       4042     4042
Flag Coverage Δ
#multiple 90.36% <100%> (ø) ⬆️
#single 42.23% <0%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/generic.py 96.45% <100%> (-0.01%) ⬇️
pandas/core/indexes/period.py 93.2% <0%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1ce2473...0ef2e4d. Read the comment docs.

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small comments. lgtm otherwise. ping on green.

@@ -440,6 +440,7 @@ Missing

- Bug in :func:`DataFrame.fillna` where a ``ValueError`` would raise when one column contained a ``datetime64[ns, tz]`` dtype (:issue:`15522`)
- Bug in :func:`Series.hasnans` that could be incorrectly cached and return incorrect answers if null elements are introduced after an initial call (:issue:`19700`)
- Bug in :func:`Series.clip` and `DataFrame.clip` cannot accept list-like threshold containing nan (:issue:`19992`)
Copy link
Contributor

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)

tm.assert_frame_equal(self.frame.clip(upper=np.nan, lower=np.nan),
self.frame)

# GH #19992
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you comment under the commit number what this is testing

use

result = 
expected = 
tm.assert_frame_equal(....)

do the tests in order for axis=0, axis=0, IOW so you don't have the df1, df2 variables

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amended. Your format is better. Thanks.

@jreback
Copy link
Contributor

jreback commented Jul 16, 2018

does this also close #19976 ?

@jreback jreback added Bug Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate labels Jul 16, 2018
@jreback jreback added this to the 0.23.4 milestone Jul 17, 2018
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this close #19976, pls move to 0.23.4 whatnew

@@ -440,6 +440,7 @@ Missing

- Bug in :func:`DataFrame.fillna` where a ``ValueError`` would raise when one column contained a ``datetime64[ns, tz]`` dtype (:issue:`15522`)
- Bug in :func:`Series.hasnans` that could be incorrectly cached and return incorrect answers if null elements are introduced after an initial call (:issue:`19700`)
- Bug in :func:`Series.clip` and :func:`DataFrame.clip` cannot accept list-like threshold containing ``NaN`` (:issue:`19992`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go ahead and move to 0.23.4

@jreback jreback merged commit 3cb64bd into pandas-dev:master Jul 18, 2018
@jreback
Copy link
Contributor

jreback commented Jul 18, 2018

thanks @makbigc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants