Overlaid Profiles#
Goal
Overlay all individual daily electricity consumption profiles. Hovering highlights the entire day-line in orange for comparison.
Data Basis
Electricity data (ele_meter.csv) bundled with the pyedautils package: the mean electric power of a household in W per 15-minute interval (the 15-minute consumption in Wh × 4), for 2015.
Data Preparation#
import pandas as pd
from importlib import resources
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 |
Visualization#
Note: The method="overlayed" option returns an HTML string instead of a Plotly Figure.
from pyedautils.plots import plot_daily_profiles
from IPython.display import HTML
html = plot_daily_profiles(
data=df,
method="overlayed",
title="Electricity - Overlaid Daily Profiles",
ylab="Power [W]",
)
HTML(html)