shapelets.DataSet.drop_columns#

DataSet.drop_columns(cols: Optional[Union[str, int, List[Union[int, str]]]] = None, pattern: Optional[str] = None, full_match: bool = True, flags: RegexFlag = RegexFlag.IGNORECASE) DataSet#

Drops columns in a DataSet

Parameters:
cols: string, int or a list of string and/or ints

Selects either single or multiple columns to be drop from the current dataset. If the selection is a number, it drops the column by its index.

pattern: string or regular expression

Drops all columns matching a regular expression

full_match: boolean, defaults to True

When pattern is given, this flag indicates if re.fullmatch should be used to determine if a column is to be dropped; otherwise, the method re.match will be used.

flags: re.RegexFlag, defaults to IGNORECASE

Flags to be used when compiling the pattern.

Returns:
DataSet

A new DataSet instance.

Examples

>>> df = session.load_test_data()
>>> df