code: def get_card_split(df, cols, n=11):
      """
      Splits categorical columns into 2 lists based on cardinality (i.e # of unique values)
      Parameters
      ----------
      df : Pandas DataFrame
          DataFrame from which the cardinality of the columns is calculated.
      cols : list-like
          Categorical columns to list
      n : int, optional (default=11)
          The value of 'n' will be used to split columns.
      Returns
      -------
      card_low : list-like
          Columns with cardinality < n
      card_high : list-like
          Columns with cardinality >= n
      """
      cond = df[cols].nunique() > n
      card_high = cols[cond]
      card_low = cols[~cond]
      return card_low, card_high
  
imports: import numpy
  import pandas
  from tqdm import tqdm
  import datetime
  import time
  from sklearn.pipeline import Pipeline
  from sklearn.impute import SimpleImputer, MissingIndicator
  from sklearn.preprocessing import StandardScaler, OneHotEncoder, OrdinalEncoder
  from sklearn.compose import ColumnTransformer
  from sklearn.utils import all_estimators
  from sklearn.base import RegressorMixin
  from sklearn.base import ClassifierMixin
  from sklearn.metrics import accuracy_score, balanced_accuracy_score, roc_auc_score, f1_score, r2_score, mean_squared_error
  import warnings
  import xgboost
  import lightgbm
label_desc: Use image node_id 1 for calling a global function with example usage: get_card_split(df, cols, n) and returns: card_low,  card_high