Skip to content

Instantly share code, notes, and snippets.

@QuantumDamage
Created April 20, 2017 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save QuantumDamage/1e2611fd922c457245cb38fabb8c00db to your computer and use it in GitHub Desktop.
Save QuantumDamage/1e2611fd922c457245cb38fabb8c00db to your computer and use it in GitHub Desktop.
sensorId = 4727
r = requests.get('http://api.gios.gov.pl/pjp-api/rest/data/getData/' + str(sensorId))
concentration = json_normalize(r.json())
concentrationFrame = pd.DataFrame()
concentrationFrame["dates"] = [d[u'date'] for d in concentration["values"].values.item()]
concentrationFrame["values"] = [d[u'value'] for d in concentration["values"].values.item()]
concentrationFrame.set_index(["dates"], inplace=True)
concentrationFrame = concentrationFrame.iloc[::-1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment