def limits(x):
    if (pd.api.types.is_integer_dtype(x.dtype) or pd.api.types.is_float_dtype(x.dtype)):
        return pd.Series([x.min(), x.max()])
    else:
        return pd.Series([set(x), set(x)])
def limits(x):
    if (pd.api.types.is_integer_dtype(x.dtype) or pd.api.types.is_float_dtype(x.dtype)):
        return pd.Series([x.min(), x.max()])
    else:
        return pd.Series([set(x), set(x)])