File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 55 Hashable ,
66 Iterable ,
77)
8+ import itertools
89from typing import TYPE_CHECKING
910
1011import numpy as np
@@ -184,7 +185,7 @@ def check_len(item, name: str) -> None:
184185 check_len (prefix_sep , "prefix_sep" )
185186
186187 if isinstance (prefix , str ):
187- prefix = [ prefix ] * len (data_to_encode .columns )
188+ prefix = itertools . repeat ( prefix , len (data_to_encode .columns ) )
188189 if isinstance (prefix , dict ):
189190 prefix = [prefix [col ] for col in data_to_encode .columns ]
190191
@@ -193,7 +194,7 @@ def check_len(item, name: str) -> None:
193194
194195 # validate separators
195196 if isinstance (prefix_sep , str ):
196- prefix_sep = [ prefix_sep ] * len (data_to_encode .columns )
197+ prefix_sep = itertools . repeat ( prefix_sep , len (data_to_encode .columns ) )
197198 elif isinstance (prefix_sep , dict ):
198199 prefix_sep = [prefix_sep [col ] for col in data_to_encode .columns ]
199200
You can’t perform that action at this time.
0 commit comments