face2face.statistics.average_degree.group_list_degree¶
-
face2face.statistics.average_degree.
group_list_degree
(df)¶ Creates lists of the degrees
Creating a list of degrees for every attribute value of every group
- Parameters
df (Data) – Contains a dataframe with the tij-data from the data set
- Returns
attr_degree_list – Contains lists for all attributes and all occurring degrees for the different attribute values.
- Return type
list
Examples
This functions return a list of lists which contains a list for every attribute value. In this list you have the attribute as a string, the attribute value and a list with all degrees for this attribute value.
>>> attr_list = ["ID", "Age", "Sex"] >>> test_df = Data(path_tij="face2face/data/Test/tij_test.dat", separator_tij=" ", >>> path_meta="face2face/data/Test/meta_test.dat", separator_meta=" ", >>> meta_attr_list=attr_list) >>> attr_degree_list = group_list_degree(test_df) [['Age', 1.0, [1, 2, 2]], ['Age', 0.0, [3, 2]], ['Age', 2.0, [2, 2, 2]], ['Sex', 'F', [1, 2, 2, 2, 2]], ['Sex', 'M', [2, 2, 2]]]
See also
face2face.avg_degree_attr()
,face2face.global_avg_var_std()