Temperature vs. Humidity#
Goal
Scatter plot of indoor temperature against relative humidity with comfort zone boundaries. This helps evaluate whether indoor conditions fall within acceptable thermal comfort ranges.
Data Basis
The dataset flatTempHum.csv contains hourly indoor temperature and humidity measurements for multiple flats (columns: time, FlatA_Hum, FlatA_Temp, FlatB_Hum, FlatB_Temp, …; separator ;). We use FlatA_Temp and FlatA_Hum and build a 3-column DataFrame [timestamp, temperature, humidity].
Data Preparation#
import pandas as pd
url = "https://raw.githubusercontent.com/retomarek/edap/main/edap/sampleData/flatTempHum.csv"
raw = pd.read_csv(url, sep=";")
# Parse timestamp
raw["time"] = pd.to_datetime(raw["time"])
# Select [timestamp, temperature, humidity] — 3-column DataFrame
df = raw[["time", "FlatA_Temp", "FlatA_Hum"]].copy()
df.columns = ["timestamp", "temperature", "humidity"]
df = df.dropna()
df.head()
| timestamp | temperature | humidity | |
|---|---|---|---|
| 0 | 2018-10-03 00:00:00 | 24.43 | 53.0 |
| 1 | 2018-10-03 01:00:00 | 24.40 | 53.0 |
| 2 | 2018-10-03 02:00:00 | 24.40 | 53.0 |
| 3 | 2018-10-03 03:00:00 | 24.40 | 53.0 |
| 4 | 2018-10-03 04:00:00 | 24.40 | 53.3 |
Visualization#
from pyedautils.plots import plot_comfort_temp_humidity
fig = plot_comfort_temp_humidity(df, title="Indoor Comfort — Temperature vs. Humidity")
fig.show()
Customization
You can pass data from different flats by selecting different column pairs (e.g., FlatB_Temp and FlatB_Hum).
df = raw[["time", "FlatB_Temp", "FlatB_Hum"]].copy()
df.columns = ["timestamp", "temperature", "humidity"]