Southwest heatwave city temperatures
A wide-table example using Phoenix and Las Vegas daily maximum temperatures during the 2024 summer heatwave window.
Phoenix max temp vs Las Vegas max temp: Pearson r 0.73, Spearman rho 0.75, Kendall tau 0.56. The best agreement appears in trend similarity. The weakest agreement appears in shape similarity and derivative similarity, so timing or regime differences probably matter.
This is the minimal script a human user would actually run: load data, call EchoTime, inspect the returned object.
from pathlib import Path
import pandas as pd
from echotime import compare_series, profile_dataset
data_path = Path(__file__).resolve().parents[1] / "data" / "real_heatwave_city_temps_2024.csv"
df = pd.read_csv(data_path)
report = compare_series(df["phoenix_temp_max"], df["las_vegas_temp_max"], left_name="Phoenix max temp", right_name="Las Vegas max temp")
profile = profile_dataset(df[["phoenix_temp_max", "las_vegas_temp_max"]], domain="climate")
print(report.to_summary_card_markdown())
print(profile.to_summary_card_markdown())
You should see high pairwise correlation metrics plus a dataset profile explaining the broader panel structure.
# EchoTime similarity summary
**Compared:** Phoenix max temp vs Las Vegas max temp
## Headline
Phoenix max temp vs Las Vegas max temp: Pearson r 0.73, Spearman rho 0.75, Kendall tau 0.56. The best agreement appears in trend similarity. The weakest agreement appears in shape similarity and derivative similarity, so timing or regime differences probably matter.
## Familiar statistics
| metric | value |
|---|---:|
| Pearson r | 0.727 |
| Spearman rho | 0.746 |
| Kendall tau | 0.556 |
| Best-lag Pearson r | 0.822 |
| Mutual info | 0.281 |
| First-difference r | 0.123 |
## Time-series-specific metrics
| plain-language label | score |
|---|---:|
| trend similarity | 0.915 |
| spectral similarity | 0.605 |
| dtw similarity | 0.586 |
| shape similarity | 0.299 |
## Recommended next actions
- Plot both series after z-score normalization to show the shared shape without scale differences.
- Run rolling or windowed similarity if you expect the relationship to change over time.
- Use structural-profile similarity when scales, frequencies, or observation modes differ too much for raw-shape comparison.
- Pearson 0.73 / Spearman 0.75 / Mutual info 0.28 shows the two cities track each other closely through the heatwave window.
- The supporting dataset profile shows the broader structural context behind that pairwise comparison.
- This is a realistic wide-table workflow you can reuse for any small panel of real measurements.
This is the most useful pattern when you have a whole panel, not just one pair of curves.
- For a CSV, keep one timestamp column and one numeric column per city, region, or sensor.
- Use compare_series(...) for the one pair you want to talk about, then profile_dataset(...) for the full panel.
- If you need something shareable, write both the similarity and profile HTML reports to disk.
The two city temperature curves share broad movement, but day-to-day changes are not identical.
The radar shows where the two temperature curves agree most strongly.
The dataset profile reveals the broader structure of the full temperature panel.