Skip to content

Commit 682295f

Browse files
Add strict= to zip() in pandas/core/arrays/categorical.py
1 parent 9a11472 commit 682295f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/core/arrays/categorical.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3149,5 +3149,7 @@ def factorize_from_iterables(iterables) -> tuple[list[np.ndarray], list[Index]]:
31493149
# For consistency, it should return two empty lists.
31503150
return [], []
31513151

3152-
codes, categories = zip(*(factorize_from_iterable(it) for it in iterables))
3153-
return list(codes), list(categories)
3152+
codes, categories = zip(
3153+
*(factorize_from_iterable(it) for it in iterables), strict=True
3154+
)
3155+
return list(codes), list(categories)

0 commit comments

Comments
 (0)