I need to group data from my 2d array by one column and sum another column value in the respective groups.
In my data, commas are used as the decimal place character -- these are float values.
Input:
[
[18, '1,07'];
[ 8, '0,44'],
[ 8, '0,67'],
[18, '0,55'],
[18, '0,19'],
[ 8, '0,48'],
[18, '2,59'],
[ 8, '0,15'],
[18, '12,97'],
]
Desired result:
[
18 => '17,37',
8 => '1,74',
]