datadesk/california-coronavirus-data
The Los Angeles Times' independent tally of coronavirus cases in California.
repo name | datadesk/california-coronavirus-data |
repo link | https://github.com/datadesk/california-coronavirus-data |
homepage | https://www.latimes.com/coronavirustracker |
language | Jupyter Notebook |
size (curr.) | 2099 kB |
stars (curr.) | 59 |
created | 2020-03-24 |
license | Other |
california-coronavirus-data
The Los Angeles Times' independent tally of coronavirus cases in California.
About the data
These files come from a continual Times survey of California’s 58 county health agencies and three city agencies. Updated numbers are published throughout the day at latimes.com/coronavirustracker. This repository will periodically update with an extract of that data.
The figures are typically ahead of the totals compiled by California’s Department of Public Health. By polling local agencies, The Times database also gathers some information not provided by the state. The system has won praise from public health officials, who do not dispute its method of data collection.
The tallies here are mostly limited to residents of California, the standard method used to count patients by the state’s health authorities. Those totals do not include people from other states who are quarantined in California, such as the passengers and crew of the Grand Princess cruise ship that docked in Oakland.
Reusing the data
The Los Angeles Times is making coronavirus infections data available for use by researchers and scientists to aid in the fight against COVID-19.
The company’s Terms of Service apply. By using the data, you accept and agree to follow the Terms of Services.
It states that “you may use the content online only, and solely for your personal, non-commercial use, provided you do not remove any trademark, copyright or other notice from such Content,” and that, “no other use is permitted without prior written permission of Los Angeles Times.”
Reselling the data is forbidden. Any use of these data in published works requires attribution to the Los Angeles Times.
To inquire about reuse, please contact Data and Graphics Editor Ben Welsh at ben.welsh@latimes.com.
Data dictionary
latimes-agency-totals.csv
The total cases and deaths logged by local public health agencies each day. Each row contains the cumulative totals reported by a single agency as of that date.
Most counties have only one agency except for Alameda and Los Angeles counties, where some cities run independent health departments. In Alameda County, the city of Berkeley is managed independently. In Los Angeles County, Pasadena and Long Beach are managed independently. These cities' totals are broken out into separate rows. In order to calculate county-level totals, you must aggregate them together using the county
field.
field | type | description |
---|---|---|
agency |
string | The name of the county or city public health agency that provided the data. Guaranteed to be unique when combined with the date field. |
county |
string | The name of the county where the agency is based. |
fips |
string | The FIPS code given to the county by the federal government. Can be used to merge with other data sources. |
date |
date | The date when the data were retrieved in ISO 8601 format. |
confirmed_cases |
integer | The cumulative number of confirmed coronavirus cases as of this date . |
deaths |
integer | The cumulative number of deaths attributed to coronavirus as of this date . |
did_not_update |
boolean | Indicates if the agency did not provide an update on this date. If this is true and the case and death totals are unchanged from the previous day, this means they were holdovers. Use this flag omit these records when desired. |
latimes-county-totals.csv
The county-level totals of cases and deaths logged by local public health agencies each day. This is a derived table. Each row contains the aggregation of all local agency reports in that county logged by Los Angeles Times reporters and editors in latimes-agency-totals.csv
.
It comes with all of the same caveats as its source. It is included here as a convenience.
field | type | description |
---|---|---|
county |
string | The name of the county where the agency is based. |
fips |
string | The FIPS code given to the county by the federal government. Can be used to merge with other data sources. |
date |
date | The date when the data were retrieved in ISO 8601 format. |
confirmed_cases |
integer | The cumulative number of confirmed coronavirus case at that time. |
deaths |
integer | The cumulative number of deaths at that time. |
new_confirmed_cases |
integer | The net change in confirmed cases over the previous date . |
new_deaths |
integer | The net change in deaths over the previous date . |
latimes-state-totals.csv
The statewide total of cases and deaths logged by local public health agencies each day. This is a derived table. Each row contains the aggregation of all local agency reports logged by Los Angeles Times reporters and editors in latimes-agency-totals.csv
.
It comes with all of the same caveats as its source. It is included here as a convenience.
field | type | description |
---|---|---|
date |
date | The date when the data were retrieved in ISO 8601 format. |
confirmed_cases |
integer | The cumulative number of confirmed coronavirus case at that time. |
deaths |
integer | The cumulative number of deaths at that time. |
new_confirmed_cases |
integer | The net change in confirmed cases over the previous date . |
new_deaths |
integer | The net change in deaths over the previous date . |
latimes-place-totals.csv
Some counties, primarily in Southern California, break out the location of cases within their service area. The Times is gathering and consolidating these lists. Each row contains cumulative case totals reported in that area as of that date.
These counties currently provide the data and are being tracked by The Times:
- Alameda
- Contra Costa
- El Dorado
- Los Angeles
- Kern
- Orange
- Riverside
- Sacramento
- San Bernardino
- San Diego
- San Luis Obispo
- Santa Barbara
- Santa Clara
- Sonoma
- Stanislaus
- Ventura
- Yolo
The locations provided by Los Angeles County correspond to the public health department’s official “Countywide Statistical Areas”. Locations in other counties are manually geocoded by The Times.
Be aware that some counties have shifted the place names used over time.
In some circumstances the true total of cases is obscured. Los Angeles and Orange counties decline to provide the precise number of cases in areas with low populations and instead provide a potential range. The lowest number in the range is entered into the record in the confirmed_cases
field and an accompanying note
includes the set of possible values.
field | type | description |
---|---|---|
date |
date | The date when the data were retrieved in ISO 8601 format. |
county |
string | The name of the county where the city is located. |
fips |
string | The FIPS code given to the county by the federal government. Can be used to merge with other data sources. |
place |
string | The name of the city, neighborhood or other area. |
confirmed_cases |
integer | The cumulative number of confirmed coronavirus case at that time. |
note |
string | In cases where the confirmed_cases are obscured, this explains the range of possible values. |
x |
float | The longitude of the place . |
y |
float | The latitude of the place . |
cdph-state-totals.csv
Totals published by the California Department of Public Health in its daily press releases. Each row contains all numbers included in that day’s release.
This file includes cases and deaths, the age of victims, transmission types, tests and hospitalizations. The state has stopped supplying some fields and began supplying some others over time. Deprecated fields have been maintained in this file and are noted below.
Due to bureaucratic lags, the state’s totals for cases and deaths arrive slower than The Times numbers, which are generated by surveying local agencies. The state’s methods for collecting testing data have struggled with errors and delays.
Some dates are missing because the state did not publish a press release for that day.
field | type | description |
---|---|---|
date |
date | The date when the data were retrieved in ISO 8601 format. |
confirmed_cases |
integer | The cumulative number of confirmed coronavirus case at that time. |
deaths |
integer | The cumulative number of deaths at that time. |
travel |
integer | The number of cases acquired while traveling. The state stopped publishing it on March 24. |
person_to_person |
integer | The number of cases acquired from close contacts and family members. The state stopped publishing it on March 24. |
community_spread |
integer | The number of cases acquired from community spread. The state stopped publishing it on March 29. |
under_investigation |
integer | The number of cases acquired from an unknown source. The state stopped publishing it on March 24. |
other_causes |
integer | The number of cases acquired from other sources. On March 24 the state began combining this figure with travel, person-to-person and under investigation cases. On March 29 the state stopped publishing it. |
self_monitoring |
integer | The number of people in a form of isolation monitored by the state. The state stopped publishing it on March 19. |
age_0_to_17 |
integer | The number of confirmed cases involving a person between 0 and 18 years old. |
age_18_to_49 |
integer | The number of confirmed cases involving a person between 18 and 49 years old. |
age_50_to_64 |
integer | The number of confirmed cases involving a person between 50 and 64 years old. |
age_65_and_up |
integer | The number of confirmed cases involving a person 65 of older. |
age_18_to_64 |
integer | The number of confirmed cases involving a person between 18 and 64 years old. The state stopped publishing it on March 23. |
age_unknown |
integer | The number of confirmed cases involving a person of unknown age. |
gender_male |
integer | The number of confirmed cases involving a male. |
gender_female |
integer | The number of confirmed cases involving a female. |
gender_unknown |
integer | The number of confirmed cases involving a a person of unknown gender. |
latino_cases |
integer | The percentage of confirmed cases involving a Latino person. |
latino_deaths |
integer | The percentage of deaths involving a Latino person. |
white_cases |
integer | The percentage of confirmed cases involving a white person. |
white_deaths |
integer | The percentage of deaths involving a white person. |
black_cases |
integer | The percentage of confirmed cases involving a black person. |
black_deaths |
integer | The percentage of deaths involving a black person. |
asian_cases |
integer | The percentage of confirmed cases involving an Asian person. |
asian_deaths |
integer | The percentage of deaths involving an Asian person. |
multiracial_cases |
integer | The percentage of confirmed cases involving a mulitracial person. |
mulitracial_deaths |
integer | The percentage of deaths involving a multiracial person. |
native_cases |
integer | The percentage of confirmed cases involving a Native American person. |
native_deaths |
integer | The percentage of deaths involving a Native American person. |
hawaiian_pacislander_cases |
integer | The percentage of confirmed cases involving an Hawaiian or Pacific Islander. |
hawaiian_pacislander_deaths |
integer | The percentage of deaths involving a Hawaiian or Pacific Islander. |
other_cases |
integer | The percentage of confirmed cases involving a person of another race. |
other_deaths |
integer | The percentage of deaths involving a person of another race. |
total_tests |
integer | The total number of tests conducted. |
received_tests |
integer | The number of tests results received. |
pending_tests |
integer | The number of tests resuts that are still pending. |
confirmed_hospitalizations |
integer | The total number of hospitalizations with a confirmed case of COVID-19. |
confirmed_icu |
integer | The number of ICU hospitalizations with a confirmed case of COVID-19. |
suspected_hospitalizations |
integer | The total number of hospitalizations with a suspected case of COVID-19. |
suspected_icu |
integer | The number of ICU hospitalizations with a suspected case of COVID-19. |
source_url |
string | The URL to the state press release. |
Getting started
The data published here can be easily imported to any data analysis tool, ranging from a simple spreadsheet to a more sophisticated analysis framework. This repository has be pre-configured to work with the Python computer-programming language and a Jupyter computational notebook. You can install and run the code locally on your computer, or on the web with Binder.
Installing locally
Make a fork of this repository, clone it to your computer, then move into the directory.
cd california-coronavirus-data
Install the Python tools you need with pipenv.
pipenv install
Start the Jupyter Lab programming environment.
pipenv run jupyter lab
Check out the example notebook at notebooks/examples.ipynb.
Running online with Binder
Click on the Binder badge above and this repository will boot up inside the site’s system for running Jupyter notebooks over the web. After a few minutes you should have an Jupyter Lab environment up and running.
How you can help
This survey is conducted by The Times' Data and Graphics Department. If you’d like to support its effort to keep California and the nation informed, the best thing you can do is buy a digital subscription and encourage others to do the same. The coronavirus pandemic has had a significant effect on the country’s economy and the news industry is no exception. Without support from readers like you projects like this would not be possible.
Contact
To inquire about the data or about reuse, please contact Data and Graphics Editor Ben Welsh at ben.welsh@latimes.com