-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Calculate normalized freqs in value_counts correctly when bins is not None #26923
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #26923 +/- ##
=========================================
Coverage ? 91.86%
=========================================
Files ? 180
Lines ? 50745
Branches ? 0
=========================================
Hits ? 46619
Misses ? 4126
Partials ? 0
Continue to review full report at Codecov.
|
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 a whatsnew note, reshape section of bug fixes
pandas/tests/test_algos.py
Outdated
@pytest.mark.parametrize('dropna, vals, index', [ | ||
(False, [0.6, 0.2, 0.2], [np.nan, 2.0, 1.0]), | ||
(True, [0.5, 0.5], [2.0, 1.0])]) | ||
def test_value_counts_normalized(self, dropna, vals, index): | ||
# GH12558 | ||
s = Series([1, 2, np.nan, np.nan, np.nan]) | ||
dtypes = (np.float64, np.object, 'M8[ns]') |
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 pull the dtypes into another level of parameterization
@krsnik93 can you merge master & add a whatsnew note (bug fix in reshaping is ok). ping on green. |
I have a failing test in pandas/pandas/core/groupby/generic.py Lines 1261 to 1275 in c275dbf
For some reason, it takes by-group counts of unbinned data (either NaN values or outside of bin breaks) and resets those counts to 0 (last line). I do not understand why is this done, but the whole method is kind hard to read and I am not able to make the required changes. |
cc @jschendel if you have time to take a look at #26923 (comment). |
@krsnik93 can you merge master and fix up merge conflicts? |
Closing as this looks stale, but @krsnik93 please ping if you'd like to continue and can open back up |
git diff upstream/master -u -- "*.py" | flake8 --diff