Пример #1
0
def computeSumforDiffBoro(df):
    '''
    For the last part of question 4 
    '''
    all_boros = df['BORO'].unique()
    for boro in all_boros:
        # get the data of the corresponding boro
        df_boro = df[df['BORO'] == boro]
        count = 0
        all_ids = df_boro['CAMIS'].unique()
        for id in all_ids:
            r = Restaurant(id)
            count = count + r.test_restaurant_grades(df_boro)
        
        text = boro + ': the total change in restaurant grades is ' + str(count)
        print text