We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e88c392 commit 5f8477fCopy full SHA for 5f8477f
pandas/core/dtypes/cast.py
@@ -278,7 +278,7 @@ def maybe_cast_result(
278
if is_extension_array_dtype(dtype) and dtype.kind != "M":
279
# The result may be of any type, cast back to original
280
# type if it's compatible.
281
- if len(result) and isinstance(result[0], dtype.type):
+ if len(result):
282
cls = dtype.construct_array_type()
283
result = maybe_cast_to_extension_array(cls, result, dtype=dtype)
284
0 commit comments