I couldnt find a thread, that fitted my question... In case this is not true, please don't hesitate to post the link to the thread.

I have the following dataframe, which I have to analyze. This is the head of it:

```

                     EMBieding  AeolisBieding  ...  Diff_EM  Diff_Aeolis
StartTime                                      ...                      
2019-09-01 00:00:00    3058.24         3494.0  ... -3126.24      -3562.0
2019-09-01 01:00:00    2906.01         3480.0  ... -2974.01      -3548.0
2019-09-01 02:00:00    2836.22         3470.0  ... -2903.22      -3537.0
2019-09-01 03:00:00    2805.66         3448.0  ... -2848.66      -3491.0
2019-09-01 04:00:00    2541.54         3413.0  ... -2606.54      -3478.0

```

Next to overall error measures, I also want to find out the error per hour. 
This means, the hours from 0 - 23 have to be aggregated.
Using the following code, it is easy to find the mean:

```
data= importdata('871687110001543570.csv')
data_perhour = data.groupby(data.index.hour).mean()
data_perhour.drop
print(data_perhour)

```

I can easily find the mean for each column. 

```
             EMBieding  AeolisBieding  ...     Diff_EM  Diff_Aeolis
StartTime                              ...                         
0          1175.862033    1279.577236  ... -253.707561  -357.422764
1          1153.947724    1264.723577  ... -309.435528  -420.211382
2          1146.239016    1259.459016  ... -336.763607  -449.983607
3          1133.350976    1251.268293  ... -390.928211  -508.845528
4          1127.061789    1251.300813  ... -405.411382  -529.650407

```

The error measures I use are NBIAS, NMAE and NRMSE. I calculate this with the following

```
# statistic calculates the different errormeasurements: NBIAS,NMAE,NRMSE. Input arguments are: data; this is the output from the
# importdata function. parksize; which is just the installed power of the respective farm, for normalization. filename
# is needed to produce a unique new filename.
def statistic(data,park_size,filename):
    def NBIAS(Diff_forecaster,park_size):
        return data[Diff_forecaster].mean()/park_size

    def NMAE(Bied_forecaster,park_size):
        return mean_absolute_error(data['Production'], data[Bied_forecaster]) /park_size

    def NRMSE(Bied_forecaster,park_size):
        return (sqrt(mean_squared_error(data['Production'], data[Bied_forecaster])) /np.square(park_size))

# Calculate the overall errormeasure and save it directly in a external .csv
    ErrorMeasure = {'EM':[NBIAS('Diff_EM',park_size),NMAE('EMBieding',park_size),NRMSE('EMBieding',park_size)],
                    'Aeolis':[NBIAS('Diff_Aeolis',park_size),NMAE('Bied',park_size ),NRMSE('Bied',park_size)]}
    df_ErrorMeasure = pd.DataFrame(ErrorMeasure,index=['NBIAS','NMAE','NRMSE'])
    df_ErrorMeasure.to_csv('errormeasure'+filename)

    data_perhour=data.groupby(data.index.hour).apply(NBIAS('EMBieding',park_size))

    print(data_perhour)

```

The last two lines are a attempt to get the NBIAS for each hour. However, I get this error: 

```
TypeError: 'numpy.float64' object is not callable

```

How can I get the error measures for each hour? This means, can I use a own function (like`.NBIAS`) to replace the `.mean` after `data.groupby(data.index.hour)`.

Anyone suggestions?`