-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Adjust tests in array folder for new string option #56188
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 10 commits
b05e31a
f570a4f
d5708c1
0c6bf14
8efb8f2
9f0e0ad
2604336
86ac45a
0b5fb67
11ca55a
c53c2b5
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 |
---|---|---|
|
@@ -871,6 +871,8 @@ def value_counts_internal( | |
Series, | ||
) | ||
|
||
input_dtype = None if not isinstance(values, Series) else values.dtype | ||
|
||
index_name = getattr(values, "name", None) | ||
name = "proportion" if normalize else "count" | ||
|
||
|
@@ -929,10 +931,13 @@ def value_counts_internal( | |
|
||
# For backwards compatibility, we let Index do its normal type | ||
# inference, _except_ for if if infers from object to bool. | ||
idx = Index(keys) | ||
idx = Index(keys, dtype=input_dtype if input_dtype != "float16" else None) | ||
if idx.dtype == bool and keys.dtype == object: | ||
idx = idx.astype(object) | ||
elif idx.dtype != keys.dtype: | ||
elif ( | ||
idx.dtype != keys.dtype # noqa: PLR1714 # # pylint: disable=R1714 | ||
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. Just confirming this change isn't related to your referenced, closed PR right? 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. No this is fine, this is the infer_string inference, which will still happen |
||
and idx.dtype != "string[pyarrow_numpy]" | ||
): | ||
warnings.warn( | ||
# GH#56161 | ||
"The behavior of value_counts with object-dtype is deprecated. " | ||
|
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.
Should these changes not be here after your comments in #56187?
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.
oh very good point, forgot the revert. thx. does