pandas_select.column.AllNominal

class AllNominal(*, strict=False)[source]

Select nominal columns.

Columns with the following dtypes are considered nominal: category, object, and string if pandas version >= 1.0.0.

See also

HasDtype, AllCat, AllStr

Examples

>>> df = pd.DataFrame({"a": [1, 2],
...                    "b": ["a", "b"],
...                    "c": ["a", "b"]})
>>> df = df.astype({"a": "int", "b": "object", "c": "category"})
>>> df
   a  b  c
0  1  a  a
1  2  b  b
>>> df[AllNominal()]
   b  c
0  a  a
1  b  b