-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
DEPR or DOCS: pd.value_counts() is public, but not documented. Deprecate or document? #47862
Comments
It appears in the user guide and v0.20 whatsnew https://pandas.pydata.org/pandas-docs/dev/user_guide/basics.html#value-counts-histogramming-mode But IMO +1 to deprecating this as redundant with the Series/DataFrame method which is way more publicized instead. |
looks like added in #1392, so been around since 0.8.0
from #46749 (comment)
Looking some more the accepted types are documented (in the docstring) incorrectly, as the code also explicitly handles EAs and the
For now, it was definitely intended to be public and is a long-standing feature (for passing to functions that accept a callable), so should really be documented. So to answer the question in the title, BUG or DOCS, then not a bug. So maybe best to rename issue and remove the BUG label. could maybe instead make this issue a discussion on deprecation or just label as a DOC issue. |
i thought we depreciated and removed this quite a while ago definitely should be depreciated if it still exists |
I didn't find any open issues about this on a quick search.
sure, but since I didn't find anything to reference, can you perhaps give a reason here. |
we don't expose any other functions like this at top level +1 to deprecate |
OK will milestone 1.5 since I will assume for now that we will deprecate this, and if we don't get any objections, we don't need to update the docs. Also for typing, can be removed from top-level api. any analogy with pandas.unique? Is this useful as a top-level function or do the same arguments apply? |
Same question about |
Do have to update the docs here that uses |
nice catch. my comment about not updating the docs was misleading. and need to be sure to remove the mention of the top-level function in the text (there and maybe elsewhere)
|
Might be good to discuss |
actually looking at this again. maybe we just deprecate and move to a new namespace e.g. |
value_counts we should definitely deprecate, unique/factorize at least have a use case for ndarrays that we don't allow in Series e.g. numpy string dtypes or dt64/td64 with unsupported resos (the latter currently cast to second but im yak-shaving a change for that) |
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
pd.value_counts()
works, but it does not appear in the documentation.Two possibilities:
pandas/doc/source/reference/general_functions.rst
Uncovered when cleaning up
pandas-stubs
: pandas-dev/pandas-stubs#170 (comment)Expected Behavior
Unclear!
Installed Versions
pandas 1.4.3 and associated docs
The text was updated successfully, but these errors were encountered: