@@ -211,9 +211,7 @@ def group_column(column: List[str]) -> List[Any]:
211211 converted = [tonumbers (value ) for value in column ]
212212
213213 # Check if all non-NaN values are numeric
214- numeric_count = sum (
215- 1 for x in converted if isinstance (x , (int , float )) and not np .isnan (x )
216- )
214+ numeric_count = sum (1 for x in converted if isinstance (x , (int , float )) and not np .isnan (x ))
217215 nan_count = sum (1 for x in converted if isinstance (x , float ) and np .isnan (x ))
218216 total_numeric = numeric_count + nan_count
219217
@@ -417,9 +415,7 @@ def encode_enum_column(values: List[Any], compress: bool = True) -> Union[List,
417415 ]
418416 )
419417
420- return OrderedDict (
421- [("_EnumKey_" , list (enum_map .keys ())), ("_EnumValue_" , enum_value )]
422- )
418+ return OrderedDict ([("_EnumKey_" , list (enum_map .keys ())), ("_EnumValue_" , enum_value )])
423419
424420
425421def decode_enum_column (data : Dict ) -> List [Any ]:
@@ -474,9 +470,7 @@ def decode_enum_column(data: Dict) -> List[Any]:
474470 raise ValueError ("_EnumValue_ must contain _ArrayZipData_ or _ArrayData_" )
475471
476472 # Map indices back to values (indices are 1-based)
477- result = [
478- enum_keys [idx - 1 ] if 0 < idx <= len (enum_keys ) else None for idx in indices
479- ]
473+ result = [enum_keys [idx - 1 ] if 0 < idx <= len (enum_keys ) else None for idx in indices ]
480474
481475 return result
482476
@@ -530,9 +524,7 @@ def tsv2json(
530524 for col_name , col_values in data .items ():
531525 # Skip encoding for certain columns
532526 should_skip = col_name in skip_columns
533- if is_participants and any (
534- x in col_name .lower () for x in ["age" , "sex" , "gender" ]
535- ):
527+ if is_participants and any (x in col_name .lower () for x in ["age" , "sex" , "gender" ]):
536528 should_skip = True
537529
538530 if should_skip :
@@ -669,9 +661,7 @@ def save_csv_tsv_with_enum(
669661
670662 for col_name , col_values in data .items ():
671663 should_skip = col_name in skip_columns
672- if is_participants and any (
673- x in col_name .lower () for x in ["age" , "sex" , "gender" ]
674- ):
664+ if is_participants and any (x in col_name .lower () for x in ["age" , "sex" , "gender" ]):
675665 should_skip = True
676666
677667 if should_skip or not compress_enum :
0 commit comments