def is_categorical(obj):
 try:
  float(obj.iloc[0])
  return False
 except:
  return True
 if is_sequence_of_strings(obj):
  return True
 if is_sequence_of_booleans(obj):
  return True
 return False

def is_categorical ( obj ) : try : float ( obj . iloc [ 0 ] ) return False except : return True if is_sequence_of_strings ( obj ) : return True if is_sequence_of_booleans ( obj ) : return True return False
return true if *obj* is array-like and has categorical values categorical values include: - strings - booleans .