[docs]classMarshallIslands(CountryTestBase):location="Marshall Islands"source_url="https://healthdata.gov/api/views/j8mb-icvb/rows.csv"source_url_ref="https://healthdata.gov/dataset/COVID-19-Diagnostic-Laboratory-Testing-PCR-Testing/j8mb-icvb"source_label="Department of Health & Human Services"units="tests performed"rename_columns={"date":"Date"}
[docs]defpipe_metrics(self,df:pd.DataFrame)->pd.DataFrame:# daily change in positive testspos=(df[(df["overall_outcome"]=="Positive")&(df["state_name"]=="Marshall Islands")].groupby("Date",as_index=False).agg(**{"Daily change in positive total":("new_results_reported",sum)})).sort_values("Date")# daily change in total testsdf=(df[df["state_name"]=="Marshall Islands"].groupby(["Date"],as_index=False).agg(**{"Daily change in cumulative total":("new_results_reported",sum)})).sort_values("Date")df=df[df["Daily change in cumulative total"]!=0]returndf