Skip to content

Commit

Permalink
add code to calculate number of positive tests back in
Browse files Browse the repository at this point in the history
  • Loading branch information
cchuong committed Sep 24, 2024
1 parent ee3cadf commit 180e67f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/acquisition/rvdss/rvdss_historic.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,16 @@ def create_percent_positive_detection_table(table,modified_date,start_year, flu=
geo_types = [create_geo_types(g,"lab") for g in table['geo_value']]
table.insert(3,"geo_type",geo_types)

# Calculate number of positive tests based on pct_positive and total tests
if flu:
table["flua_positive_tests"] = (table["flua_pct_positive"]/100)*table["flu_tests"]
table["flub_positive_tests"] = (table["flub_pct_positive"]/100)*table["flu_tests"]

table["flu_positive_tests"] = table["flua_positive_tests"] + table["flub_positive_tests"]
table["flu_pct_positive"] = (table["flu_positive_tests"]/table["flu_tests"])*100
else:
table[virus+"_positive_tests"] = (table[virus+"_pct_positive"]/100) *table[virus+"_tests"]

table = table.set_index(['epiweek', 'time_value', 'issue', 'geo_type', 'geo_value'])

return(table)
Expand Down

0 comments on commit 180e67f

Please sign in to comment.