Density Plot by Season#
A kernel density estimate of a measured value (e.g. room temperature), split by season. This reveals how the distribution shifts between seasons.
The plot is interactive — hover to see exact values.
import plotly.io as pio
pio.renderers.default = "notebook_connected"
import pandas as pd
from importlib import resources
data_path = resources.files("pyedautils") / "data" / "flat_temp.csv"
df = pd.read_csv(data_path, sep=";")
df.head()
| timestamp | value | |
|---|---|---|
| 0 | 2018-10-03 00:00:00 | 24.43 |
| 1 | 2018-10-03 01:00:00 | 24.40 |
| 2 | 2018-10-03 02:00:00 | 24.40 |
| 3 | 2018-10-03 03:00:00 | 24.40 |
| 4 | 2018-10-03 04:00:00 | 24.40 |
from pyedautils.plots import plot_density_seasons
fig = plot_density_seasons(
data=df,
title="Room Temperature Density by Season",
xlab="Temperature (°C)",
)
fig.show()