From cd569295ea474b07497aaa98f7c27e3fecd12d3a Mon Sep 17 00:00:00 2001 From: Jixun Sun <160219251+AnonToky@users.noreply.github.com> Date: Tue, 11 Nov 2025 13:13:37 +0800 Subject: [PATCH 1/4] Fix zip function call to include strict parameter --- pandas/core/reshape/encoding.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/reshape/encoding.py b/pandas/core/reshape/encoding.py index 24efa34870545..c719f15c0b0ca 100644 --- a/pandas/core/reshape/encoding.py +++ b/pandas/core/reshape/encoding.py @@ -538,7 +538,7 @@ def from_dummies( raise ValueError(len_msg) elif isinstance(default_category, Hashable): default_category = dict( - zip(variables_slice, [default_category] * len(variables_slice)) + zip(variables_slice, [default_category] * len(variables_slice), strict=True) ) else: raise TypeError( From bc08bff12cfb2c4c1e4139d8d8c429925293281e Mon Sep 17 00:00:00 2001 From: Jixun Sun <160219251+AnonToky@users.noreply.github.com> Date: Tue, 11 Nov 2025 13:23:53 +0800 Subject: [PATCH 2/4] handled the too-long modified --- pandas/core/reshape/encoding.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/core/reshape/encoding.py b/pandas/core/reshape/encoding.py index c719f15c0b0ca..1c414d0b6d2a0 100644 --- a/pandas/core/reshape/encoding.py +++ b/pandas/core/reshape/encoding.py @@ -538,7 +538,8 @@ def from_dummies( raise ValueError(len_msg) elif isinstance(default_category, Hashable): default_category = dict( - zip(variables_slice, [default_category] * len(variables_slice), strict=True) + zip(variables_slice, + [default_category] * len(variables_slice), strict=True) ) else: raise TypeError( From 74a09aedc740653a6178f2079471ae9d1f1aa3ee Mon Sep 17 00:00:00 2001 From: Jixun Sun <160219251+AnonToky@users.noreply.github.com> Date: Tue, 11 Nov 2025 13:35:42 +0800 Subject: [PATCH 3/4] edited --- pandas/core/reshape/encoding.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/reshape/encoding.py b/pandas/core/reshape/encoding.py index 1c414d0b6d2a0..b45660abda314 100644 --- a/pandas/core/reshape/encoding.py +++ b/pandas/core/reshape/encoding.py @@ -538,8 +538,8 @@ def from_dummies( raise ValueError(len_msg) elif isinstance(default_category, Hashable): default_category = dict( - zip(variables_slice, - [default_category] * len(variables_slice), strict=True) + zip(variables_slice, [default_category] * len(variables_slice), + strict=True) ) else: raise TypeError( From 2200f710430482a07ad74c914d77c58c346fc844 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 11 Nov 2025 08:52:59 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pandas/core/reshape/encoding.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pandas/core/reshape/encoding.py b/pandas/core/reshape/encoding.py index b45660abda314..35fed5a24fb30 100644 --- a/pandas/core/reshape/encoding.py +++ b/pandas/core/reshape/encoding.py @@ -538,8 +538,11 @@ def from_dummies( raise ValueError(len_msg) elif isinstance(default_category, Hashable): default_category = dict( - zip(variables_slice, [default_category] * len(variables_slice), - strict=True) + zip( + variables_slice, + [default_category] * len(variables_slice), + strict=True, + ) ) else: raise TypeError(