Resolve flexible column selectors into a concrete list of column names.
Parameters
Name
Type
Description
Default
data
DataFrame or GroupBy
Data source used to validate column existence.
required
selectors
various
- str: treated as a literal column name. - Sequence[str]: a collection of literal column names. - re.Pattern: matches columns via pattern.search. - Callable: receives the column Index and must return an iterable of column names. - None: permitted when allow_none is True (default), yielding [].
required
allow_none
bool
Allow None selectors without raising an error. Defaults to True.
True
require_match
bool
Raise ValueError when a selector does not match any columns. Defaults to True.
True
unique
bool
Return deduplicated column names while preserving order. Defaults to True.
True
Returns
Name
Type
Description
list[str]
Ordered list of columns satisfying the selector(s).