You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment running the supply command converts spreadsheets in the form of dsv files to json files. The spreadsheet data becomes and array of object, one pre row with the object keys being the cells in first line of the spreadsheet.
Another common representation we might want is that of an object where each row is a value keyed by a given column name, (a dictionary in python terms)
eg
name,lat,lon
Los Angeles,34°03′N,118°15′W
New York City,40°42′46″N,74°00′21″W
Paris,48°51′24″N,2°21′03″E
could become
{
"Los Angeles":{
"name":"Los Angeles", "lat":"34°03′N", "lon":"118°15′W"
}
"New York City":{ }
"Paris":{ }
}
Something like lodash's keyBy function
I envisage this would be secondary process after the initial parsing so once you have your standard json representation that's then converted to a keyed json representation (the means to do so possibly encoded in the metadata file?)
The text was updated successfully, but these errors were encountered:
tomgp
changed the title
"key by": Process a sheet into a "dictionary" instead of an array of objects
"key by": Process a sheet into a keyed set of objects instead of straightforward array
Feb 12, 2021
At the moment running the
supply
command converts spreadsheets in the form of dsv files to json files. The spreadsheet data becomes and array of object, one pre row with the object keys being the cells in first line of the spreadsheet.Another common representation we might want is that of an object where each row is a value keyed by a given column name, (a dictionary in python terms)
eg
could become
Something like lodash's keyBy function
I envisage this would be secondary process after the initial parsing so once you have your standard json representation that's then converted to a keyed json representation (the means to do so possibly encoded in the metadata file?)
The text was updated successfully, but these errors were encountered: