<jupyter_start><jupyter_text>LA's COVID-19 Reopening Indicators This report contains information about how LA County and the City of LA performed yesterday, on a number of key COVID-19 indicators related to the speed at which opening up can occur. Taken together, performing well against the benchmarks provide confidence in moving through each phase of reopening. **LA is certainly an epicenter.** * [NYT analysis of LA County neighborhoods](https://www.nytimes.com/interactive/2021/01/29/us/los-angeles-county-covid-rates.html)* By mid Jan 2021, it is estimated that [1 in 3](https://www.latimes.com/california/story/2021-01-14/one-in-three-la-county-residents-infected-coronavirus) already have had COVID in LA County, triple the confirmed/reported cases.* By early Jan 2021, it is estimated that [1 in 17 people currently have COVID in LA County](https://www.sfgate.com/bayarea/article/Los-Angeles-County-COVID-data-1-in-17-hospitals-15848658.php)* By late Dec, southern CA and central CA have [run out of ICU beds](https://www.nytimes.com/2020/12/26/world/central-and-southern-california-icu-capacity.html)* In mid Dec, LA County Department of Public Health [estimated that 1 in 80 people were infectious](http://file.lacounty.gov/SDSInter/dhs/1082410_COVID-19ProjectionPublicUpdateLewis12.16.20English.pdf)* LA reaches [5,000 deaths](https://www.latimes.com/california/story/2020-08-11/13000-more-coronavirus-cases-california-test-results-backlog) by mid-August, and is ranked as 3rd highest US county in terms of deaths, after Queens (NY) and Kings (NY) Counties.* LA County is [projected](https://www.planetizen.com/news/2020/07/109756-californias-coronavirus-infections-and-hospitalizations-surge) to [run out](https://www.latimes.com/california/story/2020-06-29/l-a-county-issues-dire-warning-amid-alarming-increases-in-coronavirus) of ICU beds by early to mid July, with acute care beds [reaching capacity](https://www.nytimes.com/2020/07/03/health/coronavirus-mortality-testing.html) soon after. * In late June, LA County Department of Public Health (DPH) [estimated that 1 in 400 people were infectious](https://www.latimes.com/california/story/2020-06-29/o-c-reports-highest-weekly-covid-19-death-toll-as-california-sees-spike-in-cases), asymptomatic, and not isolated. One week later, as of June 29, LA DPH estimated the risk increased threefold, up to [1 in 140](https://www.nytimes.com/2020/06/29/us/california-coronavirus-reopening.html). As long as LA consistently tests large portions of its population with fairly low positive COVID-19 results, sustains decreases in cases and deaths, has stable or decreasing COVID-related hospitalizations, and stocks ample available hospital equipment for a potential surge, we are positioned to continue loosening restrictions. When any one indicator fails to meet the benchmark, we should slow down to consider why that is happening. When multiple indicators fail to meet the benchmark, we should pause our reopening plans and even enact more stringent physical and social distancing protocols by moving back a phase.         * [Federal Gating Criteria](https://www.whitehouse.gov/wp-content/uploads/2020/04/Guidelines-for-Opening-Up-America-Again.pdf)* [State Gating Criteria](https://covid19.ca.gov/roadmap-counties/)    * CA Department of Public Health's [Blueprint](https://covid19.ca.gov/safer-economy/reopening-data) toward Reopening, [rules for tier assignments](https://www.cdph.ca.gov/Programs/CID/DCDC/Pages/COVID-19/COVID19CountyMonitoringOverview.aspx) and [Dimmer Switch Framework](https://www.cdph.ca.gov/Programs/CID/DCDC/CDPH%20Document%20Library/COVID-19/Dimmer-Framework-September_2020.pdf)    * [CA Reopening, Take 2](https://www.nytimes.com/2020/08/31/us/california-coronavirus-reopening.html)* [WHO Testing and Positivity Rate Guidelines](https://coronavirus.jhu.edu/testing/testing-positivity)Below, you will see how LA performed yesterday on the following indicators. The data does have a one day lag. Whenever City of LA (subset of LA County) data is available, it is also reported. Symptoms* Downward trajectory of influenza-like illnesses (ILI) reported within a 14-day period **and*** Downward trajectory of COVID-like syndromic cases reported within a 14-day period Cases* Downward trajectory of documented cases within a 14-day period **or*** Downward trajectory of positive tests as a percent of total tests within a 14-day period (flat or increasing volume of tests)  Hospitals* Treat all patients without crisis care **and*** Robust testing program in place for at-risk healthcare workers, including emerging antibody testing References* [Reopening Indicators](https://github.com/CityOfLosAngeles/covid19-indicators/blob/master/Reopening_Indicators_Comparison.xlsx) from [New York State](https://www.nytimes.com/2020/05/04/nyregion/coronavirus-reopen-cuomo-ny.html) and [Chicago](https://www.chicagotribune.com/coronavirus/ct-coronavirus-chicago-reopening-lightfoot-20200508-ztpnouwexrcvfdfcr2yccbc53a-story.html)* [Collection of articles](https://github.com/CityOfLosAngeles/covid19-indicators/blob/master/reopening-sources.md) related to what experts say about reopening and the known unknowns ahead     * [LA and Chicago](https://www.nytimes.com/2020/05/09/us/coronavirus-chicago.html), after NYC, have the most persistent virus caseloads    * [LA, DC, and Chicago](https://www.latimes.com/california/story/2020-05-22/white-house-concerned-with-coronavirus-spread-in-l-a-area-asks-cdc-to-investigate) remain hotspots within the US     **Related daily reports:** 1. **[US counties report on cases and deaths for select major cities](https://cityoflosangeles.github.io/covid19-indicators/us-county-trends.html)**1. **[CA counties report on cases, deaths, and hospitalizations](https://cityoflosangeles.github.io/covid19-indicators/ca-county-trends.html)**1. **[Los Angeles County neighborhoods report on cases and deaths](https://cityoflosangeles.github.io/covid19-indicators/la-neighborhoods-trends.html)**<jupyter_code>import numpy as np
import pandas as pd

from processing_utils import ca_reopening_tiers
from processing_utils import default_parameters
from processing_utils import make_charts
from processing_utils import meet_indicators
from processing_utils import utils

from IPython.display import display_html, Markdown, HTML

# Default parameters
county_state_name = default_parameters.county_state_name
state_name = default_parameters.state_name
msa_name = default_parameters.msa_name
time_zone = default_parameters.time_zone

fulldate_format = default_parameters.fulldate_format
monthdate_format = default_parameters.monthdate_format
start_date = default_parameters.start_date
yesterday_date = default_parameters.yesterday_date
today_date = default_parameters.today_date
one_week_ago = default_parameters.one_week_ago
two_weeks_ago = default_parameters.two_weeks_ago
three_weeks_ago = default_parameters.three_weeks_ago
two_days_ago = default_parameters.two_days_ago
eight_days_ago = default_parameters.eight_days_ago

# Daily testing upper and lower bound
county_test_lower_bound = 15_000
county_test_upper_bound = 16_667
positive_lower_bound = 0.04
positive_upper_bound = 0.08
positive_2weeks_bound = 0.05
hospital_bound = 0.30
ca_hospitalization_bound = 0.05

# Set cut-offs for CA reopening
ca_case_minimal_bound = 1
ca_case_moderate_bound = 4
ca_case_substantial_bound = 7 
ca_test_minimal_bound = 0.020
ca_test_moderate_bound = 0.050
ca_test_substantial_bound = 0.080
def check_report_readiness(county_state_name, state_name, msa_name, start_date, yesterday_date):
    """
    Check if each dataframe has yesterday's date's info.
    If all datasets are complete, report can be run.
    """
    
    df = utils.prep_county(county_state_name, start_date)
    if df.date.max() < yesterday_date:
        raise Exception("Data incomplete")    
    
    df = utils.prep_lacity_cases(start_date)
    if df.date.max() < yesterday_date:
        raise Exception("Data incomplete")        
    
    df = utils.prep_testing(start_date)
    if (df.date.max() < yesterday_date) or (
                    (df.date.max() == today_date) and (df.County_Performed == 0) ): 
        raise Exception("Data incomplete")
 
    df = utils.prep_hospital_surge(county_state_name, start_date)
    if df.date.max() < two_days_ago:
        raise Exception("Data incomplete")

#check_report_readiness(county_state_name, state_name, msa_name, start_date, yesterday_date)
# Check cases according to some criterion
def check_cases(row):
    status = ["failed" if x < 14 else "met" if x >= 14 else "" for x in row]
    return pd.Series(status, index=row.index, dtype="category")

def check_deaths(row):
    status = ["failed" if x < 14 else "met" if x >= 14 else "" for x in row]
    return pd.Series(status, index=row.index, dtype="category")

def check_tests(lower_bound, upper_bound, row):
    status = ["failed" if x < lower_bound 
              else "met" if ((x >= lower_bound) and (x < upper_bound)) 
              else "exceeded" if x >= upper_bound 
              else "" for x in row]
    return pd.Series(status, index=row.index, dtype="category")

def check_positives(row):
    status = ["failed" if x > positive_upper_bound 
              else "met" if ((x >= positive_lower_bound) and (x <= positive_upper_bound)) 
              else "exceeded" if x < positive_lower_bound 
              else "" for x in row]
    return pd.Series(status, index=row.index, dtype="category")

def check_positives_two_weeks(row):
    status = ["met" if x <= positive_2weeks_bound 
              else "failed" if x>= positive_2weeks_bound 
              else "" for x in row]
    return pd.Series(status, index=row.index, dtype="category")  


def check_hospitalizations(row):
    status = ["met" if x < ca_hospitalization_bound 
              else "failed" if x >= ca_hospitalization_bound 
              else "" for x in row]
    return pd.Series(status, index=row.index, dtype="category")    


county_fnmap = {
    "Cases": check_cases,
    "Deaths": check_deaths,
    "Daily Testing": lambda row: check_tests(county_test_lower_bound, county_test_upper_bound, row),
    "Positive Tests": check_positives,
    "Positive Tests (WHO)": check_positives_two_weeks,
    "COVID Hospitalizations": check_hospitalizations,
    "COVID ICU Hospitalizations": check_hospitalizations,
}

city_fnmap = {
    "Cases": check_cases,
    "Deaths": check_deaths,
    "Daily Testing": lambda row: check_tests(county_test_lower_bound, county_test_upper_bound, row),
    "Positive Tests": check_positives,
    "Positive Tests (WHO)": check_positives_two_weeks,    
    "COVID Hospitalizations": check_hospitalizations,
    "COVID ICU Hospitalizations": check_hospitalizations,
}

red = make_charts.maroon
green = make_charts.green
blue = make_charts.blue

stylemap = {
    "failed": f"background-color: {red}; color: white; font-weight: bold; opacity: 0.7" ,
    "met": f"background-color: {green}; color: white; font-weight: bold; opacity: 0.7",
    "exceeded": f"background-color: {blue}; color: white; font-weight: bold; opacity: 0.7",
    "": "background-color: white; color: black; font-weight: bold; opacity: 0.7",
}
# Add CA Blueprint for Safer Economy (reopening, take 2) criterion to get colors
def check_ca_case(row):
    status = ["minimal" if x < ca_case_minimal_bound 
              else "moderate" if ((x >= ca_case_minimal_bound) and (x < ca_case_moderate_bound))
              else "substantial" if ((x >= ca_case_moderate_bound) and (x <= ca_case_substantial_bound))
              else "widespread" if x > ca_case_substantial_bound 
              else "" for x in row] 
    
    return pd.Series(status, index=row.index, dtype="category") 

def check_ca_test(row):
    status = ["minimal" if x < ca_test_minimal_bound 
              else "moderate" if (x >= ca_test_minimal_bound) and (x < ca_test_moderate_bound)
              else "substantial" if (x >= ca_test_moderate_bound) and (x <= ca_test_substantial_bound)
              else "widespread" if x > ca_test_substantial_bound 
              else "" for x in row] 
    
    return pd.Series(status, index=row.index, dtype="category") 

def check_ca_overall_tier(row):
    status = ["minimal" if x==1 
              else "moderate" if x==2
              else "substantial" if x==3
              else "widespread" if x==4
              else "" for x in row] 
    
    return pd.Series(status, index=row.index, dtype="category")

ca_tier_fnmap = {
    "Overall Tier": check_ca_overall_tier,
    "Case Rate per 100k": check_ca_case,
    "Test Positivity Rate": check_ca_test,
}

purple = make_charts.purple
red = make_charts.maroon
orange = make_charts.orange
yellow = make_charts.yellow

stylemap_ca = {
    "widespread": f"background-color: {purple}; color: white; font-weight: bold; opacity: 0.7" ,
    "substantial": f"background-color: {red}; color: white; font-weight: bold; opacity: 0.7",
    "moderate": f"background-color: {orange}; color: white; font-weight: bold; opacity: 0.7",
    "minimal": f"background-color: {yellow}; color: white; font-weight: bold; opacity: 0.7",    
    "": "background-color: white; color: black; font-weight: bold; opacity: 0.7",
}
# These are functions used to clean the CA county indicators df
def put_in_tiers(row, indicator, minimal_bound, moderate_bound, substantial_bound):
    if row[indicator] < minimal_bound:
        return 1
    elif (row[indicator] >= minimal_bound) and (row[indicator] < moderate_bound):
        return 2
    elif (row[indicator] >= moderate_bound) and (row[indicator] <= substantial_bound):
        return 3
    elif row[indicator] > substantial_bound:
        return 4
    else: 
        return np.nan

def add_tiers(df):
    df = df.assign(
        case_tier = df.apply(lambda x: 
                                    put_in_tiers(x, "case", 
                                    ca_case_minimal_bound, ca_case_moderate_bound, 
                                    ca_case_substantial_bound), axis=1).astype("Int64"), 
        test_tier = df.apply(lambda x: 
                                    put_in_tiers(x, "test", 
                                    ca_test_minimal_bound, ca_test_moderate_bound, 
                                    ca_test_substantial_bound), axis=1).astype("Int64")
    )
    
    # If 2 indicators belong in different tiers, most restrictive (max) is assigned overall
    df = (df.assign(
            overall_tier = df[["case_tier", "test_tier"]].max(axis=1).astype(int)
        )[["overall_tier", "case", "test"]]
          .rename(columns = {"overall_tier": "Overall Tier", 
                            "case": "Case Rate per 100k", 
                            "test": "Test Positivity Rate"
                            })
    )
    
    # Transpose
    df = (df.T
          .rename(columns = {0: "Current Week", 
                             1: "One Week Ago", 
                             2: "Two Weeks Ago",})
    )
    
    return df
def summary_of_ca_reopening_indicators():
    # Grab indicators
    ca_case_today_indicator = ca_reopening_tiers.case_rate(county_state_name, start_date, "today")
    ca_case_last_week_indicator = ca_reopening_tiers.case_rate(county_state_name, start_date, "one_week_ago")
    ca_case_two_week_indicator = ca_reopening_tiers.case_rate(county_state_name, start_date, "two_weeks_ago")

    ca_test_last_week_indicator = ca_reopening_tiers.positive_rate(start_date, "one_week_ago")
    ca_test_two_week_indicator = ca_reopening_tiers.positive_rate(start_date, "two_weeks_ago")

    # Create a df for the county's indicators based off of CA Blueprint to Safer Economy
    ca_county = pd.DataFrame(
        {"case": [ca_case_today_indicator, ca_case_last_week_indicator, ca_case_two_week_indicator], 
         "test": [np.nan, ca_test_last_week_indicator, ca_test_two_week_indicator]
        }
    )

    # Clean up df
    df = add_tiers(ca_county)

    # Style the table
    ca_county_html = (df.style
       .format(lambda s: f"{s:,g}", na_rep="-")
       .apply(lambda row: ca_tier_fnmap[row.name](row).map(stylemap_ca), axis=1)
       .render()
      )
    
    display(Markdown(f"<strong>CA Reopening Metrics: {county_state_name.split(',')[0]} County</strong>"))
    display(HTML(ca_county_html))
def summary_of_indicators():
    # Grab indicators
    county_case_indicator = meet_indicators.meet_case("county", county_state_name, start_date)
    county_death_indicator = meet_indicators.meet_death("county", county_state_name, start_date)
    county_test_indicator = meet_indicators.meet_daily_testing(yesterday_date, "county", 
                                                               county_test_lower_bound, county_test_upper_bound)
    county_positive_indicator = meet_indicators.meet_positive_share(yesterday_date, "county", 
                                                                    positive_lower_bound, positive_upper_bound)
    
    county_positive_2wks_indicator = meet_indicators.meet_positive_share_for_two_weeks(yesterday_date, "county")
    
    # 8/11: Ignore LA County HavBed data, since it seems to be reported much more infrequently
    # Use CA data portal's hospitalizations
    
    hospitalization_indicator = meet_indicators.meet_all_hospitalization(county_state_name, yesterday_date)
    icu_hospitalization_indicator = meet_indicators.meet_icu_hospitalization(county_state_name, yesterday_date)
    
    city_case_indicator = meet_indicators.meet_case("lacity", "City of LA", start_date)
    city_death_indicator = meet_indicators.meet_death("lacity", "City of LA", start_date)
    

    indicator_names = ["Cases", "Deaths", 
                       "Daily Testing", "Positive Tests", "Positive Tests (WHO)",
                       "COVID Hospitalizations", "COVID ICU Hospitalizations"]
    
    
    # Create separate df for county and city
    county = pd.DataFrame(
        {"LA County": [county_case_indicator, county_death_indicator, 
                    county_test_indicator, county_positive_indicator, county_positive_2wks_indicator,
                    hospitalization_indicator, icu_hospitalization_indicator]},
        index=indicator_names
    )

    city = pd.DataFrame(
        {"City of LA": [city_case_indicator, city_death_indicator, 
                    np.nan, np.nan, np.nan,
                    np.nan, np.nan]},
        index=indicator_names
    )

    # Style the table
    def display_side_by_side(*args):
        html_str=''
        for df in args:
            html_str+=df
        display_html(html_str.replace('table','table style="display:inline"'),raw=True)
   
        
    county_html = (county.style
                   .format(lambda s: f"{s:,g}", na_rep="-")
                   .apply(lambda row: county_fnmap[row.name](row).map(stylemap), axis=1)
                   .render()
                  )
    city_html = (city.style
                 .format(lambda s: f"{s:,g}", na_rep="-")
                 .apply(lambda row: city_fnmap[row.name](row).map(stylemap), axis=1)
                 .hide_index()
                 .render()
                )    
    
    display(Markdown("<strong>Indicators for LA County and City of LA</strong>"))
    display_side_by_side(county_html, city_html)
display(Markdown(f"### Summary of Indicators as of {yesterday_date.strftime(fulldate_format)}:"))<jupyter_output><empty_output><jupyter_text>Indicators Based on CA State GuidelinesCA's [Blueprint for a Safer Economy](https://www.cdph.ca.gov/Programs/CID/DCDC/Pages/COVID-19/COVID19CountyMonitoringOverview.aspx) assigns each county to a tier based on case rate and test positivity rate. If counties fall into 2 different tiers on the two metrics, they are assigned to the more restrictive tier. Tiers, from most severe to least severe, categorizes coronavirus spread as widespread; substantial; moderate; or minimal.**Counties must stay in the current tier for 3 consecutive weeks and metrics from the last 2 consecutive weeks must fall into less restrictive tier before moving into a less restrictive tier.*** **Case Rate per 100k**: the unadjusted case rate per 100k. Any value above 7 is widespread; a value of 4-7 is substantial.  CA does adjust the case rate based on testing volume, but that is not done here.* **Test Positivity Rate**: percent of tests that are COVID-positive. Any value above 8% is widespread; a value of 5-8% is substantial.   Indicators Based on Federal GuidelinesThese indicators can fail to meet the lower benchmark; meet the lower benchmark; or exceed the higher benchmark.* **Cases and deaths**: the number of days with declining values from the prior day over the past 14 days. Guidelines state both should sustain a 14-day downward trajectory. Any value less than 14 means we failed to meet this benchmark.* **Daily Testing**: number of daily tests conducted for the county 2 days ago (accounting for a time lag in results reported). LA County's goal is to test 15,000 daily (45 tests per 1,000 residents) *(lower bound)*. Chicago's goal was 50 tests per 1,000 residents, translating to 16,667 tests daily *(upper bound)*. Below 15,000 (county) means we failed this benchmark.* **Positive Tests**: proportion of positive tests last week, values fall between 0 and 1. CA's positivity requirement is 8% or below *(upper bound)*, but experts say that [less than 4%](https://www.nytimes.com/2020/05/25/health/coronavirus-testing-trump.html) is necessary to halt the spread of the virus *(lower bound)*. More than 8% positive for the past week means we failed to meet this benchmark. * **Positive Tests (WHO)**: proportion of positive tests in the past 2 weeks, values fall between 0 and 1. The weeks are weighted by the number of tests conducted. The WHO recommends that tests return less than 5% positive for 14 days prior to reopening. JHU has a [state-by-state analysis](https://coronavirus.jhu.edu/testing/testing-positivity) of this. More than 5% positive over two weeks means we failed to meet this benchmark. * **Hospitalizations**: the 7-day averaged daily percent change in all COVID hospitalizations and COVID ICU hospitalizations; values fall between 0 and 1. CA guidelines ask for stable or downward trends, not exceeding a 5% daily change.Above 5% means we failed to meet this benchmark.<jupyter_code>summary_of_ca_reopening_indicators()
summary_of_indicators()
display(Markdown("## Caseload Charts"))
display(Markdown(
    f"These are the trends in cases and deaths for the county and the city since {start_date.strftime(fulldate_format)}, using a 7-day rolling average. "
    )
)<jupyter_output><empty_output><jupyter_text>The **cases and deaths requirement is that both have been decreasing for the past 14 days.** The past 14 days are shaded in gray.<jupyter_code>la_county = utils.county_case_charts(county_state_name, start_date)
la_city = utils.lacity_case_charts(start_date) 
display(Markdown("## Testing Charts"))
display(Markdown(
    f"These charts show the amount of daily testing conducted and the percent of tests that came back positive for COVID-19 by week since {start_date.strftime(fulldate_format)}. "
    )
)<jupyter_output><empty_output><jupyter_text>Daily TestingLA County's goal is to conduct an average of 15,000 tests a day, a rate of 45 tests per 1,000 residents *(lowerbound)*. Chicago, another region faced with a severe outbreak, set the precedent for regional benchmarks being more stringent than statewide requirements if a particular region underwent a more severe outbreak. Chicago's goal is 50 tests per 1,000 residents, or 16,667 tests per day *(upper bound)*. **The daily testing requirement is that we are conducting at least 15,000 tests daily until a vaccine is ready.** We need to **consistently record testing levels at or above** the lower dashed line.<jupyter_code>county_tests = utils.lacounty_testing_charts(start_date, county_test_lower_bound, county_test_upper_bound)<jupyter_output><empty_output><jupyter_text>Share of Positive COVID-19 Test Results by WeekLA County's data, though subject to a time lag, does report the number of positive tests per testing batch. We aggregate the results by week. Only weeks with all 7 days of data available is used for the chart, which means the current week is excluded.The chart compares the percent of positive test results, the number of positive cases, and the number of tests conducted. The percent of positive test results is the indicator of interest, but it is extremely dependent on the number of tests conducted. A higher percentage of positive tests can be due to more confirmed cases or fewer tests conducted. Therefore, the next chart shows the number of tests conducted each week (blue) and the number of positive tests (gray). It also shows the testing upper and lower bounds, which is simply the daily testing upper and lower bounds multiplied by 7.**How to Interpret Results**1. If the number of positive tests and the percent of positive tests increase while daily testing is conducted at a similar level, there is increased transmission of the virus.1. If we keep up our daily testing levels yet see a corresponding drop in the share of positive tests and the number of positive cases, we are curbing the asymptomatic transmission of the virus. 1. If daily testing drops and we see a corresponding drop in positive test results, the decrease in positive results is due to a lack of testing, not because there is less hidden, community transmission of the virus.1. If daily testing is stable or increasing, the share of positive tests is stable or decreasing, yet the number of positive cases is growing, then our tests are finding the new cases.**CA's weekly COVID-19 positive share requirement is that tests coming back positive is 8% or below** *(upper bound)*, but experts say that [less than 4% positive](https://www.nytimes.com/2020/05/25/health/coronavirus-testing-trump.html) is necessary to halt the spread of the virus *(lower bound)*. *Caveat 1:* Testing data for city only counts tests done at city sites. Oral swabs are used by county/city sites, which have an approximate 10% false negative rate. On average, 10% of negative tests are falsely identified to be negative when they are actually positive. At the county level, we do have information on total number of tests, which include county/city sites and private healthcare providers (anyone who provides electronic data reporting), such as <NAME>. We use the [Tests by Date](http://dashboard.publichealth.lacounty.gov/covid19_surveillance_dashboard/) table. There is a time lag in results reported, and we are not sure if this lag is 3, 5, or 7 days for the results from an entire testing batch to come back.*Caveat 2:* The situation on-the-ground is important for contextualizing the data's interpretation. When testing capacity is stretched and [testing is rationed](https://calmatters.org/health/coronavirus/2020/07/california-new-coronavirus-testing-guidelines/), those who are able to obtain tests are more likely to test positive. This distorts the share of positive results, and we expect the positivity rate to increase when we target the riskiest subgroups. We are excluding a subset of cases that would test positive, if testing supplies were available. Factoring in the high false negative rate from oral swabs used at county/city sites, we are **undercounting the actual number of cases, but are observing trends from the riskiest or most vulnerable subgroups**.<jupyter_code>county_positive_tests = utils.lacounty_positive_test_charts(start_date, positive_lower_bound, positive_upper_bound, 
                                                     county_test_lower_bound, county_test_upper_bound)<jupyter_output><empty_output><jupyter_text>Hospitalizations ChartsData on all COVID-related hospitalizations and ICU hospitalizations comes from the CA open data portal made available 6/25/20; this data **covers the entire county**. These charts show the number of hospitalizations from all COVID cases and also ICU hospitalizations for severe COVID cases.CA guidelines state that hospitalizations should be stable or downtrending on 7-day average of daily percent change of less than 5%. LA County's all COVID-related hospitalizations and COVID-related ICU hospitalizations (subset of all hospitalizations) are shown.<jupyter_code>hospitalizations = utils.county_covid_hospital_charts(county_state_name, start_date)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08722302462394758, 'fraction_numerical': 0.01747278683904604, 'mean_word_length': 3.957736639888229, 'pattern_counts': {'":': 33, '<': 51, '<?xml version=': 0, '>': 47, 'https://': 31, 'lorem ipsum': 0, 'www.': 21, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 13, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '365147', 'license': 'Apache-2.0', 'n_tokens_mistral': 8798, 'n_tokens_neox': 7987, 'n_words': 2728, 'path': 'notebooks/coronavirus-stats.ipynb', 'repo_name': 'tiffanychu90/covid19-indicators', 'size': '28398'}