Daily Profiles#

This example demonstrates how to use plot_daily_profiles_overview and plot_daily_profiles to visualize energy consumption patterns across seasons and weekdays.

plot_daily_profiles supports three methods: "mean", "decomposed", and "overlayed".

The bundled ele_meter.csv dataset contains electricity consumption values at 15-minute intervals.

All plots are interactive — hover, zoom, and pan to explore the data.

Hide code cell source

# Configure Plotly to render as HTML (required for Jupyter Book)
import plotly.io as pio
pio.renderers.default = "notebook_connected"
import pandas as pd
from importlib import resources

# Load the bundled sample data
data_path = resources.files("pyedautils") / "data" / "ele_meter.csv"
df = pd.read_csv(data_path, sep=";")
df.head()
timestamp value
0 2015-01-01 00:00:00 40.0
1 2015-01-01 00:15:00 32.0
2 2015-01-01 00:30:00 32.0
3 2015-01-01 00:45:00 34.0
4 2015-01-01 01:00:00 34.0
from pyedautils.plots import plot_daily_profiles_overview

fig = plot_daily_profiles_overview(
    data=df,
    title="Electricity Meter - Daily Profiles",
    ylab="Energy [kWh]",
    confidence=95.0,
)
fig.show()

Customization#

You can customize colors, confidence level, season labels, and weekday labels:

fig = plot_daily_profiles_overview(
    data=df,
    title="Custom Colors Example",
    ylab="Energy [kWh]",
    confidence=90.0,
    colors={"median": "red", "bounds": "orange", "fill": "rgba(255,165,0,0.2)"},
)
fig.show()

Mean Daily Profiles#

plot_daily_profiles with method="mean" shows the simple average consumption per weekday and time-of-day.

from pyedautils.plots import plot_daily_profiles

fig = plot_daily_profiles(
    data=df,
    method="mean",
    loc_time_zone="Europe/Zurich",
    title="Electricity - Mean Daily Profiles",
    ylab="Energy Consumption (Wh/15min)",
)
fig.show()

Decomposed Daily Profiles#

plot_daily_profiles with method="decomposed" detrends the time series with a rolling mean, extracts the seasonal component, and normalises each weekday to start at 0 at midnight.

fig = plot_daily_profiles(
    data=df,
    method="decomposed",
    loc_time_zone="Europe/Zurich",
    title="Electricity - Decomposed Weekly Pattern",
    ylab="delta Energy Consumption (Wh/15min)",
)
fig.show()

Overlayed Daily Profiles#

plot_daily_profiles with method="overlayed" shows all individual daily profiles overlaid in blue. Hovering highlights the entire day-line in orange.

This method returns an HTML string (like plot_mollier_hx). Use IPython.display.HTML() to render it in a notebook.

from IPython.display import HTML

html = plot_daily_profiles(
    data=df,
    method="overlayed",
    title="Electricity - Overlayed Daily Profiles",
    ylab="Energy Consumption (Wh/15min)",
)
HTML(html)