object#
- skrub.selectors.object()[source]#
Select columns whose dtype is
object(pandas) orpl.Object(polars).See also
Notes
Before pandas 3.0, columns containing only strings have the
objectdtype and are selected. From pandas 3.0 onwards they have thestringdtype and are not. Usestring()for selecting strings.Examples
>>> from skrub import selectors as s >>> import pandas as pd >>> df = pd.DataFrame( ... dict( ... mixed=pd.Series(['A', 10]), ... numeric=pd.Series([1, 2]), ... string=pd.Series(['A', 'B']).convert_dtypes(), ... ) ... ) >>> df.dtypes mixed object numeric int64 string ... dtype: object
>>> s.select(df, s.object()) mixed 0 A 1 10