Export 165 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 165 rows into a DataFrame called df
:
df = pandas.read_json( "https://covid-19.datasettes.com/covid.json?sql=with+filtered+as+(%0D%0A++select+rowid%2C+date%2C+county%2C+state%2C+fips%2C+cases%2C+deaths%0D%0A++from+ny_times_us_counties+where+state+%3D+'Kentucky'%0D%0A)%2C%0D%0Arows+as+(%0D%0A++select+null+as+facet%2C+null+as+favet_name%2C+null+as+facet_value%2C%0D%0A++rowid%2C+date%2C+county%2C+state%2C+fips%2C+cases%2C+deaths%0D%0A++from+filtered+order+by+date+desc+limit+101%0D%0A)%2C%0D%0Acount+as+(%0D%0A++select+'COUNT'+as+facet%2C+null+as+facet_name%2C+count(*)+as+facet_value%2C%0D%0A++null%2C+null%2C+null%2C+null%2C+null%2C+null%2C+null%0D%0A++from+filtered%0D%0A)%2C%0D%0Afacet_state+as+(%0D%0A++select+'state'+as+facet%2C+state+as+facet_name%2C+count(*)+as+facet_value%2C%0D%0A++null%2C+null%2C+null%2C+null%2C+null%2C+null%2C+null%0D%0A++from+filtered+group+by+facet_name+order+by+facet_value+desc+limit+31%0D%0A)%2C%0D%0Afacet_county+as+(%0D%0A++select+'county'+as+facet%2C+county+as+facet_name%2C+count(*)+as+facet_value%2C%0D%0A++null%2C+null%2C+null%2C+null%2C+null%2C+null%2C+null%0D%0A++from+filtered+group+by+facet_name+order+by+facet_value+desc+limit+31%0D%0A)%2C%0D%0Afacet_fips+as+(%0D%0A++select+'fips'+as+facet%2C+fips+as+facet_name%2C+count(*)+as+facet_value%2C%0D%0A++null%2C+null%2C+null%2C+null%2C+null%2C+null%2C+null%0D%0A++from+filtered+group+by+facet_name+order+by+facet_value+desc+limit+31%0D%0A)%0D%0Aselect+*+from+rows%0D%0Aunion+all%0D%0Aselect+*+from+count%0D%0Aunion+all%0D%0Aselect+*+from+facet_state%0D%0Aunion+all%0D%0Aselect+*+from+facet_county%0D%0Aunion+all%0D%0Aselect+*+from+facet_fips&_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+filtered+as+(%0D%0A++select+rowid%2C+date%2C+county%2C+state%2C+fips%2C+cases%2C+deaths%0D%0A++from+ny_times_us_counties+where+state+%3D+'Kentucky'%0D%0A)%2C%0D%0Arows+as+(%0D%0A++select+null+as+facet%2C+null+as+favet_name%2C+null+as+facet_value%2C%0D%0A++rowid%2C+date%2C+county%2C+state%2C+fips%2C+cases%2C+deaths%0D%0A++from+filtered+order+by+date+desc+limit+101%0D%0A)%2C%0D%0Acount+as+(%0D%0A++select+'COUNT'+as+facet%2C+null+as+facet_name%2C+count(*)+as+facet_value%2C%0D%0A++null%2C+null%2C+null%2C+null%2C+null%2C+null%2C+null%0D%0A++from+filtered%0D%0A)%2C%0D%0Afacet_state+as+(%0D%0A++select+'state'+as+facet%2C+state+as+facet_name%2C+count(*)+as+facet_value%2C%0D%0A++null%2C+null%2C+null%2C+null%2C+null%2C+null%2C+null%0D%0A++from+filtered+group+by+facet_name+order+by+facet_value+desc+limit+31%0D%0A)%2C%0D%0Afacet_county+as+(%0D%0A++select+'county'+as+facet%2C+county+as+facet_name%2C+count(*)+as+facet_value%2C%0D%0A++null%2C+null%2C+null%2C+null%2C+null%2C+null%2C+null%0D%0A++from+filtered+group+by+facet_name+order+by+facet_value+desc+limit+31%0D%0A)%2C%0D%0Afacet_fips+as+(%0D%0A++select+'fips'+as+facet%2C+fips+as+facet_name%2C+count(*)+as+facet_value%2C%0D%0A++null%2C+null%2C+null%2C+null%2C+null%2C+null%2C+null%0D%0A++from+filtered+group+by+facet_name+order+by+facet_value+desc+limit+31%0D%0A)%0D%0Aselect+*+from+rows%0D%0Aunion+all%0D%0Aselect+*+from+count%0D%0Aunion+all%0D%0Aselect+*+from+facet_state%0D%0Aunion+all%0D%0Aselect+*+from+facet_county%0D%0Aunion+all%0D%0Aselect+*+from+facet_fips&_shape=array" )