Scratch – repr & visualisation testing
Temporary notebook for testing _repr_html_ / __repr__ across all classes and visualisation helpers like coverage_bar() and tree().
Delete when done.
[1]:
import sys
if "google.colab" in sys.modules:
%pip install -q git+https://github.com/rebase-energy/TimeDataModel.git
[2]:
from datetime import datetime, timezone
import numpy as np
from timedatamodel import (
AggregationMethod,
CoverageBar,
DataType,
Dimension,
Frequency,
GeoLocation,
HierarchicalTimeSeries,
HierarchyNode,
TimeSeriesList,
TimeSeriesArray,
TimeSeriesCollection,
TimeSeriesTable,
TimeSeriesType,
get_theme,
set_theme,
reset_theme,
)
Theme colors
All repr and visualisation functions read from a shared theme (theme.json). Use get_theme() to inspect the current colors and set_theme() to override them. Changes take effect on the next repr call. Call reset_theme() to restore defaults.
[3]:
# Override colors here — uncomment and edit any line to experiment.
# Changes apply to all reprs rendered after this cell.
set_theme({
"light": {
"header_bg": "#f0f0f0",
"header_text": "#1a1a1a",
"header_border": "#4a4a4a",
"meta_bg": "#fafafa",
"meta_label": "#475569",
"meta_value": "#1a1a1a",
"col_header_text": "#555",
"col_header_border": "#ccc",
"data_text": "#1a1a1a",
"index_text": "#1e293b",
"hover_bg": "#f5f5f5",
"ellipsis": "#999",
"coverage_present": "#4CAF50",
"coverage_absent": "#e0e0e0",
"coverage_label": "#333",
"coverage_date": "#666",
},
"dark": {
"header_bg": "#1e293b",
"header_text": "#e2e8f0",
"header_border": "#475569",
"meta_bg": "#0f172a",
"meta_label": "#94a3b8",
"meta_value": "#e2e8f0",
"col_header_text": "#94a3b8",
"col_header_border": "#334155",
"data_text": "#e2e8f0",
"index_text": "#cbd5e1",
"hover_bg": "#1e293b",
"ellipsis": "#64748b",
},
})
# To restore defaults at any point:
# reset_theme()
Helper – generate hourly timestamps
[4]:
def hourly_ts(n=24, start="2024-01-15"):
base = datetime.fromisoformat(f"{start}T00:00:00+00:00")
from datetime import timedelta
return [base + timedelta(hours=i) for i in range(n)]
1. TimeSeriesList
[5]:
ts = TimeSeriesList(
Frequency.PT1H,
timezone="UTC",
timestamps=hourly_ts(24),
values=[120 + 5 * np.sin(i) for i in range(24)],
name="power",
unit="MW",
data_type=DataType.OBSERVATION,
description="Hourly power output from wind farm Alpha",
)
ts
[5]:
TimeSeriesList
| timestamp | power |
|---|---|
| 2024-01-15 00:00 | 120.0 |
| 2024-01-15 01:00 | 124.207 |
| 2024-01-15 02:00 | 124.546 |
| … | … |
| 2024-01-15 21:00 | 124.183 |
| 2024-01-15 22:00 | 119.956 |
| 2024-01-15 23:00 | 115.769 |
[6]:
print(ts)
TimeSeriesList
┌──────────────────────────────────────────────────────────────┐
│ Name: power │
│ Length: 24 │
│ Frequency: PT1H │
│ Timezone: UTC (+00:00) │
│ Unit: MW │
│ Data type: OBSERVATION │
│ Description: Hourly power output from wind farm Alpha │
├──────────────────────────────────────────────────────────────┤
│ 2024-01-15 00:00 120.0 │
│ 2024-01-15 01:00 124.207 │
│ 2024-01-15 02:00 124.546 │
│ ... ... │
│ 2024-01-15 21:00 124.183 │
│ 2024-01-15 22:00 119.956 │
│ 2024-01-15 23:00 115.769 │
└──────────────────────────────────────────────────────────────┘
TimeSeriesList – empty
[7]:
ts_empty = TimeSeriesList(Frequency.PT1H, timestamps=[], values=[], name="empty")
ts_empty
[7]:
TimeSeriesList
| timestamp | empty |
|---|---|
| (empty) | |
TimeSeriesList – with NaN gaps
[8]:
vals_gap = [float(i) for i in range(24)]
for i in [5, 6, 7, 15, 16]:
vals_gap[i] = None
ts_gap = TimeSeriesList(
Frequency.PT1H,
timestamps=hourly_ts(24),
values=vals_gap,
name="gappy_signal",
unit="kW",
)
ts_gap
[8]:
TimeSeriesList
| timestamp | gappy_signal |
|---|---|
| 2024-01-15 00:00 | 0.0 |
| 2024-01-15 01:00 | 1.0 |
| 2024-01-15 02:00 | 2.0 |
| … | … |
| 2024-01-15 21:00 | 21.0 |
| 2024-01-15 22:00 | 22.0 |
| 2024-01-15 23:00 | 23.0 |
TimeSeriesList – short (no truncation)
[9]:
ts_short = TimeSeriesList(
Frequency.PT1H,
timestamps=hourly_ts(5),
values=[1.0, 2.0, 3.0, 4.0, 5.0],
name="short",
)
ts_short
[9]:
TimeSeriesList
| timestamp | short |
|---|---|
| 2024-01-15 00:00 | 1.0 |
| 2024-01-15 01:00 | 2.0 |
| 2024-01-15 02:00 | 3.0 |
TimeSeriesList – with location and labels
[10]:
ts_loc = TimeSeriesList(
Frequency.PT1H,
timestamps=hourly_ts(24),
values=[100 + i * 0.5 for i in range(24)],
name="temperature",
unit="°C",
location=GeoLocation(latitude=59.91, longitude=10.75),
labels={"source": "met.no", "station": "Oslo-Blindern"},
data_type=DataType.OBSERVATION,
description="Air temperature at Blindern station",
)
ts_loc
[10]:
TimeSeriesList
| timestamp | temperature |
|---|---|
| 2024-01-15 00:00 | 100.0 |
| 2024-01-15 01:00 | 100.5 |
| 2024-01-15 02:00 | 101.0 |
| … | … |
| 2024-01-15 21:00 | 110.5 |
| 2024-01-15 22:00 | 111.0 |
| 2024-01-15 23:00 | 111.5 |
2. TimeSeriesTable
[11]:
timestamps = hourly_ts(24)
tbl = TimeSeriesTable(
Frequency.PT1H,
timezone="UTC",
timestamps=timestamps,
values=np.column_stack([
[120 + 5 * np.sin(i) for i in range(24)],
[80 + 3 * np.cos(i) for i in range(24)],
[200 + 10 * np.sin(i + 1) for i in range(24)],
]),
names=["wind_farm_A", "wind_farm_B", "solar_park_C"],
units=["MW", "MW", "MW"],
data_types=[DataType.OBSERVATION, DataType.OBSERVATION, DataType.FORECAST],
)
tbl
[11]:
TimeSeriesTable
| timestamp | wind_farm_A | wind_farm_B | solar_park_C |
|---|---|---|---|
| 2024-01-15 00:00 | 120.0 | 83.0 | 208.415 |
| 2024-01-15 01:00 | 124.207 | 81.6209 | 209.093 |
| 2024-01-15 02:00 | 124.546 | 78.7516 | 201.411 |
| … | … | … | … |
| 2024-01-15 21:00 | 124.183 | 78.3568 | 199.911 |
| 2024-01-15 22:00 | 119.956 | 77.0001 | 191.538 |
| 2024-01-15 23:00 | 115.769 | 78.4015 | 190.944 |
[12]:
print(tbl)
TimeSeriesTable
┌────────────────────────────────────────────────────────────┐
│ Name: unnamed │
│ Columns: wind_farm_A, wind_farm_B, solar_park_C │
│ Length: 24 × 3 │
│ Frequency: PT1H │
│ Timezone: UTC (+00:00) │
│ Unit: MW, MW, MW │
│ Data type: OBSERVATION, OBSERVATION, FORECAST │
├────────────────────────────────────────────────────────────┤
│ wind_farm_A wind_farm_B solar_park_C │
│ 2024-01-15 00:00 120.0 83.0 208.415 │
│ 2024-01-15 01:00 124.207 81.6209 209.093 │
│ 2024-01-15 02:00 124.546 78.7516 201.411 │
│ ... ... ... ... │
│ 2024-01-15 21:00 124.183 78.3568 199.911 │
│ 2024-01-15 22:00 119.956 77.0001 191.538 │
│ 2024-01-15 23:00 115.769 78.4015 190.944 │
└────────────────────────────────────────────────────────────┘
3. TimeSeriesCollection
[13]:
ts_a = TimeSeriesList(
Frequency.PT1H, timestamps=hourly_ts(24), values=[float(i) for i in range(24)],
name="series_A", unit="MW",
)
ts_b = TimeSeriesList(
Frequency.P1D,
timestamps=[datetime.fromisoformat(f"2024-01-{d:02d}T00:00:00+00:00") for d in range(1, 8)],
values=[100.0, 105.0, 98.0, None, 110.0, 115.0, 108.0],
name="series_B", unit="GWh",
)
coll = TimeSeriesCollection(
[ts_a, ts_b, tbl],
name="My Collection",
description="A mix of different series",
)
coll
[13]:
TimeSeriesCollection
| name | type | freq | tz | length | begin | end |
|---|---|---|---|---|---|---|
| series_A | TimeSeriesList | PT1H | UTC | 24 | 2024-01-15 00:00 | 2024-01-15 23:00 |
| series_B | TimeSeriesList | P1D | UTC | 7 | 2024-01-01 00:00 | 2024-01-07 00:00 |
| wind_farm_A,wind_farm_B,solar_park_C | TimeSeriesTable | PT1H | UTC | 24 | 2024-01-15 00:00 | 2024-01-15 23:00 |
[14]:
print(coll)
TimeSeriesCollection
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ name type freq tz length begin end │
├────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ series_A TimeSeriesList PT1H UTC 24 2024-01-15 00:00 2024-01-15 23:00 │
│ series_B TimeSeriesList P1D UTC 7 2024-01-01 00:00 2024-01-07 00:00 │
│ wind_farm_A,wind_farm_B,solar_park_C TimeSeriesTable PT1H UTC 24 2024-01-15 00:00 2024-01-15 23:00 │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
4. TimeSeriesArray (N-dimensional)
[15]:
time_labels = hourly_ts(12)
scenarios = ["low", "mid", "high"]
arr = TimeSeriesArray(
Frequency.PT1H,
name="price_scenarios",
unit="EUR/MWh",
data_type=DataType.SCENARIO,
dimensions=[
Dimension(name="timestamp", labels=time_labels),
Dimension(name="scenario", labels=scenarios),
],
values=np.random.default_rng(42).uniform(30, 80, size=(12, 3)),
)
arr
[15]:
TimeSeriesArray
| timestamp | low | mid | high |
|---|---|---|---|
| 2024-01-15 00:00 | 68.6978 | 51.9439 | 72.9299 |
| 2024-01-15 01:00 | 64.8684 | 34.7089 | 78.7811 |
| 2024-01-15 02:00 | 68.057 | 69.3032 | 36.4057 |
| … | … | … | … |
| 2024-01-15 09:00 | 32.1902 | 37.7145 | 64.1524 |
| 2024-01-15 10:00 | 67.2381 | 78.3755 | 46.2913 |
| 2024-01-15 11:00 | 48.523 | 53.4778 | 39.4736 |
[16]:
print(arr)
TimeSeriesArray
┌────────────────────────────────────────────────┐
│ Name: price_scenarios │
│ Dimensions: timestamp: 12, scenario: 3 │
│ Shape: (12, 3) │
│ Frequency: PT1H │
│ Timezone: UTC (+00:00) │
│ Unit: EUR/MWh │
│ Data type: SCENARIO │
└────────────────────────────────────────────────┘
TimeSeriesArray – 1D
[17]:
arr_1d = TimeSeriesArray(
Frequency.PT1H,
name="load",
unit="MW",
dimensions=[Dimension(name="timestamp", labels=hourly_ts(8))],
values=np.array([100, 105, 110, 108, 103, 99, 95, 92], dtype=float),
)
arr_1d
[17]:
TimeSeriesArray
| timestamp | load |
|---|---|
| 2024-01-15 00:00:00+00:00 | 100.0 |
| 2024-01-15 01:00:00+00:00 | 105.0 |
| 2024-01-15 02:00:00+00:00 | 110.0 |
| … | … |
| 2024-01-15 05:00:00+00:00 | 99.0 |
| 2024-01-15 06:00:00+00:00 | 95.0 |
| 2024-01-15 07:00:00+00:00 | 92.0 |
5. CoverageBar
[18]:
ts_gap.coverage_bar()
[18]:
[19]:
print(ts_gap.coverage_bar())
gappy_signal █████░░░███████░░███████
2024-01-15 00:00 2024-01-15 23:00
[20]:
tbl.coverage_bar()
[20]:
[21]:
print(tbl.coverage_bar())
wind_farm_A ████████████████████████
wind_farm_B ████████████████████████
solar_park_C ████████████████████████
2024-01-15 00:00 2024-01-15 23:00
6. HierarchicalTimeSeries & tree()
[22]:
timestamps = hourly_ts(24)
rng = np.random.default_rng(0)
def make_ts(name):
return TimeSeriesList(
Frequency.PT1H, timestamps=timestamps,
values=rng.uniform(50, 200, 24).tolist(),
name=name, unit="MW", data_type=DataType.OBSERVATION,
)
tree_dict = {
"total": {
"Norway": {"Bergen": "bergen", "Oslo": "oslo", "Trondheim": "trondheim"},
"Sweden": {"Stockholm": "stockholm", "Gothenburg": "gothenburg"},
}
}
series_map = {
"bergen": make_ts("Bergen"),
"oslo": make_ts("Oslo"),
"trondheim": make_ts("Trondheim"),
"stockholm": make_ts("Stockholm"),
"gothenburg": make_ts("Gothenburg"),
}
hts = HierarchicalTimeSeries.from_dict(
tree_dict, series_map,
levels=["region", "country", "city"],
name="Nordic Wind Power",
description="Hierarchical wind power across Nordic cities",
aggregation=AggregationMethod.SUM,
)
hts
[22]:
HierarchicalTimeSeries
| name | level | length | begin | end |
|---|---|---|---|---|
| Bergen | country | 24 | 2024-01-15 00:00 | 2024-01-15 23:00 |
| Oslo | country | 24 | 2024-01-15 00:00 | 2024-01-15 23:00 |
| Trondheim | country | 24 | 2024-01-15 00:00 | 2024-01-15 23:00 |
| Stockholm | country | 24 | 2024-01-15 00:00 | 2024-01-15 23:00 |
| Gothenburg | country | 24 | 2024-01-15 00:00 | 2024-01-15 23:00 |
[23]:
print(hts)
HierarchicalTimeSeries
┌───────────────────────────────────────────────────────────────────┐
│ Name: Nordic Wind Power │
│ Levels: region, country, city │
│ Nodes: 16 (5 leaves) │
│ Frequency: PT1H │
│ Timezone: UTC (+00:00) │
│ Unit: MW │
│ Aggregation: sum │
├───────────────────────────────────────────────────────────────────┤
│ name level length begin end │
├───────────────────────────────────────────────────────────────────┤
│ Bergen country 24 2024-01-15 00:00 2024-01-15 23:00 │
│ Oslo country 24 2024-01-15 00:00 2024-01-15 23:00 │
│ Trondheim country 24 2024-01-15 00:00 2024-01-15 23:00 │
│ Stockholm country 24 2024-01-15 00:00 2024-01-15 23:00 │
│ Gothenburg country 24 2024-01-15 00:00 2024-01-15 23:00 │
└───────────────────────────────────────────────────────────────────┘
HierarchyTree – HTML
[24]:
hts.tree()
[24]:
total (region)
total (region)
Norway (region)
Norway (region)
Bergen (region)
Bergen [24 pts]
Oslo (region)
Oslo [24 pts]
Trondheim (region)
Trondheim [24 pts]
Sweden (region)
Sweden (region)
Stockholm (region)
Stockholm [24 pts]
Gothenburg (region)
Gothenburg [24 pts]
[25]:
print(hts.tree())
└── total (region)
└── total (region)
├── Norway (region)
│ └── Norway (region)
│ ├── Bergen (region)
│ │ └── Bergen [24 pts]
│ ├── Oslo (region)
│ │ └── Oslo [24 pts]
│ └── Trondheim (region)
│ └── Trondheim [24 pts]
└── Sweden (region)
└── Sweden (region)
├── Stockholm (region)
│ └── Stockholm [24 pts]
└── Gothenburg (region)
└── Gothenburg [24 pts]
7. Wide TimeSeriesTable (many columns)
Test whether the repr truncates columns when there are too many to fit.
[26]:
n_cols = 20
timestamps = hourly_ts(48)
rng = np.random.default_rng(7)
tbl_wide = TimeSeriesTable(
Frequency.PT1H,
timezone="UTC",
timestamps=timestamps,
values=rng.uniform(50, 300, size=(48, n_cols)),
names=[f"turbine_{i:02d}" for i in range(n_cols)],
units=["MW"] * n_cols,
)
tbl_wide
[26]:
TimeSeriesTable
| timestamp | turbine_00 | turbine_01 | turbine_02 | turbine_03 | turbine_04 | turbine_05 | turbine_06 | turbine_07 | turbine_08 | turbine_09 | turbine_10 | turbine_11 | turbine_12 | turbine_13 | turbine_14 | turbine_15 | turbine_16 | turbine_17 | turbine_18 | turbine_19 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2024-01-15 00:00 | 206.274 | 274.303 | 243.921 | 106.302 | 125.042 | 268.388 | 51.3163 | 255.307 | 249.267 | 166.984 | 125.758 | 119.606 | 113.717 | 161.269 | 176.137 | 188.374 | 298.875 | 248.165 | 205.545 | 297.24 |
| 2024-01-15 01:00 | 103.827 | 90.053 | 203.135 | 60.9855 | 58.9201 | 178.722 | 166.552 | 279.292 | 207.307 | 178.529 | 174.218 | 111.879 | 52.9485 | 98.1005 | 223.008 | 100.152 | 142.384 | 50.9336 | 257.512 | 88.6153 |
| 2024-01-15 02:00 | 116.9 | 270.083 | 177.448 | 261.788 | 209.929 | 235.443 | 72.8739 | 185.286 | 176.943 | 267.835 | 140.316 | 199.546 | 64.8129 | 146.908 | 130.759 | 87.5499 | 254.085 | 144.862 | 294.687 | 197.498 |
| … | … | … | … | … | … | … | … | … | … | … | … | … | … | … | … | … | … | … | … | … |
| 2024-01-16 21:00 | 115.077 | 195.91 | 288.058 | 254.283 | 210.182 | 179.705 | 53.783 | 272.679 | 66.7135 | 82.2703 | 223.268 | 253.036 | 246.638 | 163.101 | 94.2639 | 58.8256 | 262.845 | 294.424 | 111.034 | 266.519 |
| 2024-01-16 22:00 | 150.633 | 127.836 | 176.289 | 52.042 | 160.679 | 99.8887 | 228.114 | 175.643 | 267.213 | 274.162 | 129.19 | 120.096 | 284.783 | 175.999 | 74.1289 | 61.4713 | 297.606 | 194.791 | 63.6232 | 177.814 |
| 2024-01-16 23:00 | 176.026 | 158.847 | 287.82 | 287.193 | 81.2419 | 87.9302 | 151.872 | 258.507 | 205.938 | 232.458 | 194.015 | 102.514 | 254.441 | 53.5052 | 224.621 | 98.5849 | 167.773 | 293.783 | 184.759 | 64.2372 |
[27]:
print(tbl_wide)
TimeSeriesTable
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Name: unnamed │
│ Columns: turbine_00, turbine_01, turbine_02, turbine_03, turbine_04, turbine_05, turbine_06, turbine_07, turbine_08, turbine_09, turbine_10, turbine_11, turbine_12, turbine_13, turbine_14, turbine_15, turbine_16, turbine_17, turbine_18, turbine_19 │
│ Length: 48 × 20 │
│ Frequency: PT1H │
│ Timezone: UTC (+00:00) │
│ Unit: MW, MW, MW, MW, MW, MW, MW, MW, MW, MW, MW, MW, MW, MW, MW, MW, MW, MW, MW, MW │
├────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ turbine_00 turbine_01 turbine_02 turbine_03 turbine_04 turbine_05 turbine_06 turbine_07 turbine_08 turbine_09 turbine_10 turbine_11 turbine_12 turbine_13 turbine_14 turbine_15 turbine_16 turbine_17 turbine_18 turbine_19 │
│ 2024-01-15 00:00 206.274 274.303 243.921 106.302 125.042 268.388 51.3163 255.307 249.267 166.984 125.758 119.606 113.717 161.269 176.137 188.374 298.875 248.165 205.545 297.24 │
│ 2024-01-15 01:00 103.827 90.053 203.135 60.9855 58.9201 178.722 166.552 279.292 207.307 178.529 174.218 111.879 52.9485 98.1005 223.008 100.152 142.384 50.9336 257.512 88.6153 │
│ 2024-01-15 02:00 116.9 270.083 177.448 261.788 209.929 235.443 72.8739 185.286 176.943 267.835 140.316 199.546 64.8129 146.908 130.759 87.5499 254.085 144.862 294.687 197.498 │
│ ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... │
│ 2024-01-16 21:00 115.077 195.91 288.058 254.283 210.182 179.705 53.783 272.679 66.7135 82.2703 223.268 253.036 246.638 163.101 94.2639 58.8256 262.845 294.424 111.034 266.519 │
│ 2024-01-16 22:00 150.633 127.836 176.289 52.042 160.679 99.8887 228.114 175.643 267.213 274.162 129.19 120.096 284.783 175.999 74.1289 61.4713 297.606 194.791 63.6232 177.814 │
│ 2024-01-16 23:00 176.026 158.847 287.82 287.193 81.2419 87.9302 151.872 258.507 205.938 232.458 194.015 102.514 254.441 53.5052 224.621 98.5849 167.773 293.783 184.759 64.2372 │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Same data as pandas DataFrame (for comparison)
[28]:
tbl_wide.df
[28]:
| turbine_00 | turbine_01 | turbine_02 | turbine_03 | turbine_04 | turbine_05 | turbine_06 | turbine_07 | turbine_08 | turbine_09 | turbine_10 | turbine_11 | turbine_12 | turbine_13 | turbine_14 | turbine_15 | turbine_16 | turbine_17 | turbine_18 | turbine_19 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| timestamp | ||||||||||||||||||||
| 2024-01-15 00:00:00+00:00 | 206.273867 | 274.303450 | 243.921423 | 106.301797 | 125.041571 | 268.388361 | 51.316326 | 255.307105 | 249.267357 | 166.983738 | 125.758107 | 119.606403 | 113.717397 | 161.269076 | 176.137065 | 188.374338 | 298.875071 | 248.165480 | 205.544807 | 297.240037 |
| 2024-01-15 01:00:00+00:00 | 103.827175 | 90.053008 | 203.134901 | 60.985502 | 58.920070 | 178.722205 | 166.551506 | 279.291943 | 207.306564 | 178.529412 | 174.218359 | 111.878731 | 52.948506 | 98.100536 | 223.008030 | 100.151681 | 142.384078 | 50.933561 | 257.511932 | 88.615270 |
| 2024-01-15 02:00:00+00:00 | 116.899826 | 270.083038 | 177.447702 | 261.787562 | 209.929292 | 235.442737 | 72.873901 | 185.285955 | 176.943059 | 267.834844 | 140.316015 | 199.546017 | 64.812911 | 146.907950 | 130.759087 | 87.549932 | 254.084526 | 144.861543 | 294.686971 | 197.497923 |
| 2024-01-15 03:00:00+00:00 | 201.264063 | 209.499145 | 219.112561 | 87.697005 | 160.078367 | 109.890990 | 150.624575 | 74.176023 | 291.957013 | 103.751009 | 217.941291 | 125.105020 | 268.519257 | 215.553685 | 82.903954 | 261.268580 | 286.237043 | 275.979197 | 192.429787 | 86.364988 |
| 2024-01-15 04:00:00+00:00 | 98.115874 | 281.976421 | 188.081622 | 95.138125 | 271.014224 | 210.392926 | 192.423569 | 144.071959 | 152.738821 | 109.872303 | 59.514322 | 269.054702 | 166.932554 | 186.908800 | 130.540827 | 237.831230 | 56.299218 | 143.046318 | 57.587574 | 80.723026 |
| 2024-01-15 05:00:00+00:00 | 291.787059 | 214.440183 | 157.055062 | 180.935027 | 268.202302 | 136.052667 | 197.572746 | 220.921093 | 138.853444 | 179.774622 | 241.311846 | 277.294828 | 87.765570 | 283.354848 | 51.294716 | 238.244376 | 252.631708 | 84.191013 | 154.725913 | 253.814069 |
| 2024-01-15 06:00:00+00:00 | 53.567797 | 207.115487 | 248.255915 | 178.250896 | 231.462355 | 106.605871 | 99.630287 | 140.781738 | 94.851507 | 136.515360 | 287.031015 | 193.333179 | 135.017017 | 117.881155 | 288.009873 | 161.119552 | 295.098688 | 178.880667 | 180.291532 | 274.135131 |
| 2024-01-15 07:00:00+00:00 | 235.691855 | 195.163216 | 156.662376 | 269.546965 | 152.911537 | 280.689894 | 67.178838 | 157.499215 | 179.878705 | 287.734549 | 112.749812 | 251.509787 | 219.117800 | 229.271476 | 207.405546 | 292.890177 | 133.170365 | 149.568890 | 100.727938 | 62.676014 |
| 2024-01-15 08:00:00+00:00 | 103.227049 | 278.866099 | 260.042204 | 78.101435 | 200.944756 | 169.799124 | 198.671218 | 214.818752 | 126.664873 | 290.337711 | 166.460009 | 207.025214 | 208.806546 | 95.972349 | 65.466355 | 152.879206 | 241.007522 | 253.805447 | 232.497312 | 78.301238 |
| 2024-01-15 09:00:00+00:00 | 278.338715 | 250.509144 | 269.422842 | 180.826038 | 278.908859 | 61.663059 | 57.572208 | 55.053893 | 113.192169 | 112.142443 | 96.875834 | 191.763955 | 59.746460 | 197.596967 | 91.502788 | 219.468427 | 55.268839 | 127.642549 | 284.585322 | 184.599095 |
| 2024-01-15 10:00:00+00:00 | 252.896851 | 214.506520 | 202.687696 | 97.813170 | 193.598687 | 59.921605 | 250.416101 | 290.017729 | 263.502268 | 62.677411 | 134.665021 | 129.500799 | 78.179248 | 206.652955 | 249.364544 | 128.430368 | 265.702309 | 249.281728 | 82.284485 | 241.714789 |
| 2024-01-15 11:00:00+00:00 | 270.655180 | 99.320642 | 193.410295 | 209.687492 | 202.333564 | 74.061419 | 215.297865 | 207.988681 | 255.971372 | 250.878175 | 131.792052 | 230.511833 | 266.818347 | 273.236940 | 90.378082 | 56.675588 | 212.701861 | 103.669068 | 190.927431 | 286.201132 |
| 2024-01-15 12:00:00+00:00 | 144.829906 | 113.193638 | 164.127512 | 214.310978 | 75.274742 | 145.146191 | 83.430297 | 215.611555 | 257.638133 | 144.213445 | 142.930988 | 184.880415 | 103.764445 | 111.852398 | 132.463071 | 164.356425 | 70.382865 | 238.183034 | 194.763644 | 124.923468 |
| 2024-01-15 13:00:00+00:00 | 69.386643 | 240.795238 | 82.769747 | 83.301661 | 82.671061 | 70.315578 | 276.598091 | 117.311075 | 126.602645 | 258.198578 | 204.980865 | 96.785847 | 158.703353 | 270.980616 | 143.843504 | 227.720388 | 74.201927 | 231.831194 | 244.118381 | 256.441695 |
| 2024-01-15 14:00:00+00:00 | 218.550248 | 142.683199 | 66.053000 | 179.694059 | 239.364977 | 97.709551 | 116.559307 | 184.030011 | 237.082891 | 274.146683 | 81.435379 | 96.067553 | 249.884243 | 211.130406 | 230.243198 | 299.192791 | 284.794990 | 260.756267 | 244.278952 | 148.754804 |
| 2024-01-15 15:00:00+00:00 | 210.307278 | 96.111411 | 239.873616 | 239.422666 | 230.323803 | 161.199756 | 144.545082 | 154.942733 | 58.334809 | 261.080029 | 185.592469 | 146.879660 | 187.007192 | 230.410055 | 145.365217 | 257.660168 | 279.865837 | 146.858074 | 84.454039 | 240.093324 |
| 2024-01-15 16:00:00+00:00 | 298.237215 | 86.997037 | 228.168919 | 256.330850 | 280.142986 | 80.845354 | 72.952478 | 296.967895 | 79.189121 | 94.201890 | 193.738233 | 161.568259 | 237.598048 | 97.639312 | 278.606940 | 104.298712 | 242.277748 | 66.900881 | 168.350647 | 58.139582 |
| 2024-01-15 17:00:00+00:00 | 128.452677 | 128.057669 | 229.937110 | 163.754371 | 64.193591 | 298.840415 | 272.174827 | 279.080984 | 111.643883 | 148.527564 | 106.794875 | 81.226596 | 58.255981 | 175.834112 | 80.783414 | 94.076093 | 265.118920 | 171.060692 | 95.925880 | 217.466140 |
| 2024-01-15 18:00:00+00:00 | 116.466219 | 181.734300 | 120.738217 | 179.040297 | 207.133398 | 184.052020 | 148.901027 | 247.703450 | 268.359362 | 94.842816 | 84.077181 | 78.297910 | 294.899183 | 285.397826 | 107.666796 | 292.476893 | 101.954417 | 176.619004 | 174.346261 | 278.738976 |
| 2024-01-15 19:00:00+00:00 | 60.132215 | 128.837704 | 199.993675 | 66.599555 | 109.137644 | 166.265864 | 270.214257 | 240.239880 | 257.245117 | 240.267443 | 226.930194 | 262.423336 | 220.369173 | 233.920765 | 125.411126 | 91.910181 | 239.131245 | 91.459324 | 279.863963 | 199.160709 |
| 2024-01-15 20:00:00+00:00 | 132.358528 | 284.160789 | 88.782568 | 178.616584 | 72.888518 | 291.356927 | 193.844015 | 250.916649 | 120.480605 | 250.449157 | 225.710491 | 210.920367 | 287.640704 | 158.372835 | 153.772108 | 223.030282 | 258.763827 | 133.769005 | 217.414264 | 102.259352 |
| 2024-01-15 21:00:00+00:00 | 187.924993 | 242.292925 | 66.328738 | 231.960516 | 53.858119 | 289.587507 | 167.167450 | 152.267714 | 230.111163 | 180.824717 | 232.712214 | 71.189474 | 190.697968 | 189.527173 | 283.028473 | 59.901395 | 163.204911 | 207.768228 | 187.686738 | 68.540274 |
| 2024-01-15 22:00:00+00:00 | 198.307098 | 105.549221 | 98.887295 | 269.672721 | 99.460527 | 163.572688 | 237.571721 | 226.828847 | 188.364751 | 251.761437 | 166.454044 | 205.096358 | 254.729160 | 219.522909 | 210.457092 | 151.532181 | 189.580865 | 149.020666 | 236.073064 | 145.107539 |
| 2024-01-15 23:00:00+00:00 | 166.655289 | 238.864272 | 175.913950 | 134.508143 | 256.704735 | 145.240649 | 261.182275 | 246.310101 | 161.822206 | 228.222735 | 58.597425 | 147.449601 | 265.083422 | 194.884839 | 189.456457 | 216.184721 | 219.417908 | 195.899563 | 155.157328 | 95.870922 |
| 2024-01-16 00:00:00+00:00 | 123.160509 | 123.230544 | 157.686231 | 299.764689 | 138.137985 | 161.844820 | 142.906891 | 195.356935 | 286.974645 | 272.268223 | 144.284686 | 116.725286 | 271.099651 | 173.458335 | 221.385287 | 68.322856 | 266.639424 | 128.241291 | 173.631739 | 99.505270 |
| 2024-01-16 01:00:00+00:00 | 155.060656 | 257.012229 | 256.894812 | 168.418003 | 241.977675 | 164.516716 | 143.339085 | 186.472244 | 100.335192 | 129.140381 | 226.632193 | 242.628495 | 64.177034 | 233.206535 | 254.357484 | 161.298393 | 65.613478 | 220.728314 | 111.540915 | 210.839332 |
| 2024-01-16 02:00:00+00:00 | 144.155627 | 209.290880 | 114.533720 | 169.134256 | 181.168685 | 207.753296 | 100.791960 | 290.512769 | 122.284519 | 126.505033 | 114.078096 | 66.869065 | 155.730728 | 242.959078 | 227.391734 | 98.893113 | 84.232976 | 130.356985 | 242.063788 | 172.019534 |
| 2024-01-16 03:00:00+00:00 | 280.796046 | 214.095941 | 205.226695 | 241.922782 | 237.564562 | 135.959531 | 114.252100 | 159.405347 | 172.311795 | 85.430693 | 160.333049 | 209.955814 | 83.928626 | 84.509472 | 93.430353 | 120.832851 | 290.427319 | 56.447823 | 95.934780 | 91.261960 |
| 2024-01-16 04:00:00+00:00 | 168.587006 | 53.768195 | 164.543305 | 90.730612 | 117.410056 | 248.110151 | 96.016805 | 204.282208 | 151.578067 | 154.398892 | 254.211354 | 90.228739 | 280.952556 | 273.372714 | 217.080491 | 62.361830 | 215.827132 | 200.086921 | 243.051477 | 103.457896 |
| 2024-01-16 05:00:00+00:00 | 288.339003 | 271.549287 | 78.589285 | 128.800465 | 58.111047 | 257.736803 | 278.773687 | 297.452313 | 202.981254 | 216.496395 | 219.601383 | 192.537109 | 288.105728 | 201.965307 | 133.931510 | 178.219310 | 54.665719 | 231.031576 | 223.480269 | 155.262785 |
| 2024-01-16 06:00:00+00:00 | 262.870273 | 238.881524 | 134.171150 | 69.374492 | 83.055756 | 96.068057 | 125.979507 | 161.878931 | 281.999145 | 119.604474 | 274.646416 | 220.115545 | 263.373229 | 150.813349 | 50.819185 | 246.741841 | 111.368963 | 85.620051 | 249.872900 | 221.582162 |
| 2024-01-16 07:00:00+00:00 | 103.103800 | 116.895454 | 284.804958 | 117.134494 | 225.601470 | 82.388312 | 253.758967 | 79.397503 | 179.010282 | 58.804407 | 187.519636 | 261.655403 | 71.099628 | 118.564145 | 241.173266 | 202.024580 | 128.199227 | 207.225970 | 163.677580 | 265.589066 |
| 2024-01-16 08:00:00+00:00 | 123.234976 | 239.432651 | 208.918539 | 235.107165 | 144.565403 | 231.230255 | 224.606524 | 146.872223 | 56.613058 | 290.728330 | 228.400099 | 101.184662 | 232.701803 | 119.670841 | 167.321348 | 264.972040 | 162.018026 | 122.001643 | 126.372778 | 69.254317 |
| 2024-01-16 09:00:00+00:00 | 104.876395 | 117.776557 | 93.242278 | 65.766429 | 166.447291 | 103.599033 | 234.692628 | 280.631941 | 118.246175 | 193.062073 | 176.681416 | 68.777135 | 81.218596 | 271.194864 | 168.538009 | 251.152478 | 66.645186 | 198.703284 | 266.327989 | 266.766524 |
| 2024-01-16 10:00:00+00:00 | 51.430607 | 180.430026 | 142.251187 | 240.010507 | 68.304749 | 116.231641 | 253.160696 | 167.389056 | 163.287580 | 292.139662 | 129.972666 | 60.430515 | 148.050209 | 88.343390 | 70.472964 | 191.965089 | 288.393904 | 194.851894 | 211.778637 | 130.907215 |
| 2024-01-16 11:00:00+00:00 | 192.780714 | 238.061128 | 197.321214 | 250.694594 | 187.617670 | 99.536014 | 195.681564 | 172.733962 | 91.483883 | 204.791463 | 254.240136 | 83.771923 | 186.236465 | 233.421783 | 150.754399 | 117.511560 | 143.070103 | 185.424630 | 221.665093 | 189.793805 |
| 2024-01-16 12:00:00+00:00 | 76.756259 | 254.471598 | 280.964929 | 75.323211 | 112.379866 | 93.420297 | 262.288791 | 277.569681 | 61.068439 | 133.104853 | 98.123653 | 167.383177 | 280.397607 | 67.543310 | 92.819778 | 171.757320 | 181.008674 | 236.375321 | 159.421510 | 85.284188 |
| 2024-01-16 13:00:00+00:00 | 138.402968 | 295.523280 | 237.680537 | 79.086093 | 252.052295 | 127.731616 | 245.349121 | 53.180362 | 267.817539 | 90.577581 | 163.937649 | 215.438900 | 176.967392 | 91.349442 | 84.779628 | 121.133598 | 63.097939 | 104.136192 | 82.526254 | 166.199254 |
| 2024-01-16 14:00:00+00:00 | 139.127482 | 196.708062 | 120.219716 | 58.477762 | 132.777540 | 238.795176 | 113.959540 | 151.137108 | 238.743595 | 151.670321 | 271.781033 | 279.517126 | 127.632410 | 233.990913 | 113.279246 | 84.880843 | 159.470260 | 200.618107 | 283.897723 | 86.475380 |
| 2024-01-16 15:00:00+00:00 | 228.090669 | 168.866126 | 82.927324 | 293.164512 | 223.942237 | 82.214669 | 276.438855 | 75.773540 | 73.164809 | 132.887749 | 284.489790 | 58.256120 | 279.551810 | 202.902895 | 66.762910 | 192.147931 | 164.697681 | 190.996137 | 234.300885 | 219.654774 |
| 2024-01-16 16:00:00+00:00 | 299.306887 | 89.167266 | 253.213855 | 152.773247 | 245.826880 | 272.944793 | 297.999547 | 116.510461 | 163.234568 | 285.694818 | 286.434595 | 143.218461 | 285.052364 | 151.472789 | 143.691525 | 239.154849 | 167.802957 | 162.049614 | 146.529748 | 158.200983 |
| 2024-01-16 17:00:00+00:00 | 84.954412 | 65.259287 | 238.498286 | 191.124987 | 217.972662 | 250.583863 | 107.526541 | 108.443232 | 119.477158 | 125.981248 | 240.172729 | 143.545397 | 130.797216 | 209.075392 | 96.642625 | 76.605038 | 224.283310 | 239.111333 | 124.091151 | 209.010294 |
| 2024-01-16 18:00:00+00:00 | 58.519142 | 151.079745 | 194.489591 | 113.354632 | 137.053725 | 202.387391 | 197.474461 | 88.547684 | 226.645472 | 70.007319 | 292.431169 | 100.590490 | 113.387036 | 100.075137 | 297.874740 | 121.648730 | 201.323069 | 297.658538 | 287.516964 | 60.587457 |
| 2024-01-16 19:00:00+00:00 | 180.296017 | 200.326169 | 225.598765 | 133.977329 | 131.977153 | 51.071004 | 58.809175 | 187.514292 | 68.971775 | 100.620303 | 133.317979 | 67.617815 | 57.714960 | 281.730112 | 158.802157 | 101.221115 | 227.112950 | 52.361335 | 111.254312 | 290.187410 |
| 2024-01-16 20:00:00+00:00 | 274.422543 | 208.981313 | 73.300693 | 129.512711 | 56.983138 | 104.797751 | 56.358531 | 81.540920 | 208.303635 | 75.110711 | 88.940769 | 275.701996 | 133.863106 | 133.249231 | 71.634868 | 248.982630 | 219.094310 | 186.783200 | 204.478210 | 75.095173 |
| 2024-01-16 21:00:00+00:00 | 115.076517 | 195.910379 | 288.057985 | 254.282986 | 210.181590 | 179.704645 | 53.783044 | 272.679067 | 66.713524 | 82.270263 | 223.267935 | 253.035995 | 246.637666 | 163.101030 | 94.263944 | 58.825554 | 262.844903 | 294.424366 | 111.033876 | 266.519082 |
| 2024-01-16 22:00:00+00:00 | 150.632729 | 127.835940 | 176.288584 | 52.042045 | 160.678617 | 99.888742 | 228.114298 | 175.642845 | 267.213157 | 274.162048 | 129.189732 | 120.095951 | 284.782596 | 175.999390 | 74.128882 | 61.471283 | 297.606381 | 194.790907 | 63.623243 | 177.813862 |
| 2024-01-16 23:00:00+00:00 | 176.026126 | 158.846960 | 287.820100 | 287.193008 | 81.241920 | 87.930176 | 151.872151 | 258.506618 | 205.938149 | 232.457532 | 194.014596 | 102.514234 | 254.441357 | 53.505246 | 224.621064 | 98.584904 | 167.772870 | 293.783301 | 184.758964 | 64.237205 |
8. Side-by-side: light vs dark
Quick way to preview both colour schemes without changing your OS setting — wrap the HTML repr in a <div> that forces a colour scheme.
[29]:
from IPython.display import HTML
light = f'<div style="color-scheme: light; padding: 10px;">{ts._repr_html_()}</div>'
dark = f'<div style="color-scheme: dark; background: #0f172a; padding: 10px; border-radius: 8px;">{ts._repr_html_()}</div>'
HTML(f"<h4>Light mode</h4>{light}<br><h4>Dark mode</h4>{dark}")
[29]:
Light mode
TimeSeriesList
| timestamp | power |
|---|---|
| 2024-01-15 00:00 | 120.0 |
| 2024-01-15 01:00 | 124.207 |
| 2024-01-15 02:00 | 124.546 |
| … | … |
| 2024-01-15 21:00 | 124.183 |
| 2024-01-15 22:00 | 119.956 |
| 2024-01-15 23:00 | 115.769 |
Dark mode
TimeSeriesList
| timestamp | power |
|---|---|
| 2024-01-15 00:00 | 120.0 |
| 2024-01-15 01:00 | 124.207 |
| 2024-01-15 02:00 | 124.546 |
| … | … |
| 2024-01-15 21:00 | 124.183 |
| 2024-01-15 22:00 | 119.956 |
| 2024-01-15 23:00 | 115.769 |
[ ]:
[ ]: