Skip to content

Commit 822b3f4

Browse files
consolidate conditionals
1 parent cd5c2ab commit 822b3f4

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

pandas/core/strings/accessor.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2487,13 +2487,7 @@ def get_dummies(
24872487
# we need to cast to Series of strings as only that has all
24882488
# methods available for making the dummies...
24892489
result, name = self._data.array._str_get_dummies(sep, dtype)
2490-
if is_extension_array_dtype(dtype):
2491-
return self._wrap_result(
2492-
DataFrame(result, columns=name, dtype=dtype),
2493-
name=name,
2494-
returns_string=False,
2495-
)
2496-
if isinstance(dtype, ArrowDtype):
2490+
if is_extension_array_dtype(dtype) or isinstance(dtype, ArrowDtype):
24972491
return self._wrap_result(
24982492
DataFrame(result, columns=name, dtype=dtype),
24992493
name=name,

0 commit comments

Comments
 (0)