Skip to content

Instantly share code, notes, and snippets.

@restrepo
Created March 23, 2020 22:57
Show Gist options
  • Save restrepo/639b99a1e7fa816b1a1fc3de0bb35a8e to your computer and use it in GitHub Desktop.
Save restrepo/639b99a1e7fa816b1a1fc3de0bb35a8e to your computer and use it in GitHub Desktop.
Datos oficiales COVID-19 Colombia de @MinSaludCol en https://infogram.com/covid-2019-ins-colombia-1hnq41zg9ord63z
import requests
import pandas as pd
r=requests.get('https://infogram.com/covid-2019-ins-colombia-1hnq41zg9ord63z')
head='"data":[[["ID de caso",'
tail=']]]'
js='{}{}{}'.format( head.split(':')[-1],
r.text.split(head)[-1].split(tail)[0],
tail
)
df=pd.read_json(js)
coco=pd.DataFrame([l for l in df[range(1,df.columns[-1]+1)].values[0]],columns=df[0][0] )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment