Covid-19 Forecasts

Hi Community. I created a Streamlit app which allows you to calculate your own forecast for the Covid-19 numbers. I deployed it with docker on Azure. Have a look on http://cvfcwb.eastus.azurecontainer.io/

1 Like

Cool, I love how you can compare countries side by side!

And a feature request, if I may: it would be nice to have an option to set each pair of charts to use the same y-axis range. This way you can compare absolute numbers visually. For example, here I’d like both of these charts to go from 0 to 0.65:

:beetle: I just found a bug when you set both selectboxes to the same country:

KeyError: 'Cannot get left slice bound for non-unique label: datetime.datetime(2020, 9, 17, 0, 0)'
Traceback:
File "/usr/local/lib/python3.7/site-packages/streamlit/script_runner.py", line 332, in _run_script
    exec(code, module.__dict__)
File "/app/covid_forecast_web.py", line 63, in <module>
    covid_sample_ind = covid_sample.loc[start_date:end_date, indicators[indicator]]
File "/usr/local/lib/python3.7/site-packages/pandas/core/indexing.py", line 873, in __getitem__
    return self._getitem_tuple(key)
File "/usr/local/lib/python3.7/site-packages/pandas/core/indexing.py", line 1044, in _getitem_tuple
    return self._getitem_lowerdim(tup)
File "/usr/local/lib/python3.7/site-packages/pandas/core/indexing.py", line 810, in _getitem_lowerdim
    return getattr(section, self.name)[new_key]
File "/usr/local/lib/python3.7/site-packages/pandas/core/indexing.py", line 879, in __getitem__
    return self._getitem_axis(maybe_callable, axis=axis)
File "/usr/local/lib/python3.7/site-packages/pandas/core/indexing.py", line 1088, in _getitem_axis
    return self._get_slice_axis(key, axis=axis)
File "/usr/local/lib/python3.7/site-packages/pandas/core/indexing.py", line 1123, in _get_slice_axis
    slice_obj.start, slice_obj.stop, slice_obj.step, kind="loc"
File "/usr/local/lib/python3.7/site-packages/pandas/core/indexes/datetimes.py", line 718, in slice_indexer
    return Index.slice_indexer(self, start, end, step, kind=kind)
File "/usr/local/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 4966, in slice_indexer
    start_slice, end_slice = self.slice_locs(start, end, step=step, kind=kind)
File "/usr/local/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 5169, in slice_locs
    start_slice = self.get_slice_bound(start, "left", kind)
File "/usr/local/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 5102, in get_slice_bound
    f"Cannot get {side} slice bound for non-unique "

Thanks for the report. I don’t understand why, but now I avoid this situation. I’m cheating…:slight_smile:

Thanks for the suggestion. This had crossed my mind as well. But if the numbers are very different, then you won’t see mutch of the country with the small numbers. But I will have a look maybe sometime.