Module functions.metatables.group
Classes
class Group (name: str, kind: str, columns: list[str] = _Nothing.NOTHING, value_labels: dict[int, str] = _Nothing.NOTHING, measure: str = 'nominal', missing_values: list = _Nothing.NOTHING, label: str = '', lfm: str = 'yes', mean: str = '', filter_label: Optional[str] = '')-
Represents a group in a dataset with metadata information.
This class is designed to store various properties of a dataset group, such as name, kind, columns, value labels, etc.
Attributes
name:str- The name of the group.
kind:str- Kind of the group ('batch', 'multi').
columns:list[str]- List of column names associated with the group.
value_labels:dict[int, str]- Mapping of numerical values to their labels.
measure:str- Measurement type of the group ('string', 'nominal', 'scale', 'ordinal').
missing_values:list- List of missing values for the group.
label:str- Label for the group.
lfm:str- Response format for missing data ('yes', 'no').
mean:str- Indicates whether mean is applicable ('yes', 'no', '').
filter_label:str, optional- Label for filtering.
Example
group = Group( name='group_name', kind='batch', columns=['column_1', 'column_2'], value_labels={1: 'Label 1', 2: 'Label 2'}, measure='nominal', missing_values=[-99], label='Group Label', lfm='yes', mean='no', filter_label='Filter Label' )
Method generated by attrs for class Group.
Class variables
var columns : list[str]var filter_label : Optional[str]var kind : strvar label : strvar lfm : strvar mean : strvar measure : strvar missing_values : listvar name : strvar value_labels : dict[int, str]
class GroupDict (*args, **kwargs)-
A custom dictionary for storing Group objects with string keys.
This class is designed to be used within a MetaTable to store information about different groups in a dataset.
Attributes
Inherits from dict.
Methods
setitem(key, value): Overrides the setitem method to enforce that keys must be strings and values must be instances of the Group class.
Example
group_dict = GroupDict() group_dict['group_name'] = Group(…)
Ancestors
- builtins.dict