Skip to content

Commit 534bc33

Browse files
committed
add some typing
1 parent 8fd4b72 commit 534bc33

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pandas/core/arrays/categorical.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from functools import partial
33
import operator
44
from shutil import get_terminal_size
5-
from typing import TYPE_CHECKING, Dict, Hashable, List, Optional, Type, Union, cast
5+
from typing import TYPE_CHECKING, Any, Dict, Hashable, List, Optional, Type, Union, cast
66
from warnings import warn
77

88
import numpy as np
@@ -455,12 +455,13 @@ def from_dummies(
455455
if len(to_drop):
456456
dummies = dummies.drop(columns=to_drop)
457457

458+
cats: List[Any]
458459
if prefix is None:
459-
cats = dummies.columns
460+
cats = list(dummies.columns)
460461
else:
461462
pref = prefix + (prefix_sep or "")
462463
cats = []
463-
to_keep = []
464+
to_keep: List[str] = []
464465
for c in dummies.columns:
465466
if isinstance(c, str) and c.startswith(pref):
466467
to_keep.append(c)

0 commit comments

Comments
 (0)