<jupyter_start><jupyter_text>Loading<jupyter_code>import pandas as pd
import numpy as np
import plotly.express as px
import plotly.graph_objects as go
from plotly.subplots import make_subplots

url = 'https://raw.githubusercontent.com/CloseChoice/FlatCurver/dev/data/Coronavirus.history.v2.csv'
url_pop = 'https://raw.githubusercontent.com/CloseChoice/FlatCurver/dev/data/einwohner_bundeslaender.csv'
url_rki_neuinfektionen = 'https://raw.githubusercontent.com/CloseChoice/FlatCurver/dev/data/RKI_Neuinfektionen_pro_land_pro_tag.csv'
url_rki_todesfaelle = 'https://raw.githubusercontent.com/CloseChoice/FlatCurver/dev/data/RKI_Todesfaelle_pro_land_pro_tag.csv'

data = pd.read_csv(url)
df_ger = data.loc[data['parent'] == 'Deutschland'].copy()
df_infek = pd.read_csv(url_rki_neuinfektionen)
df_todesfaelle = pd.read_csv(url_rki_todesfaelle)

pop = pd.read_csv(url_pop, sep='\t')


df_ger = pd.merge(df_ger, pop.set_index('Bundesland'), left_on='label', right_index=True, how='left')
df_ger = df_ger.loc[df_ger['label'] != 'Repatriierte', :].copy()

df_todesfaelle.Altersgruppe.unique()<jupyter_output><empty_output><jupyter_text>Mapbox<jupyter_code>fig = px.scatter_mapbox(df_ger, lat="lat", lon="lon", size="confirmed", animation_frame='date',
                  color_continuous_scale=px.colors.cyclical.IceFire)
fig.update_layout(mapbox_style="open-street-map").update_layout({'plot_bgcolor': 'rgba(0, 0, 0, 0)',
                'paper_bgcolor': 'rgba(0, 0, 0, 0)',
                'mapbox': {'pitch': 10, 'zoom': 5}})
fig.show()
fig = px.density_mapbox(df_ger, lat='lat', lon='lon', z='confirmed', radius=50, animation_frame='date', zoom=5, range_color=[0, max(df_ger['confirmed'])], height=800)
fig.update_layout(mapbox_style="open-street-map").update_layout({'plot_bgcolor': 'rgba(0, 0, 0, 0)',
                'paper_bgcolor': 'rgba(0, 0, 0, 0)',
                'mapbox': {'pitch': 10, 'zoom': 5}})
fig.show()<jupyter_output><empty_output><jupyter_text>Plots<jupyter_code>fig = px.line(df_ger, x='date', y='confirmed', color='label')
fig.show()
fig = px.line(df_ger, x='date', y='confirmed', color='label', log_y=True)
fig.show()<jupyter_output><empty_output><jupyter_text>W.I.P.<jupyter_code>df_bundesweit = df_ger.groupby('date').sum().reset_index()

fig = px.line(df_bundesweit, x='date', y='confirmed', log_y=True)
fig.show()<jupyter_output><empty_output><jupyter_text>TODO* Add functions for marker* Add Date to Mapbox<jupyter_code>df_bundesweit = df_ger.groupby('date').sum().reset_index()

fig = make_subplots(rows=1, cols=2, specs=[[{"type": "mapbox"}, {"type": "xy"}]])
fig.add_trace(go.Densitymapbox(lat=df_ger['lat'], lon=df_ger['lon'], z=df_ger['confirmed']), row=1, col=1).update_layout(mapbox_style="open-street-map", mapbox_center_lon=11,
                                                                                                                         mapbox_center_lat=50).update_layout({'plot_bgcolor': 'rgba(0, 0, 0, 0)',
                'paper_bgcolor': 'rgba(0, 0, 0, 0)',
                'mapbox': {'pitch': 10, 'zoom': 5}})
fig.add_trace(go.Scatter(x=df_bundesweit['date'], y=df_bundesweit['confirmed'], name='Bundesweit'), row=1, col=2)
fig.update_layout(height=800, showlegend=False, title_text='Bundesweite Entwicklung',
    updatemenus=[
        dict(active=0,
            buttons=list([
                dict(
                    args=[{'yaxis': {'type': 'linear'}}],
                    label="Linear",
                    method="relayout"
                ),
                dict(
                    args=[{'yaxis': {'type': 'log'}}],
                    label="Log",
                    method="relayout"
                )
            ]),
            direction="down",
            pad={"r": 10, "t": 10},
            showactive=True,
            xanchor="left",
            yanchor="top",
            x=0,
            y=1.075,
        ),
    ]
)
fig.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16967692699058765, 'fraction_numerical': 0.016280844568812007, 'mean_word_length': 3.4885844748858448, 'pattern_counts': {'":': 4, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '41446', 'license': 'MIT', 'n_tokens_mistral': 1482, 'n_tokens_neox': 1411, 'n_words': 191, 'path': 'data_analysis/notebooks/Corona.ipynb', 'repo_name': 'Lemming0815/FlatCurver', 'size': '3931'}