def _hit_rate(df): df[\'hit\'] = 1 return df[\'ca\'].mean() a = pd.DataFrame({\'geo\':[\'AP\',\'AP\',\'AP\',\'SD\',\'SD\',\'SD\'],\'lower\':[1.2,1.2,1.2,1.3