I have an object in the form of:
{
"Dates": ["January", "January", "March", "March", "March", "November", "November"],
"Values": [45.6, 0.5, 59.3, 46.56, 2.21, 48.59, 5.5]
}
What I need is to aggregate the values in "Values" (average) by month
The object I am seeking:
{
"Dates":["January", "March", "November"],
"Values":[23.05, 36.02, 27]
}
I know there have been several posts about it here. But I am not sure how to apply it to an object with arrays. Would appreciate very much any ideas. Thanks