Export 50 rows to a notebook
You can export this data to a Jupyter or Observable notebook by copying and pasting the following:
Jupyter
Make sure you have Pandas. Import it in a cell like this:
import pandasIf this shows an error you can run
%pip install pandas
in a notebook cell to install it.
Now paste the following into a cell to load the 50 rows into a DataFrame called df
:
df = pandas.read_json( "https://covid-19.datasettes.com/covid.json?sql=with+italy+as+(%0D%0A++select%0D%0A++++rowid%2C%0D%0A++++day%2C%0D%0A++++country_or_region%2C%0D%0A++++province_or_state%2C%0D%0A++++admin2%2C%0D%0A++++fips%2C%0D%0A++++confirmed%2C%0D%0A++++deaths%2C%0D%0A++++recovered%2C%0D%0A++++active%2C%0D%0A++++latitude%2C%0D%0A++++longitude%2C%0D%0A++++last_update%2C%0D%0A++++combined_key%0D%0A++from%0D%0A++++johns_hopkins_csse_daily_reports%0D%0A++where%0D%0A++++%22country_or_region%22+%3D+%3Ap0%0D%0A++order+by%0D%0A++++confirmed+desc%0D%0A)%0D%0Aselect%0D%0A++day%2C%0D%0A++confirmed+-+lag(confirmed%2C+1)+OVER+(%0D%0A++++ORDER+BY%0D%0A++++++day%0D%0A++)+as+new_cases%0D%0Afrom%0D%0A++italy%0D%0Aorder+by+day+desc+limit+50&p0=Italy&_shape=array" )
Run df
in a new cell to see the table.
Observable
Import the data into a variable called rows
like this:
rows = d3.json( "https://covid-19.datasettes.com/covid.json?sql=with+italy+as+(%0D%0A++select%0D%0A++++rowid%2C%0D%0A++++day%2C%0D%0A++++country_or_region%2C%0D%0A++++province_or_state%2C%0D%0A++++admin2%2C%0D%0A++++fips%2C%0D%0A++++confirmed%2C%0D%0A++++deaths%2C%0D%0A++++recovered%2C%0D%0A++++active%2C%0D%0A++++latitude%2C%0D%0A++++longitude%2C%0D%0A++++last_update%2C%0D%0A++++combined_key%0D%0A++from%0D%0A++++johns_hopkins_csse_daily_reports%0D%0A++where%0D%0A++++%22country_or_region%22+%3D+%3Ap0%0D%0A++order+by%0D%0A++++confirmed+desc%0D%0A)%0D%0Aselect%0D%0A++day%2C%0D%0A++confirmed+-+lag(confirmed%2C+1)+OVER+(%0D%0A++++ORDER+BY%0D%0A++++++day%0D%0A++)+as+new_cases%0D%0Afrom%0D%0A++italy%0D%0Aorder+by+day+desc+limit+50&p0=Italy&_shape=array" )