BPt.Dataset.drop_cols_by_unique_val#

Dataset.drop_cols_by_unique_val(scope='all', threshold=1, dropna=True, inplace=False)[source]#

This method will drop any columns with less than or equal to the number of unique values. This is a coarse filtering method for removing uninformative variables which may have been loaded or included with a dataset.

Parameters
scopeScope

A BPt style Scope used to select a subset of column(s) in which to apply the current function to. See Scope for more information on how this can be applied.

default = 'all'
thresholdint, optional

The threshold in which a column should be dropped if it has less than or equal to this number of unique values.

For example, the default value of 1, will only drop column with only 1 unique value.

default = 1
dropnabool, optional

This parameter controls if NaN values are ignored when determining how many unique values there are, when set to True, and if set to False will count NaN as a unique value.

default = True
inplacebool, optional

If True, perform the current function inplace and return None.

default = False