I am trying to sum the numeric values of one column depending on the value of another column. For example: whenever in the first column there is a Glovoapp I would like to sum its corresponding numeric values (of another column) together.
Table example:
| Initiator | Price |
|---|---|
| Glovoapp | 566 |
| XXXXX | 545 |
| Glovoapp | 899 |
| XXXXX | 200 |
montant_init = new_data.loc[new_data['Initiateur'] == 'Glovoapp', 'Price'].sum()
output: 0 (none)
expected output (example): 1465