Export 101 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 101 rows into a DataFrame called df
:
df = pandas.read_json( "https://covid-19.datasettes.com/covid.json?p0=San+Francisco&p1=California&sql=select%0D%0A++date%2C%0D%0A++county%2C%0D%0A++deaths%2C%0D%0A++lag(deaths%2C+1)+OVER+(%0D%0A++++ORDER+BY%0D%0A++++++date%0D%0A++)+as+deaths_previous_day%2C%0D%0A++deaths+-+lag(deaths%2C+1)+OVER+(%0D%0A++++ORDER+BY%0D%0A++++++date%0D%0A++)+as+new_deaths%0D%0Afrom%0D%0A++ny_times_us_counties%0D%0Awhere%0D%0A++%22county%22+%3D+%3Ap0%0D%0A++and+%22state%22+%3D+%3Ap1%0D%0Aorder+by%0D%0A++date+desc%0D%0Alimit%0D%0A++101&_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?p0=San+Francisco&p1=California&sql=select%0D%0A++date%2C%0D%0A++county%2C%0D%0A++deaths%2C%0D%0A++lag(deaths%2C+1)+OVER+(%0D%0A++++ORDER+BY%0D%0A++++++date%0D%0A++)+as+deaths_previous_day%2C%0D%0A++deaths+-+lag(deaths%2C+1)+OVER+(%0D%0A++++ORDER+BY%0D%0A++++++date%0D%0A++)+as+new_deaths%0D%0Afrom%0D%0A++ny_times_us_counties%0D%0Awhere%0D%0A++%22county%22+%3D+%3Ap0%0D%0A++and+%22state%22+%3D+%3Ap1%0D%0Aorder+by%0D%0A++date+desc%0D%0Alimit%0D%0A++101&_shape=array" )