Dec-29-2018, 09:10 PM
Hi all
Hope someone can point me in the right direction here.
Im using api to call a website, where i get this response. (cleaned for a few things)
So below i got the data. I would like to make a table from that data. First just a simple table inside python, later on a table i can put in a browser. (using flask or others)
Task1:
But how do i do it?
Would like the headers listed in top: Date | Day | Week | Season .... | points | o:points etc.
Then the data from groups below that. 20110911| Sunday | 1 | 2011 .... | 30 | 13 etc.
20110918| Sunday | 2 | 2011 .... | 12 | 30 etc.
Task2:
Add a header so after the total header there is a another one called: SUM
And below that "column" i would like to make a calculation from the points and o:points columns. like below
Date | Day | Week | Season .... | points | o:points | SUM etc.
20110911| Sunday | 1 | 2011 .... | 30 | 13 | 43 etc.
20110918| Sunday | 2 | 2011 .... | 12 | 30 | 42 etc.
Its my first post in here, and im pretty new to these part of python, but hoping i have described it good enough.
Thanks in advance for all inputs.
/ Carsten
Hope someone can point me in the right direction here.
Im using api to call a website, where i get this response. (cleaned for a few things)
So below i got the data. I would like to make a table from that data. First just a simple table inside python, later on a table i can put in a browser. (using flask or others)
Task1:
But how do i do it?
Would like the headers listed in top: Date | Day | Week | Season .... | points | o:points etc.
Then the data from groups below that. 20110911| Sunday | 1 | 2011 .... | 30 | 13 etc.
20110918| Sunday | 2 | 2011 .... | 12 | 30 etc.
Task2:
Add a header so after the total header there is a another one called: SUM
And below that "column" i would like to make a calculation from the points and o:points columns. like below
Date | Day | Week | Season .... | points | o:points | SUM etc.
20110911| Sunday | 1 | 2011 .... | 30 | 13 | 43 etc.
20110918| Sunday | 2 | 2011 .... | 12 | 30 | 42 etc.
Its my first post in here, and im pretty new to these part of python, but hoping i have described it good enough.
Thanks in advance for all inputs.
/ Carsten
data = json.loads(temp) pprint(data)
{'groups': [{'columns': [[20110911, 20110918], ['Sunday', 'Sunday'], [1, 2], [2011, 2011], ['Bears', 'Bears'], ['Falcons', 'Saints'], ['home', 'away'], [30, 13], [12, 30], [2.0, 6.0], [40.5, 47.0]], 'sdql': 'team = Bears and season = 2011 and week < 3'}], 'headers': ['date', 'day', 'week', 'season', 'team', 'o:team', 'site', 'points', 'o:points', 'line', 'total']}