I currently got this dataframe: original dataframe However I would like to obtain a dataframe (not containing the 't') from this which looks like this (considering the index): The index we want for our original dataframe
This of course is done easily when using .groupby().agg(), but the thing is that I don't got a simple aggregation function such as 'max' or 'mean', that I would like to use. Hence my question is: 'Is it possible to group by a dataframe with a customized aggregation function and without using SQL? If so, please let me know!'
I would love to get some help!
Simplified code example explaining my question:
df_example =
C D E
A B
1 2 5 8 9
3 7 9 3
2 4 9 5 5
6 1 4 5
We would like to obtain:
df_example_groupedby_A_only_aggregating_with_custom_function =
Z_custom
A
1 33
2 34
The values in Z_custom are obtained by using the custom aggregation function which uses the values in columns [C,D,E] from df_example.