twoHelixestwoHelixes Start free

Datasets / Energy readings

Daily energy against average temperature

Correlation is a question about two measures, so both go on axes and neither goes on time - the days become the points.

Question is consumption correlated with temperature?
Energy use against temperature010k20k30k40k11.85833333333333411.40416666666666710.14166666666666710.462511.129166666666668Temperature CPlant CPlant APlant B
Energy readings — 273 rows charted from 6,483, drawn as a scatter
How it decided
Finding the data85 ms

Energy readings: 6,483 rows, 4 columns. temperature_c and kwh per day, split by site.

Shaping the data48 ms

6,483 rows in, 273 out across 4 columns. Correlation is a question about two measures, so both go on axes and neither goes on time - the days become the points.

Choosing the chart16 ms

scatter. Two measures and no time axis is a scatter. Three sites is the cap for a scatter here, because adjacent points must stay separable for a colour-blind reader.

Applying defaults1 ms

Palette, spacing, axis titles and legend placement applied. 0 issues found.

The transformation

This is the code, not a description of it — the chart above was drawn from what it returns, and the notebook download runs the same lines against the same file.

df["day"] = df["reading_at"].astype("datetime64[ns]").dt.floor("D")
result = df.groupby(["day", "site"], as_index=False).agg(
    kwh=("kwh", "sum"), temperature_c=("temperature_c", "mean")
)

What it charted

273 rows out of 6,483, 4 columns. First 8 shown.

daysitekwhtemperature_c
2025-01-01Plant A24167.8110.1417
2025-01-01Plant B13349.3310.075
2025-01-01Plant C36078.1211.8583
2025-01-02Plant A24128.1911.025
2025-01-02Plant B13627.3810.8667
2025-01-02Plant C36976.8910.0083
2025-01-03Plant A24382.1710.9208
2025-01-03Plant B13572.7911.0917