face2face.statistics.null_modell.mapping_function¶
-
face2face.statistics.null_modell.
mapping_function
(Data, label='type')¶ Creates a mapping
Creates a mapping dictionary to create the attribute mixing matrix dynamic, independent of the amount of attributes.
- Parameters
Data (Data) – Data Object that contains Tij- and Metadata for a data set.
label (str) – A string that tells the function which attribute should be mapped.
- Returns
mapping – A dictionary that contains the dimensions of the given attribute.
- Return type
dict
Examples
Based on the amount of attribute values the used attribute has, you have to create a mapping for the null model functions.
>>> mapping = mapping_function(test_df, label="Age") >>> print(mapping) {0: 0, 1: 1, 2: 2}
>>> mapping = mapping_function(test_df, label="Sex") >>> print(mapping) {0: 0, 1: 1}