%23%20%2F%2F%2F%20script%0A%23%20requires-python%20%3D%20%22%3E%3D3.11%22%0A%23%20dependencies%20%3D%20%5B%0A%23%20%20%20%20%20%22numpy%22%2C%0A%23%20%20%20%20%20%22yohou%5Bplotting%5D%22%2C%0A%23%20%5D%0A%23%20%2F%2F%2F%0A%0Aimport%20marimo%0A%0A__generated_with%20%3D%20%220.23.8%22%0Aapp%20%3D%20marimo.App(width%3D%22medium%22)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20import%20marimo%20as%20mo%0A%0A%20%20%20%20return%20(mo%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20import%20polars%20as%20pl%0A%0A%20%20%20%20from%20yohou.datasets%20import%20(%0A%20%20%20%20%20%20%20%20fetch_dominick%2C%0A%20%20%20%20%20%20%20%20fetch_electricity_demand%2C%0A%20%20%20%20%20%20%20%20fetch_tourism_monthly%2C%0A%20%20%20%20%20%20%20%20fetch_tourism_quarterly%2C%0A%20%20%20%20)%0A%20%20%20%20from%20yohou.plotting%20import%20(%0A%20%20%20%20%20%20%20%20plot_boxplot%2C%0A%20%20%20%20%20%20%20%20plot_distribution%2C%0A%20%20%20%20%20%20%20%20plot_missing_data%2C%0A%20%20%20%20%20%20%20%20plot_outliers%2C%0A%20%20%20%20%20%20%20%20plot_resampling_comparison%2C%0A%20%20%20%20%20%20%20%20plot_rolling_statistics%2C%0A%20%20%20%20%20%20%20%20plot_seasonality%2C%0A%20%20%20%20%20%20%20%20plot_subseasonality%2C%0A%20%20%20%20%20%20%20%20plot_time_series%2C%0A%20%20%20%20)%0A%0A%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20fetch_dominick%2C%0A%20%20%20%20%20%20%20%20fetch_electricity_demand%2C%0A%20%20%20%20%20%20%20%20fetch_tourism_monthly%2C%0A%20%20%20%20%20%20%20%20fetch_tourism_quarterly%2C%0A%20%20%20%20%20%20%20%20pl%2C%0A%20%20%20%20%20%20%20%20plot_boxplot%2C%0A%20%20%20%20%20%20%20%20plot_distribution%2C%0A%20%20%20%20%20%20%20%20plot_missing_data%2C%0A%20%20%20%20%20%20%20%20plot_outliers%2C%0A%20%20%20%20%20%20%20%20plot_resampling_comparison%2C%0A%20%20%20%20%20%20%20%20plot_rolling_statistics%2C%0A%20%20%20%20%20%20%20%20plot_seasonality%2C%0A%20%20%20%20%20%20%20%20plot_subseasonality%2C%0A%20%20%20%20%20%20%20%20plot_time_series%2C%0A%20%20%20%20)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%20Exploratory%20Time%20Series%20Visualization%0A%0A%20%20%20%20In%20this%20notebook%20we%20will%20walk%20through%20Yohou's%20exploratory%20plotting%0A%20%20%20%20functions%3A%20raw%20time%20series%2C%20rolling%20statistics%20overlays%2C%20boxplot%0A%20%20%20%20distributions%2C%20missing%20data%20auditing%2C%20outlier%20detection%2C%20and%0A%20%20%20%20resampling%20comparison%2C%20applied%20to%20univariate%2C%20multivariate%2C%20and%0A%20%20%20%20panel%20datasets.%0A%0A%20%20%20%20%23%23%20Prerequisites%0A%0A%20%20%20%20This%20is%20a%20standalone%20exploration%20tutorial.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Load%20Datasets%0A%0A%20%20%20%20We%20load%20four%20datasets%20using%20%5B%60fetch_tourism_monthly%60%5D(%2Fpages%2Fapi%2Fgenerated%2Fyohou.datasets._fetchers.fetch_tourism_monthly%2F)%2C%20%5B%60fetch_tourism_quarterly%60%5D(%2Fpages%2Fapi%2Fgenerated%2Fyohou.datasets._fetchers.fetch_tourism_quarterly%2F)%2C%0A%20%20%20%20%5B%60fetch_dominick%60%5D(%2Fpages%2Fapi%2Fgenerated%2Fyohou.datasets._fetchers.fetch_dominick%2F)%2C%20and%20%5B%60fetch_electricity_demand%60%5D(%2Fpages%2Fapi%2Fgenerated%2Fyohou.datasets._fetchers.fetch_electricity_demand%2F).%20Each%20dataset%20is%20trimmed%20or%0A%20%20%20%20renamed%20to%20produce%20clean%20univariate%2C%20multivariate%2C%20and%20panel%20DataFrames%20for%0A%20%20%20%20the%20plotting%20examples%20that%20follow.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(%0A%20%20%20%20fetch_dominick%2C%0A%20%20%20%20fetch_electricity_demand%2C%0A%20%20%20%20fetch_tourism_monthly%2C%0A%20%20%20%20fetch_tourism_quarterly%2C%0A)%3A%0A%20%20%20%20tourism_monthly%20%3D%20(%0A%20%20%20%20%20%20%20%20fetch_tourism_monthly().frame.select(%22time%22%2C%20%22T1__tourists%22).drop_nulls().rename(%7B%22T1__tourists%22%3A%20%22tourists%22%7D)%0A%20%20%20%20)%0A%20%20%20%20vic%20%3D%20fetch_electricity_demand().frame.head(3000)%0A%20%20%20%20tourism_quarterly%20%3D%20fetch_tourism_quarterly().frame%0A%20%20%20%20_dom_full%20%3D%20fetch_dominick().frame%0A%20%20%20%20_profit_cols%20%3D%20%5Bc%20for%20c%20in%20_dom_full.columns%20if%20c.endswith(%22__profit%22)%5D%5B%3A6%5D%0A%20%20%20%20store%20%3D%20_dom_full.select(%22time%22%2C%20*_profit_cols)%0A%20%20%20%20return%20store%2C%20tourism_monthly%2C%20tourism_quarterly%2C%20vic%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%201.%20Raw%20Time%20Series%0A%0A%20%20%20%20%5B%60plot_time_series%60%5D(%2Fpages%2Fapi%2Fgenerated%2Fyohou.plotting.exploration.plot_time_series%2F)%20renders%20one%20or%20more%20numeric%20columns%20against%20the%20%60%22time%22%60%20axis.%0A%20%20%20%20Varying%20**columns**%2C%20**groups**%2C%20and%20styling%20parameters%20shows%20how%20the%20same%0A%20%20%20%20function%20adapts%20to%20different%20data%20shapes.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_time_series%2C%20tourism_monthly)%3A%0A%20%20%20%20plot_time_series(tourism_monthly%2C%20title%3D%22Monthly%20Tourism%20-%20Single%20Column%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_time_series%2C%20vic)%3A%0A%20%20%20%20plot_time_series(%0A%20%20%20%20%20%20%20%20vic%2C%0A%20%20%20%20%20%20%20%20columns%3D%5B%22vic__demand%22%2C%20%22nsw__demand%22%5D%2C%0A%20%20%20%20%20%20%20%20title%3D%22Electricity%20Demand%20-%20Multi-Column%20Overlay%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_time_series%2C%20tourism_quarterly)%3A%0A%20%20%20%20plot_time_series(%0A%20%20%20%20%20%20%20%20tourism_quarterly%2C%0A%20%20%20%20%20%20%20%20groups%3D%5B%22T1%22%2C%20%22T2%22%5D%2C%0A%20%20%20%20%20%20%20%20title%3D%22Tourism%20Quarterly%20-%20Panel%20Faceting%20(T1%20%26%20T2)%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_time_series%2C%20tourism_monthly)%3A%0A%20%20%20%20plot_time_series(%0A%20%20%20%20%20%20%20%20tourism_monthly%2C%0A%20%20%20%20%20%20%20%20line_dash%3D%22dash%22%2C%0A%20%20%20%20%20%20%20%20color_palette%3D%5B%22%23DC2626%22%5D%2C%0A%20%20%20%20%20%20%20%20title%3D%22Monthly%20Tourism%20-%20Dashed%20Red%20Line%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%202.%20Rolling%20Statistics%0A%0A%20%20%20%20%5B%60plot_rolling_statistics%60%5D(%2Fpages%2Fapi%2Fgenerated%2Fyohou.plotting.exploration.plot_rolling_statistics%2F)%20computes%20windowed%20statistics%20over%20a%20time%20series.%0A%20%20%20%20Key%20parameters%20include%20**window_size**%2C%20**statistics**%20(single%20string%20or%20list)%2C%0A%20%20%20%20and%20**show_original**.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_rolling_statistics%2C%20tourism_monthly)%3A%0A%20%20%20%20plot_rolling_statistics(%0A%20%20%20%20%20%20%20%20tourism_monthly%2C%0A%20%20%20%20%20%20%20%20window_size%3D12%2C%0A%20%20%20%20%20%20%20%20statistics%3D%22mean%22%2C%0A%20%20%20%20%20%20%20%20title%3D%2212-Month%20Rolling%20Mean%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_rolling_statistics%2C%20tourism_monthly)%3A%0A%20%20%20%20plot_rolling_statistics(%0A%20%20%20%20%20%20%20%20tourism_monthly%2C%0A%20%20%20%20%20%20%20%20window_size%3D12%2C%0A%20%20%20%20%20%20%20%20statistics%3D%5B%22mean%22%2C%20%22std%22%5D%2C%0A%20%20%20%20%20%20%20%20title%3D%2212-Month%20Rolling%20Mean%20and%20Standard%20Deviation%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_rolling_statistics%2C%20tourism_monthly)%3A%0A%20%20%20%20plot_rolling_statistics(%0A%20%20%20%20%20%20%20%20tourism_monthly%2C%0A%20%20%20%20%20%20%20%20window_size%3D12%2C%0A%20%20%20%20%20%20%20%20statistics%3D%5B%22min%22%2C%20%22max%22%2C%20%22mean%22%5D%2C%0A%20%20%20%20%20%20%20%20title%3D%2212-Month%20Min%2FMax%20Envelope%20with%20Mean%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_rolling_statistics%2C%20vic)%3A%0A%20%20%20%20plot_rolling_statistics(%0A%20%20%20%20%20%20%20%20vic%2C%0A%20%20%20%20%20%20%20%20columns%3D%22vic__demand%22%2C%0A%20%20%20%20%20%20%20%20window_size%3D48%2C%0A%20%20%20%20%20%20%20%20statistics%3D%22mean%22%2C%0A%20%20%20%20%20%20%20%20show_original%3DFalse%2C%0A%20%20%20%20%20%20%20%20title%3D%2248-Step%20Rolling%20Mean%20on%20Vic%20Demand%20(Smoothed%20Only)%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%203.%20Seasonal%20Overlay%0A%0A%20%20%20%20%5B%60plot_seasonality%60%5D(%2Fpages%2Fapi%2Fgenerated%2Fyohou.plotting.diagnostics.plot_seasonality%2F)%20overlays%20one%20line%20per%20cycle%20(e.g.%20one%20line%20per%20year)%20on%20the%0A%20%20%20%20same%20seasonal%20axis.%20This%20makes%20it%20easy%20to%20compare%20how%20the%20same%20season%0A%20%20%20%20changes%20across%20cycles.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_seasonality%2C%20tourism_monthly)%3A%0A%20%20%20%20plot_seasonality(%0A%20%20%20%20%20%20%20%20tourism_monthly%2C%0A%20%20%20%20%20%20%20%20seasonality%3D%22month%22%2C%0A%20%20%20%20%20%20%20%20title%3D%22Monthly%20Seasonal%20Overlay%20(Tourism)%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_seasonality%2C%20tourism_monthly)%3A%0A%20%20%20%20plot_seasonality(%0A%20%20%20%20%20%20%20%20tourism_monthly%2C%0A%20%20%20%20%20%20%20%20seasonality%3D%22quarter%22%2C%0A%20%20%20%20%20%20%20%20title%3D%22Quarterly%20Seasonal%20Overlay%20(Tourism)%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_seasonality%2C%20tourism_quarterly)%3A%0A%20%20%20%20plot_seasonality(%0A%20%20%20%20%20%20%20%20tourism_quarterly%2C%0A%20%20%20%20%20%20%20%20seasonality%3D%22month%22%2C%0A%20%20%20%20%20%20%20%20groups%3D%5B%22T1%22%2C%20%22T2%22%5D%2C%0A%20%20%20%20%20%20%20%20title%3D%22Seasonal%20Overlay%20-%20Panel%20(T1%20%26%20T2)%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%204.%20Seasonal%20Subseries%0A%0A%20%20%20%20%5B%60plot_subseasonality%60%5D(%2Fpages%2Fapi%2Fgenerated%2Fyohou.plotting.diagnostics.plot_subseasonality%2F)%20creates%20one%20mini%20subplot%20per%20season%20(e.g.%2012%20for%0A%20%20%20%20months).%20Within%20each%20subplot%20the%20values%20for%20that%20season%20across%20all%20cycles%0A%20%20%20%20are%20connected%20chronologically%2C%20with%20an%20optional%20horizontal%20mean%20line.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_subseasonality%2C%20tourism_monthly)%3A%0A%20%20%20%20plot_subseasonality(%0A%20%20%20%20%20%20%20%20tourism_monthly%2C%0A%20%20%20%20%20%20%20%20seasonality%3D%22month%22%2C%0A%20%20%20%20%20%20%20%20kind%3D%22mean%22%2C%0A%20%20%20%20%20%20%20%20title%3D%22Monthly%20Subseries%20with%20Mean%20(Tourism)%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_subseasonality%2C%20tourism_monthly)%3A%0A%20%20%20%20plot_subseasonality(%0A%20%20%20%20%20%20%20%20tourism_monthly%2C%0A%20%20%20%20%20%20%20%20seasonality%3D%22month%22%2C%0A%20%20%20%20%20%20%20%20kind%3D%22box%22%2C%0A%20%20%20%20%20%20%20%20title%3D%22Monthly%20Subseries%20-%20Box%20(Tourism)%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_subseasonality%2C%20tourism_monthly)%3A%0A%20%20%20%20plot_subseasonality(%0A%20%20%20%20%20%20%20%20tourism_monthly%2C%0A%20%20%20%20%20%20%20%20seasonality%3D%22quarter%22%2C%0A%20%20%20%20%20%20%20%20kind%3D%22violin%22%2C%0A%20%20%20%20%20%20%20%20title%3D%22Quarterly%20Subseries%20-%20Violin%20(Tourism)%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%205.%20Distribution%20by%20Period%0A%0A%20%20%20%20%5B%60plot_boxplot%60%5D(%2Fpages%2Fapi%2Fgenerated%2Fyohou.plotting.exploration.plot_boxplot%2F)%20groups%20values%20by%20a%20time%20**period**%20and%20shows%20the%20distribution%0A%20%20%20%20within%20each%20group.%20Vary%20the%20period%2C%20toggle%20**show_points**%2C%20or%20pass%0A%20%20%20%20**groups**%20for%20panel%20data.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_boxplot%2C%20tourism_monthly)%3A%0A%20%20%20%20plot_boxplot(tourism_monthly%2C%20period%3D%221y%22%2C%20title%3D%22Monthly%20Boxplot%20(Monthly%20Tourism)%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_boxplot%2C%20tourism_monthly)%3A%0A%20%20%20%20plot_boxplot(tourism_monthly%2C%20period%3D%221q%22%2C%20title%3D%22Quarterly%20Boxplot%20(Monthly%20Tourism)%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_boxplot%2C%20tourism_monthly)%3A%0A%20%20%20%20plot_boxplot(%0A%20%20%20%20%20%20%20%20tourism_monthly%2C%0A%20%20%20%20%20%20%20%20period%3D%221y%22%2C%0A%20%20%20%20%20%20%20%20show_points%3D%22all%22%2C%0A%20%20%20%20%20%20%20%20title%3D%22Monthly%20Boxplot%20-%20All%20Points%20Shown%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_boxplot%2C%20tourism_quarterly)%3A%0A%20%20%20%20plot_boxplot(%0A%20%20%20%20%20%20%20%20tourism_quarterly%2C%0A%20%20%20%20%20%20%20%20period%3D%221y%22%2C%0A%20%20%20%20%20%20%20%20groups%3D%5B%22T1%22%2C%20%22T2%22%5D%2C%0A%20%20%20%20%20%20%20%20title%3D%22Yearly%20Boxplot%20-%20Tourism%20Quarterly%20Panel%20(T1%20%26%20T2)%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%206.%20Missing%20Data%20Audit%0A%0A%20%20%20%20%5B%60plot_missing_data%60%5D(%2Fpages%2Fapi%2Fgenerated%2Fyohou.plotting.exploration.plot_missing_data%2F)%20visualises%20null%20patterns%20using%20three%20**kind**%20options%3A%0A%20%20%20%20%60%22heatmap%22%60%2C%20%60%22bars%22%60%2C%20and%20%60%22matrix%22%60.%20Additional%20parameters%20like%0A%20%20%20%20**time_aggregation**%20and%20custom%20colors%20provide%20further%20control.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(pl%2C%20store)%3A%0A%20%20%20%20import%20numpy%20as%20np%0A%0A%20%20%20%20_rng%20%3D%20np.random.default_rng(42)%0A%20%20%20%20_cols%20%3D%20%5Bc%20for%20c%20in%20store.columns%20if%20c%20!%3D%20%22time%22%5D%0A%20%20%20%20_mask%20%3D%20%7Bc%3A%20%5BNone%20if%20_rng.random()%20%3C%200.05%20else%20v%20for%20v%20in%20store%5Bc%5D.to_list()%5D%20for%20c%20in%20_cols%7D%0A%20%20%20%20store_nan%20%3D%20store.select(%22time%22).with_columns(%5Bpl.Series(c%2C%20vals)%20for%20c%2C%20vals%20in%20_mask.items()%5D)%0A%20%20%20%20return%20(store_nan%2C)%0A%0A%0A%40app.cell%0Adef%20_(plot_missing_data%2C%20store_nan)%3A%0A%20%20%20%20plot_missing_data(store_nan%2C%20kind%3D%22heatmap%22%2C%20title%3D%22Missing%20Data%20-%20Heatmap%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_missing_data%2C%20store_nan)%3A%0A%20%20%20%20plot_missing_data(store_nan%2C%20kind%3D%22bars%22%2C%20title%3D%22Missing%20Data%20-%20Bar%20Chart%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_missing_data%2C%20store_nan)%3A%0A%20%20%20%20plot_missing_data(store_nan%2C%20kind%3D%22matrix%22%2C%20title%3D%22Missing%20Data%20-%20Matrix%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_missing_data%2C%20store_nan)%3A%0A%20%20%20%20plot_missing_data(%0A%20%20%20%20%20%20%20%20store_nan%2C%0A%20%20%20%20%20%20%20%20kind%3D%22heatmap%22%2C%0A%20%20%20%20%20%20%20%20time_aggregation%3D%221mo%22%2C%0A%20%20%20%20%20%20%20%20color_missing%3D%22%23000000%22%2C%0A%20%20%20%20%20%20%20%20color_present%3D%22%2322c55e%22%2C%0A%20%20%20%20%20%20%20%20title%3D%22Missing%20Data%20-%20Monthly%20Aggregation%2C%20Custom%20Colors%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%207.%20Value%20Distribution%0A%0A%20%20%20%20%5B%60plot_distribution%60%5D(%2Fpages%2Fapi%2Fgenerated%2Fyohou.plotting.exploration.plot_distribution%2F)%20renders%20histograms%20with%20an%20optional%20KDE%20overlay.%0A%20%20%20%20Toggle%20**show_kde**%2C%20control%20**n_bins**%2C%20and%20adjust%20**bar_opacity**%20for%20fine-grained%20styling.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_distribution%2C%20tourism_monthly)%3A%0A%20%20%20%20plot_distribution(%0A%20%20%20%20%20%20%20%20tourism_monthly%2C%0A%20%20%20%20%20%20%20%20n_bins%3D30%2C%0A%20%20%20%20%20%20%20%20title%3D%22Tourism%20Distribution%20-%20Histogram%20with%20KDE%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_distribution%2C%20tourism_monthly)%3A%0A%20%20%20%20plot_distribution(%0A%20%20%20%20%20%20%20%20tourism_monthly%2C%0A%20%20%20%20%20%20%20%20show_kde%3DFalse%2C%0A%20%20%20%20%20%20%20%20n_bins%3D20%2C%0A%20%20%20%20%20%20%20%20title%3D%22Tourism%20Distribution%20-%20Histogram%20Only%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_distribution%2C%20vic)%3A%0A%20%20%20%20plot_distribution(%0A%20%20%20%20%20%20%20%20vic%2C%0A%20%20%20%20%20%20%20%20columns%3D%5B%22vic__demand%22%2C%20%22nsw__demand%22%5D%2C%0A%20%20%20%20%20%20%20%20n_bins%3D40%2C%0A%20%20%20%20%20%20%20%20bar_opacity%3D0.4%2C%0A%20%20%20%20%20%20%20%20title%3D%22Demand%20Distribution%20-%20Multi-Column%20Overlay%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%208.%20Outlier%20Detection%0A%0A%20%20%20%20%5B%60plot_outliers%60%5D(%2Fpages%2Fapi%2Fgenerated%2Fyohou.plotting.exploration.plot_outliers%2F)%20overlays%20outlier%20markers%20on%20the%20time%20series%20line.%0A%20%20%20%20Choose%20between%20%60%22zscore%22%60%2C%20%60%22iqr%22%60%2C%20and%20%60%22percentile%22%60%20detection%20methods%0A%20%20%20%20and%20customize%20the%20threshold%2C%20marker%20color%2C%20and%20size.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_outliers%2C%20tourism_monthly)%3A%0A%20%20%20%20plot_outliers(%0A%20%20%20%20%20%20%20%20tourism_monthly%2C%0A%20%20%20%20%20%20%20%20method%3D%22zscore%22%2C%0A%20%20%20%20%20%20%20%20threshold%3D2.0%2C%0A%20%20%20%20%20%20%20%20title%3D%22Outlier%20Detection%20-%20Z-Score%20(threshold%3D2)%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_outliers%2C%20tourism_monthly)%3A%0A%20%20%20%20plot_outliers(%0A%20%20%20%20%20%20%20%20tourism_monthly%2C%0A%20%20%20%20%20%20%20%20method%3D%22iqr%22%2C%0A%20%20%20%20%20%20%20%20title%3D%22Outlier%20Detection%20-%20IQR%20Method%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_outliers%2C%20tourism_monthly)%3A%0A%20%20%20%20plot_outliers(%0A%20%20%20%20%20%20%20%20tourism_monthly%2C%0A%20%20%20%20%20%20%20%20method%3D%22zscore%22%2C%0A%20%20%20%20%20%20%20%20show_bounds%3DFalse%2C%0A%20%20%20%20%20%20%20%20outlier_color%3D%22%23059669%22%2C%0A%20%20%20%20%20%20%20%20outlier_size%3D10.0%2C%0A%20%20%20%20%20%20%20%20title%3D%22Outlier%20Detection%20-%20Custom%20Markers%2C%20No%20Bounds%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%209.%20Resampling%20Comparison%0A%0A%20%20%20%20%5B%60plot_resampling_comparison%60%5D(%2Fpages%2Fapi%2Fgenerated%2Fyohou.plotting.exploration.plot_resampling_comparison%2F)%20overlays%20an%20original%20and%20resampled%20series%0A%20%20%20%20to%20assess%20information%20loss%20from%20temporal%20aggregation.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(pl%2C%20tourism_monthly)%3A%0A%20%20%20%20tourism_resampled%20%3D%20tourism_monthly.group_by_dynamic(%22time%22%2C%20every%3D%221q%22).agg(%0A%20%20%20%20%20%20%20%20pl.col(%22tourists%22).mean()%2C%0A%20%20%20%20)%0A%20%20%20%20return%20(tourism_resampled%2C)%0A%0A%0A%40app.cell%0Adef%20_(plot_resampling_comparison%2C%20tourism_monthly%2C%20tourism_resampled)%3A%0A%20%20%20%20plot_resampling_comparison(%0A%20%20%20%20%20%20%20%20tourism_monthly%2C%0A%20%20%20%20%20%20%20%20tourism_resampled%2C%0A%20%20%20%20%20%20%20%20title%3D%22Monthly%20vs%20Quarterly%20Mean%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(plot_resampling_comparison%2C%20tourism_monthly%2C%20tourism_resampled)%3A%0A%20%20%20%20plot_resampling_comparison(%0A%20%20%20%20%20%20%20%20tourism_monthly%2C%0A%20%20%20%20%20%20%20%20tourism_resampled%2C%0A%20%20%20%20%20%20%20%20original_label%3D%22Monthly%22%2C%0A%20%20%20%20%20%20%20%20resampled_label%3D%22Quarterly%20Avg%22%2C%0A%20%20%20%20%20%20%20%20resampled_line_dash%3D%22dash%22%2C%0A%20%20%20%20%20%20%20%20title%3D%22Resampling%20Comparison%20-%20Custom%20Labels%20and%20Dash%22%2C%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Next%20Steps%0A%0A%20%20%20%20-%20%5BExploratory%20Visualization%5D(%2Fpages%2Ftutorials%2Fexploratory-visualization%2F)%20for%20the%20full%20guide%0A%20%20%20%20-%20%5BVisualize%20Forecasts%5D(%2Fpages%2Fhow-to%2Fvisualize-forecasts%2F)%20for%20related%20techniques%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
856e67f8884619b2af10ffd3d06353b0