Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions pandas/core/dtypes/cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ def convert_dtypes(
elif (
infer_objects
and input_array.dtype == object
and (isinstance(inferred_dtype, str) and inferred_dtype == "integer")
and inferred_dtype == "integer"
):
inferred_dtype = target_int_dtype

Expand All @@ -1086,17 +1086,14 @@ def convert_dtypes(
elif (
infer_objects
and input_array.dtype == object
and (
isinstance(inferred_dtype, str)
and inferred_dtype == "mixed-integer-float"
)
and inferred_dtype == "mixed-integer-float"
):
inferred_dtype = pandas_dtype_func("Float64")

if convert_boolean:
if input_array.dtype.kind == "b":
inferred_dtype = pandas_dtype_func("boolean")
elif isinstance(inferred_dtype, str) and inferred_dtype == "boolean":
elif inferred_dtype == "boolean":
inferred_dtype = pandas_dtype_func("boolean")

if isinstance(inferred_dtype, str):
Expand Down
Loading