<jupyter_start><jupyter_text>Plotly Dash TutorialIn this tutorial session we're going to explore how to make dashboard using [Dash by Plotly](https://dash.plotly.com/).  What is Plotly Dash?Dash is a productive Python framework for building web analytic applications.Written on top of Flask, Plotly.js, and React.js, Dash is ideal for building data visualization apps with highly custom user interfaces in pure Python. It's particularly suited for anyone who works with data in Python. Front-EndDash’s frontend renders HTML components using **React.js**, the Javascript user-interface library written and maintained by Facebook. Back-EndDash applications are web servers running **Flask** and communicating JSON packets over HTTP requests.  Graphs Graphs in Dash use the Plotly python library  Imports<jupyter_code>import plotly.graph_objects as go
from plotly.subplots import make_subplots
import plotly.express as px
import pandas as pd
import numpy as np

pd.set_option("display.max_rows", 500)
pd.set_option("display.max_columns", 500)<jupyter_output><empty_output><jupyter_text>Data Exploration<jupyter_code>df = pd.read_csv("./data/owid-covid-data.csv")
df.shape
df.head()
df.dtypes
df.describe()
df.query("location == 'Nigeria'")<jupyter_output><empty_output><jupyter_text>Plotting graphs with Plotly  Using Plotly ExpressDocumentation: https://plotly.com/python/plotly-express/<jupyter_code>fig_px = px.line(df.query("location == 'Nigeria'"), x='date', y="total_cases")
fig_px.show()<jupyter_output><empty_output><jupyter_text>Creating multiple plots in one graph with Plotly Documentation: https://plotly.com/python/<jupyter_code>test_df = df.query("location == 'Nigeria'")
fig =  go.Figure()
fig.add_trace(go.Scatter(x=test_df['date'], y=test_df['new_cases_per_million'], mode='lines', 
                         name='New Cases per million'))

fig.add_trace(go.Scatter(x=test_df['date'], y=test_df['total_deaths_per_million'], mode='lines', 
                         name='Total Deaths per million'))<jupyter_output><empty_output><jupyter_text>Multiple Axes<jupyter_code>fig =  make_subplots(specs=[[{"secondary_y": True}]])
fig.add_trace(go.Scatter(x=test_df['date'], y=test_df['new_cases_per_million'], mode='lines', 
                         name='New Cases per million'), secondary_y=False,)
# fig.update_xaxes(type="log")
fig.add_trace(go.Scatter(x=test_df['date'], y=test_df['total_deaths_per_million'], mode='lines', 
                         name='Total Deaths per million'), secondary_y=True)<jupyter_output><empty_output><jupyter_text>Log Scale Y axes<jupyter_code>fig =  go.Figure()
fig.add_trace(go.Scatter(x=test_df['date'], y=test_df['total_cases'], mode='lines', 
                         name='Total Cases'))

fig.add_trace(go.Scatter(x=test_df['date'], y=test_df['total_deaths'], mode='lines', 
                         name='Total Deaths'))
# fig.update_yaxes(type="log")
fig =  go.Figure()
fig.add_trace(go.Scatter(x=test_df['date'], y=test_df['total_cases'], mode='lines', 
                         name='Total Cases'))

fig.add_trace(go.Scatter(x=test_df['date'], y=test_df['total_deaths'], mode='lines', 
                         name='Total Deaths'))
fig.update_yaxes(type="log")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1338679827267119, 'fraction_numerical': 0.001850709438618137, 'mean_word_length': 5.118867924528302, 'pattern_counts': {'":': 1, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '279821', 'license': 'MIT', 'n_tokens_mistral': 1097, 'n_tokens_neox': 1033, 'n_words': 224, 'path': 'Plotly Dash Tutorial.ipynb', 'repo_name': 'DataJediAcademy/plotly_dash_tutorial', 'size': '3242'}