facet_subsets¶
-
glue.core.util.
facet_subsets
(data_collection, cid, lo=None, hi=None, steps=5, prefix='', log=False)[source]¶ Create a series of subsets that partition the values of a particular attribute into several bins
This creates steps new subet groups, adds them to the data collection, and returns the list of newly created subset groups.
Parameters: - data (
ComponentID
) – DataCollection object to use - cid – ComponentID to facet on
- lo (float) – The lower bound for the faceting. Defaults to minimum value in data
- hi (float) – The upper bound for the faceting. Defaults to maximum value in data
- steps (int) – The number of subsets to create. Defaults to 5
- prefix (str) – If present, the new subset labels will begin with prefix
- log (bool) – If True, space divisions logarithmically. Default=False
Returns: List of
SubsetGroup
instances added to dataExample:
facet_subset(data, data.id['mass'], lo=0, hi=10, steps=2)
creates 2 new subsets. The first represents the constraint 0 <= mass < 5. The second represents 5 <= mass < 10:
facet_subset(data, data.id['mass'], lo=10, hi=0, steps=2)
Creates 2 new subsets. The first represents the constraint 10 >= x > 5 The second represents 5 >= mass > 0:
facet_subset(data, data.id['mass'], lo=0, hi=10, steps=2, prefix='m')
Labels the subsets
m_1
andm_2
- data (