-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPR: DataFrame.get_dtype_counts #27145
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 all commits
2fe603d
735a2fd
8473885
faeb972
95a7075
eb5213c
06af7fc
879485b
0c82f16
525fe51
592659f
0df4dd9
eba5396
eeba8a4
4419114
4ce1194
cb6c8bd
b3b839a
abe310c
aa172d6
6cb5d13
ca70a46
86c0a08
523ab60
852bd64
e700c63
475e361
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 |
---|---|---|
|
@@ -5263,6 +5263,10 @@ def get_dtype_counts(self): | |
""" | ||
Return counts of unique dtypes in this object. | ||
|
||
.. deprecated:: 0.25.0 | ||
|
||
Use `.dtypes.value_counts()` instead. | ||
|
||
Returns | ||
------- | ||
dtype : Series | ||
|
@@ -5288,6 +5292,10 @@ def get_dtype_counts(self): | |
object 1 | ||
dtype: int64 | ||
""" | ||
warnings.warn("`get_dtype_counts` has been deprecated and will be " | ||
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 update the docstring and add deprecated 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 we recommend 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. Yeah unfortunately that solution does not work for 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. sure, just need something as a replacement (may also want to add in the doc-string itself) |
||
"removed in a future version. For DataFrames use " | ||
"`.dtypes.value_counts()", FutureWarning, | ||
stacklevel=2) | ||
from pandas import Series | ||
return Series(self._data.get_dtype_counts()) | ||
|
||
|
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.
this one?
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.
I think this is okay. It's internal usage and slightly more performant I would think than
dtype.value_counts()
(left as a dictionary as opposed to constructing the Series)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 remove get_dtype_counts() from blocks its unecessary as well
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.
Looks to be needed to get the dtypes later on for
info
?