Selectors

Select sets of columns by name, type, or other properties

cols

cols(self, *columns)

Select columns by name.

Parameters

Name Type Description Default
columns str Names of the columns to select. ()

contains

contains(self, pattern)

Select all columns whose names contain a specific string.

Parameters

Name Type Description Default
pattern str The string to search for in column names. required

endswith

endswith(self, suffix)

Select all columns whose names end with a specific string.

Parameters

Name Type Description Default
suffix str The column name suffix to match. required

startswith

startswith(self, prefix)

Select all columns whose names start with a specific string.

Parameters

Name Type Description Default
prefix str The column name prefix to match. required

matches

matches(self, pattern)

Select all columns whose names match a specific regex.

Parameters

Name Type Description Default
pattern str The pattern to search for in column names. required

numeric

numeric()

Select all numeric columns

nominal

nominal()

Select all nominal (string or categorical) columns

categorical

categorical()

Select all categorical columns.

string

string()

Select all string columns

integer

integer()

Select all integral columns

floating

floating()

Select all floating columns

temporal

temporal()

Select all temporal columns

date

date()

Select all date columns

time

time()

Select all time columns

timestamp

timestamp()

Select all timestamp columns

has_type

has_type(self, dtype)

Select all columns matching a specified dtype.

Parameters

Name Type Description Default
dtype dt.DataType | str | type[dt.DataType] The dtype to match. May be a dtype instance, string, or dtype class. required

where

where(self, predicate)

Select all columns matching a specific predicate function.

Parameters

Name Type Description Default
predicate Callable[[ir.Column], bool] A predicate function from Column to bool. Only columns where predicate returns True will be selected. required

everything

everything()

Select all columns

selector

selector(obj)

Convert obj to a Selector

Back to top