Skip to content

Conversation

@nickeubank
Copy link
Contributor

Closes #12558

@jreback jreback added Bug Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Mar 9, 2016
if normalize:
result = result / float(values.size)
if dropna:
result = result / float(values[notnull(values)].size)
Copy link
Contributor

Choose a reason for hiding this comment

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

Series(values).count()

@jreback jreback changed the title fixes 12558 - value_count(normalize=True, dropna=True) counting missing in denominator BUG: value_count(normalize=True, dropna=True) counting missing in denominator, #12558 Mar 9, 2016
@kawochen
Copy link
Contributor

kawochen commented Mar 9, 2016

#12566 fixes this too, will need to fix groupby. Lemme know if you wanna work on this and I'll close mine.

@nickeubank
Copy link
Contributor Author

@kawochen Oops! Sorry, did not mean to double up. If you have this covered I can close -- not sure what you mean about groupby.

@kawochen
Copy link
Contributor

groupby has a version of value_counts. I fixed it for numpy > 1.8 and have an idea for older versions. Lemme play around with it tonight (EST). If it doesn't work I'll close it and let you have fun :)

@nickeubank
Copy link
Contributor Author

@kawochen Sounds good! Just let me know.

@nickeubank nickeubank closed this Mar 14, 2016
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 Reshaping Concat, Merge/Join, Stack/Unstack, Explode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants