Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dev] Extending support for City level analysis importing CSV Files #1304

Open
2 tasks done
AnujTiwari opened this issue Nov 22, 2022 · 0 comments
Open
2 tasks done
Labels
brainstorming Discussion to get creative ideas question Further information is requested

Comments

@AnujTiwari
Copy link

Checkbox

  • I agree to follow code of conduct and to engage in discussion actively.
  • I agree to create a new issue with the other templates if developers request.

Question

Please help me to implement the updated version of CovsirPhy for the US City Level COVID-19 reproduction number estimation.
I am getting COVID-19 cases, deaths, and recovery counts from local health departments in CSV fils. Earlier with CovSirPhy 2.21 'DataLoader', I was successfully computing the reproduction numbers using CSV Files but now I am getting many errors. This may be because 'DataLoader' is deprecated in the current version.

Thanks

What tried

My Older Code:

# Create a DataLoader instance 
  loader = cs.DataLoader(update_interval=None)
  
  # Read local Data Frame 
  loader.read_dataframe(df_CasesDeath, parse_dates=["date"], dayfirst=False) 
  # df_CasesDeath has City_Name, Cases, Deaths, and Recovery columns

  # Check the data frame
  print(loader.local)

  # Set necessary columns: country name and population  # with pandas.DataFrame.assign() intenally
  loader.assign(country="US", province= df_CountyPopulation.County.iloc[i], population=df_CountyPopulation.Population.iloc[i])

  # df_CountyPopulation has City_Name, and Population columns
  
  # Check the data frame
  print(loader.local)
  # Lock data by specifing column names to use
  loader.lock(date="date", country="country", province="province", confirmed="confirmed", fatal="fatal", population="population")
  
  # Check locked data
  print(loader.locked)
  # Create JHUData instance
  jhu_data = loader.jhu()
  # Start scenario analysis
  snl = cs.Scenario(country="US", province=df_CountyPopulation.County.iloc[i])
  snl.register(jhu_data)
  snl.records()
  
  print(snl.summary())
  snl.estimate(cs.SIRF)
  _ = snl.history(target="Rt")
  # phase="last" means the last phases
  print(snl.get("Rt", phase="last"))

Additional Context

No response

@AnujTiwari AnujTiwari added brainstorming Discussion to get creative ideas question Further information is requested labels Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brainstorming Discussion to get creative ideas question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant