I’m downloading a CSV from Google Insights, and I need to parse out certain information and use that data to populate a heat map.
Google doesn’t have an open API for Insights, so you can only download the CSV then parse it out.
There’s a lot of data that gets downloaded, but the data I need starts around row 61 and goes on for about 40 rows and the data looks like this:
...
... above data
....
Top subregions for test
Subregion test
New York 100
Ohio 79
Kentucky 72
Maine 66
New Jersey 64
District of Columbia 58
Pennsylvania 58
Delaware 58
Maryland 57
Massachusetts 52
I’m able to load the CSV – I’m just not sure how to parse out that particular data properly. I looped through the CSV until finding the “subregion” text – but after that I’m not sure how to then pul out the state and count into a dictionary of some kind.
Any help would be greatly appreciated.
Thanks!
1 Answer