I have a dataframe that loads a CSV. The csv is like this:
PROFIT STRING
16 A_B_C_D
3 A_D_C
-4 A_D_C
20 A_X_C
10 A_F_S
PROFIT is a float, string is a list of characters. The underscore "_" seperates them, so that A_B_C_D would be A,B,C and D individually.
I'm trying to see the profit distribution by character.
eg:
A: Total profit = 16+3-4+20+10 = 45
Mean = xxx
Median = yyy
B:
Total profit = 16+3 = 19
Mean = zzzz etc...
Can this be done using pandas, and if so how?