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):
427427 categorical_columns = [
428428 name
429429 for name , dtype in frame .dtypes .items ()
430- if pd . api . types . is_categorical_dtype (dtype )
430+ if isinstance (dtype , pd . CategoricalDtype )
431431 ]
432432 for col in categorical_columns :
433433 frame [col ] = frame [col ].cat .rename_categories (strip_single_quotes )
@@ -442,7 +442,7 @@ def strip_single_quotes(input_string):
442442 categories = {
443443 name : dtype .categories .tolist ()
444444 for name , dtype in frame .dtypes .items ()
445- if pd . api . types . is_categorical_dtype (dtype )
445+ if isinstance (dtype , pd . CategoricalDtype )
446446 }
447447 return X , y , None , categories
448448
Original file line number Diff line number Diff line change @@ -376,7 +376,7 @@ def convert_numerical_and_categorical_dtypes(series):
376376 pandas_series = frame_pandas [series .name ]
377377 if pd .api .types .is_numeric_dtype (pandas_series ):
378378 return series .astype (pandas_series .dtype )
379- elif pd . api . types . is_categorical_dtype (pandas_series ):
379+ elif isinstance (pandas_series . dtype , pd . CategoricalDtype ):
380380 # Compare categorical features by converting categorical liac uses
381381 # strings to denote the categories, we rename the categories to make
382382 # them comparable to the pandas parser. Fixing this behavior in
You can’t perform that action at this time.
0 commit comments