sample_ev_data_csv / README.md
jeyanthiii's picture
Rewrite dataset card: full column docs, fault census, decision math
74cb207 verified
|
Raw History Blame Contribute Delete
6.08 kB
metadata
license: cc-by-4.0
tags:
  - electric-vehicles
  - telemetry
  - data-engineering
  - medallion-architecture
  - databricks
  - data-quality
  - olap
size_categories:
  - 100K<n<1M
configs:
  - config_name: messy_stream_2024
    data_files: 1_car_telemetry_2024.csv
  - config_name: charging_sessions
    data_files: 2_charging_sessions.csv
  - config_name: grid_carbon
    data_files: 3_grid_carbon_hourly.csv
  - config_name: archive_rare_user
    data_files: archive_2020_2024_rare_user.csv
  - config_name: archive_daily_user
    data_files: archive_2020_2024_daily_user.csv
  - config_name: archive_moderate_user
    data_files: archive_2020_2024_moderate_user.csv
  - config_name: archive_heavy_user
    data_files: archive_2020_2024_heavy_user.csv

⚡ EV Fleet Sensor Data — Databricks Medallion Case Study

Raw source CSVs for an end-to-end Databricks medallion architecture (Bronze → Silver → Gold) case study: a deliberately messy EV sensor stream is cleaned, quality-gated, and distilled into decision-grade insights — battery health ranking, DTC risk, charger siting, and a clean-charging window.

  • Question data: 1_car_telemetry_2024.csv — 35,363 rows of 2024 telemetry with planted faults
  • Answer key: the four archive_2020_2024_*.csv files — a clean ~175K-row sensor archive (2020–2024)
  • The messy 2024 stream was derived from the archive (faults planted, seed = 7), so every fault is verifiable. The two sources intentionally overlap in 2024 (stream = question, archive = ground truth).

Dataset Structure

🔴 Feed 1 — Car telemetry (the messy stream)

1_car_telemetry_2024.csv — hourly readings, 4 vehicles, calendar year 2024.

Column Type Description
timestamp datetime Hour of reading
vehicle_id string EV-101 … EV-104
user_profile string rare_user / daily_user / moderate_user / heavy_user
district string Home district: University, Downtown, Harbor, Industrial
SOC float State of charge, %
SOH float State of health (battery), %
Charging_Cycles int Lifetime charge cycles
charging_now int 0/1 — currently charging
Battery_Temp float Battery temperature, °C
Motor_RPM int Motor speed
Motor_Torque float Motor torque, Nm
Motor_Temp float Motor temperature, °C
Brake_Pad_Wear float Brake pad wear, %
Charging_Voltage float Charging voltage, V
Tire_Pressure float Tire pressure — ⚠️ planted unit faults (kPa vs PSI)
DTC int 1 = diagnostic trouble code active
grid_carbon_g_per_kwh float Grid carbon intensity at that hour

Planted fault census: exact duplicates (419, to be dropped), kPa→PSI unit errors (fix), out-of-bounds values (fix + flag), missing readings (flag). Silver-layer policy: only duplicates die — the row always survives; the faulty value is nulled.

🔌 Feed 2 — Charging sessions

2_charging_sessions.csv — 484 completed sessions.

Column Description
session_id, station_id Identifiers
district Where the session happened (drives charger-siting analysis)
start_time, end_time Session window
energy_kwh_source_analog, power_kw_analog Energy delivered / power draw
soc_start_pct, soc_end_pct Battery % before → after
battery_kwh, vehicle_model Vehicle pack size and model
station_temp_c Station temperature
status Session status

⚡ Feed 3 — Grid carbon intensity

3_grid_carbon_hourly.csv — 168 rows (7 days × 24 h): date, hour, carbon_g_per_kwh. Midnight peaks near 911 gCO₂/kWh; midday (12:00) drops to ~319.

🟢 The clean archive (ground truth)

Four files, one per user profile, each with 43,800 rows (24 h × 365 d × 5 yrs, 2020–2024):

archive_2020_2024_{rare,daily,moderate,heavy}_user.csv — same sensor columns as the stream (leading index column, no timestamps/district).

File Vehicle Profile
archive_2020_2024_rare_user.csv Renault Zoe (52 kWh) EV-101
archive_2020_2024_daily_user.csv Hyundai Ioniq 5 (77 kWh) EV-103
archive_2020_2024_moderate_user.csv VW ID.4 (82 kWh) EV-102
archive_2020_2024_heavy_user.csv Ford F-150 Lightning (131 kWh) EV-104

Example decisions this data supports

Transparent, verifiable arithmetic (no black-box model):

  1. Risk score = soh_decay_pct_per_year × 20 + dtc_rate_pct × 10, thresholds 60 (act) / 30 (watch) → EV-102 scores 54.1 (decay 1.958 %/yr + 654 DTC events) → service first
  2. Charger siting = total_co2_g ÷ vehicle_days → Industrial district worst at 43,311 gCO₂/vehicle-day across 86 sessions → site the next charger there
  3. Charging window = cleanest vs dirtiest hour → shift charging to ~12:00: ~319 vs ~911 gCO₂/kWh (2.86× cleaner, ~592 g saved per kWh shifted)

How it was used

The files are ingested as-is into a Databricks Free Edition lakehouse:

Bronze (raw, immutable)  →  Silver (cleaned, quality gate: 35,363 − 419 dupes = 34,944 rows)
                         →  Gold (6 decision tables: soh_trend, dtc_risk_rank, co2_per_vehicle_day,
                                  grid_carbon_by_district_hour, fleet_worry_list, final_decision)

Usage

from huggingface_hub import hf_hub_download
import pandas as pd

path = hf_hub_download(repo_id="jeyanthiii/sample_ev_data_csv",
                       filename="1_car_telemetry_2024.csv",
                       repo_type="dataset")
df = pd.read_csv(path)

Notes

  • Faults are synthetic and intentional (teaching/demo dataset); the archive is the reference truth.
  • 2024 rows exist in both stream and archive by design — that overlap is what makes the quality gate provable.
  • Local backup of this folder is kept at ~/Documents/work/temp/cl_demo/data/.

License

CC-BY-4.0 — free to use with attribution.