File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -427,7 +427,7 @@ def strip_single_quotes(input_string):
427
427
categorical_columns = [
428
428
name
429
429
for name , dtype in frame .dtypes .items ()
430
- if pd . api . types . is_categorical_dtype (dtype )
430
+ if isinstance (dtype , pd . CategoricalDtype )
431
431
]
432
432
for col in categorical_columns :
433
433
frame [col ] = frame [col ].cat .rename_categories (strip_single_quotes )
@@ -442,7 +442,7 @@ def strip_single_quotes(input_string):
442
442
categories = {
443
443
name : dtype .categories .tolist ()
444
444
for name , dtype in frame .dtypes .items ()
445
- if pd . api . types . is_categorical_dtype (dtype )
445
+ if isinstance (dtype , pd . CategoricalDtype )
446
446
}
447
447
return X , y , None , categories
448
448
Original file line number Diff line number Diff line change @@ -376,7 +376,7 @@ def convert_numerical_and_categorical_dtypes(series):
376
376
pandas_series = frame_pandas [series .name ]
377
377
if pd .api .types .is_numeric_dtype (pandas_series ):
378
378
return series .astype (pandas_series .dtype )
379
- elif pd . api . types . is_categorical_dtype (pandas_series ):
379
+ elif isinstance (pandas_series . dtype , pd . CategoricalDtype ):
380
380
# Compare categorical features by converting categorical liac uses
381
381
# strings to denote the categories, we rename the categories to make
382
382
# them comparable to the pandas parser. Fixing this behavior in
You can’t perform that action at this time.
0 commit comments