示例#1
0
        weak = ex2_weak.index
    # excellent = exellentPractice[w]
    # weak = weakPractice[w]

    excellentLine = []
    weakLine = []
    mixedLine = []

    excellentLine_not_cleaned = []
    weakLine_not_cleaned = []
    mixedLine_not_cleaned = []
    noOfCommunities = []
    upper = 0.70
    lower = 0.30
    for i in range(0, len(graph_all_weeks[w].graph._node) - 1):
        a1 = graphLearning.identifyCommunitiesType(communityListWeeks[w][i],
                                                   excellent, weak)
        excellentLine.append(len(a1.loc[a1['excellentRate'] >= upper]))
        weakLine.append(len(a1.loc[a1['excellentRate'] < lower]))
        mixedLine.append(
            len(a1.loc[(a1['excellentRate'] < upper)
                       & (a1['excellentRate'] >= lower)]))

        a2 = graphLearning.identifyCommunitiesType(
            communityListWeeks_not_cleaned[w][i], excellent, weak)
        excellentLine_not_cleaned.append(
            len(a2.loc[a2['excellentRate'] >= upper]))
        weakLine_not_cleaned.append(len(a2.loc[a2['excellentRate'] < lower]))
        mixedLine_not_cleaned.append(
            len(a2.loc[(a2['excellentRate'] < upper)
                       & (a2['excellentRate'] >= lower)]))
示例#2
0
     weak = ex2_weak.index        
 # excellent = exellentPractice[w]
 # weak = weakPractice[w]
 
 excellentLine = []
 weakLine = []
 mixedLine = []
 
 excellentLine_not_cleaned = []
 weakLine_not_cleaned = []
 mixedLine_not_cleaned = []
 noOfCommunities = []
 upper = 0.70
 lower = 0.30
 for i in range(0,len(graph_all_weeks[w].graph._node)-1):
     a1 = graphLearning.identifyCommunitiesType(communityListWeeks[w][i], excellent, weak)
     excellentLine.append(len(a1.loc[a1['excellentRate'] >= upper]))
     weakLine.append(len(a1.loc[a1['excellentRate'] < lower]))
     mixedLine.append(len(a1.loc[(a1['excellentRate'] <upper) & (a1['excellentRate'] >= lower)]))
     
     a2 = graphLearning.identifyCommunitiesType(communityListWeeks_not_cleaned[w][i], excellent, weak)
     excellentLine_not_cleaned.append(len(a2.loc[a2['excellentRate'] >= upper]))
     weakLine_not_cleaned.append(len(a2.loc[a2['excellentRate'] < lower]))
     mixedLine_not_cleaned.append(len(a2.loc[(a2['excellentRate'] < upper) & (a2['excellentRate'] >= lower)]))
     
     noOfCommunities.append(i+2)
 
 ax = fig.add_subplot(3,4,w+1)
 graph.append(ax)
 graph[countGraph].set_xlabel('Number of communities', fontsize = 15)
 graph[countGraph].set_ylabel('Number of the communities in each group', fontsize = 15)