I'm struggling trying to convert this array:
arr = [
{:type=>"Type One",
:data=>[
{'Wed, 01 Apr 2020'=>11.0},
{'Fri, 01 May 2020'=>0.0},
{'Mon, 01 Jun 2020'=>1081.5},
{'Wed, 01 Jul 2020'=>0.0}
]
},
{:type=>"Type Two",
:data=>[
{'Wed, 01 Apr 2020'=>19.55},
{'Fri, 01 May 2020'=>0.0},
{'Mon, 01 Jun 2020'=>68.56},
{'Wed, 01 Jul 2020'=>200.0}
]
}
]
to this array:
[{:type=>"Type One",
:data=>{'Wed, 01 Apr 2020'=>11.0, 'Fri, 01 May 2020'=>0.0,
'Mon, 01 Jun 2020'=>1081.5, 'Wed, 01 Jul 2020'=>0.0}},
{:type=>"Type Two",
:data=>{'Wed, 01 Apr 2020'=>19.55, 'Fri, 01 May 2020'=>0.0,
'Mon, 01 Jun 2020'=>68.56, 'Wed, 01 Jul 2020'=>200.0}}]
As you see, I wish to convert the value of :data in each hash in arr from an array of single-key hashes to a single hash.