<jupyter_start><jupyter_text><a href="https://colab.research.google.com/github/ai2ys/Covid-19-EDA/blob/master/Colab_CSSE_Covid_19_time_series.ipynb"    target="_parent">      Custom plots for COVID-19 data Using the John Hopkins CSSE COVID-19 data:https://github.com/CSSEGISandData/COVID-19 From the 24 March 2020 on the here used time series are deprecated, have a look at the following README.md file [https://github.com/CSSEGISandData/COVID-19/blob/master/csse_covid_19_data/csse_covid_19_time_series/README.md](https://github.com/CSSEGISandData/COVID-19/blob/master/csse_covid_19_data/csse_covid_19_time_series/README.md)Using list of countries by population from Wikipedia:https://en.wikipedia.org/wiki/List_of_countries_by_population_(United_Nations)<jupyter_code>!git clone https://github.com/ai2ys/Covid-19-EDA.git
cd /content/Covid-19-EDA
from csse_covid19 import Csse_covid19, ScaleType
from ipywidgets import interact,FloatSlider,IntSlider, VBox
from ipywidgets import widgets 
from enum import Enum

num_countries = 10
type_current = Csse_covid19.Confirmed
countries = type_current.get_top_countries()
slider_top_n = IntSlider(min=1, max=20, value=num_countries, description='Top X')
layer = None
select_type = widgets.Select(
    options = [
        Csse_covid19.Confirmed, 
        Csse_covid19.Deaths
    ],
    value=type_current,
    rows=2,
    description='Diagram',
    disabled=False
)
select_scale = widgets.Select(
    options = [
        ScaleType.Linear,
        ScaleType.Log_10,
    ],
    value=ScaleType.Log_10,
    rows=2,
    description='Y scale',
    disabled=False
)
toggle_normalize = widgets.ToggleButton(
    value=False,
    description='Normalize using population [in millions]',
    disabled=False,
    button_style='', # 'success', 'info', 'warning', 'danger' or ''
    tooltip='Normalize using population',
    icon='check' # (FontAwesome names without the `fa-` prefix)
)

def plot(select_type, top_n, select_scale, 
         toggle_normalize
        ):
    countries = select_type.get_top_countries(top_n)
    name = '{}_top{}_{}.png'.format(select_type.name, top_n, select_scale.name)
    layer = select_type.alt_plot(countries,sort_legend=True, day_delta=2,
                         scale_type=select_scale, 
                         normalize_by_population=toggle_normalize)
display(VBox([select_type,
      slider_top_n,
      select_scale,
      toggle_normalize]))
print("Run cell below after selecting your options for the plot")
plot(select_type=select_type.value, 
     top_n=slider_top_n.value,
     select_scale=select_scale.value,
     toggle_normalize=toggle_normalize.value,
        )<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10329341317365269, 'fraction_numerical': 0.020958083832335328, 'mean_word_length': 4.261811023622047, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '657913', 'license': 'Unlicense', 'n_tokens_mistral': 952, 'n_tokens_neox': 892, 'n_words': 159, 'path': 'Colab_CSSE_Covid_19_time_series.ipynb', 'repo_name': 'ai2ys/Covid-19-EDA', 'size': '2672'}