CategorySubsetState#

class glue.core.subset.CategorySubsetState(att, categories)[source]#

Bases: SubsetState

A subset defined by the set of categorical values that are equal to a set of categories.

Parameters:
attComponentID

The categorical data attribute used for the subset.

categoriesiterable

The categories that the attribute should be equal to. These should be given as the integer codes, not the categorical labels.

Attributes Summary

att

The categorical data attribute used for the subset.

attributes

The attributes that the subset state depends on.

categories

The categories that the attribute should be equal to.

Methods Summary

copy()

Return a copy of the subset state.

to_mask(data[, view])

Compute the mask for this subset state.

Attributes Documentation

att[source]#

The categorical data attribute used for the subset.

attributes[source]#
categories[source]#

The categories that the attribute should be equal to. These should be given as the integer codes, not the categorical labels.

Methods Documentation

copy()[source]#

Return a copy of the subset state.

to_mask(data, view=None)[source]#

Compute the mask for this subset state.

Parameters:
dataData

The dataset to compute the mask for.

view

Any object that returns a valid view for a Numpy array.