I would like to play around with MA tax data. I’ve managed to isolate the two values I would like in my array, and I’d appreciate some help bringing them together.
Essentially, I have one array for ‘year’ and another for ‘amount’:
I would like to bundle them together to make an array that conforms to this shape/structure (not sure the term) from Mike’s Line Chart notebook:
I guess the question is: How do I map together only two array ‘columns’ / ‘fields’ while renaming their key values according to this specific format?
data = Array(n) [
0: Object {
date: 2007 /// indicative of one data point
value: 193000
}
In the past, @radames reminded me of the pattern to map out specific array values, which I used to show the year
and amount variables
(above).
I have tried to join these in some funny ways. E.g. Here I try to map values together, but only manage to nest an array in another array:
data_redux = tax_average_single_family.map(({date, value}) => ({date: tax_average_single_family.map(v => v["Year"]), value: tax_average_single_family.map(v => v["Single Family Tax Bill*"]),}))
Here’s my working notebook with other strange attempts ;):
As @mootari pointed out one other time when I have faced a very similar problem, I have a lot to learn about data structuring and re-structuring [Apologies I am still on the basics!] I fear a large part of my problem is not being able to research using correct and concise terminology regarding the problem
Any help and guidance is appreciated!