<jupyter_start><jupyter_text>Points  Row 1  Scatter Chart<jupyter_code>import datetime

import numpy as np
import pandas as pd
import pandas_datareader.data as web

import plotly.express as px
import plotly.graph_objects as go

np.random.seed(42)
margin = go.layout.Margin(l=20, r=20, b=20, t=30)
from scipy.stats import norm
cls = np.repeat(["A", "B"], 10)
x = np.arange(0, 20) + norm.rvs(20, 3, size=20)
y = np.arange(0, 20) + norm.rvs(20, 3, size=20)
df = pd.DataFrame({"cls": cls, "x": x, "y": y})
fig = px.scatter(df, x="x", y="y")

fig.update_layout(margin=margin)
fig<jupyter_output><empty_output><jupyter_text>Linear Regression<jupyter_code>fig = px.scatter(df, x="x", y="y", trendline="ols")

fig.update_layout(margin=margin)
fig<jupyter_output><empty_output><jupyter_text>Row 2  Lowess Smoothed Fit<jupyter_code>fig = px.scatter(df, x="x", y="y", trendline="lowess")

fig.update_layout(margin=margin)
fig<jupyter_output><empty_output><jupyter_text>By class<jupyter_code>fig = px.scatter(df, x="x", y="y", color="cls", trendline="ols")

fig.update_layout(margin=margin)
fig<jupyter_output><empty_output><jupyter_text>Density  Row 1  Gamma density<jupyter_code>import scipy.special as sc
import plotly.figure_factory as ff
df = pd.DataFrame({
    "nu075": np.random.gamma(1, 0.75, size=100),
    "nu1": np.random.gamma(1, 1, size=100),
    "nu2": np.random.gamma(1, 2, size=100),
})
fig = ff.create_distplot([df[c] for c in df.columns], df.columns, show_hist=False)

fig.update_layout(margin=margin)
fig<jupyter_output><empty_output><jupyter_text>Iris density<jupyter_code>df = px.data.iris()
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species", marginal_y="rug", marginal_x="histogram")


fig.update_layout(margin=margin)
fig<jupyter_output><empty_output><jupyter_text>Row 2  Iris density countour<jupyter_code>df = px.data.iris()
fig = px.density_contour(df, x="sepal_width", y="sepal_length", color="species", marginal_x="rug", marginal_y="histogram")

fig.update_layout(margin=margin)
fig.show()<jupyter_output><empty_output><jupyter_text>Tips<jupyter_code>df = px.data.tips()
fig = px.histogram(df, x="sex", y="tip", histfunc="avg", color="smoker", barmode="group",
             facet_row="time", facet_col="day", category_orders={"day": ["Thur", "Fri", "Sat", "Sun"],
                                                                "time": ["Lunch", "Dinner"]})

fig.update_layout(margin=margin)
fig.show()<jupyter_output><empty_output><jupyter_text>Time Series  Apple<jupyter_code>start = datetime.datetime(2015, 1, 1)
end = datetime.datetime(2019, 12, 1)
df_1 = web.DataReader("AAPL", "yahoo", start, end).reset_index()
df_2 = web.DataReader("MSFT", "yahoo", start, end).reset_index()
df_3 = web.DataReader("AMZN", "yahoo", start, end).reset_index()
margin = go.layout.Margin(l=20, r=20, b=20, t=30)
fig = go.Figure([go.Scatter(x=df_1['Date'], y=df_1['Close'])])
fig.update_layout(margin=margin)
fig<jupyter_output><empty_output><jupyter_text>Microsoft<jupyter_code>fig = go.Figure([go.Scatter(x=df_2['Date'], y=df_2['Close'])])
fig.update_layout(margin=margin)
fig<jupyter_output><empty_output><jupyter_text>Amazon<jupyter_code>fig = go.Figure([go.Scatter(x=df_3['Date'], y=df_3['Close'])])
fig.update_layout(margin=margin)
fig<jupyter_output><empty_output><jupyter_text>Tabs  Tabs  Tab 1<jupyter_code>cls = np.repeat(["A", "B"], 10)
x = np.arange(0, 20) + norm.rvs(20, 3, size=20)
y = np.arange(0, 20) + norm.rvs(20, 3, size=20)
df = pd.DataFrame({"cls": cls, "x": x, "y": y})
fig = px.scatter(df, x="x", y="y")

fig.update_layout(margin=margin)
fig<jupyter_output><empty_output><jupyter_text>Tab 2<jupyter_code>fig = px.scatter(df, x="x", y="y", trendline="ols")

fig.update_layout(margin=margin)
fig<jupyter_output><empty_output><jupyter_text>Tab 3<jupyter_code>fig = px.scatter(df, x="x", y="y", trendline="lowess")

fig.update_layout(margin=margin)
fig<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1827217125382263, 'fraction_numerical': 0.026758409785932722, 'mean_word_length': 7.026584867075664, 'pattern_counts': {'":': 11, '<': 57, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '14', 'dir': 'jupyter-structured-clean-dedup', 'id': '211539', 'license': 'Apache-2.0', 'n_tokens_mistral': 1667, 'n_tokens_neox': 1605, 'n_words': 257, 'path': 'examples/plots/plotly.ipynb', 'repo_name': 'agoose77/jupyter-flex', 'size': '3924'}