Case Mandate
Mandato del caso
Investigate 1,391,578 flight records from raw structure through data quality, statistics, airport and route performance, temporal behavior, root-cause evidence, and executive prioritization. Every line of code answers a business question; every result generates evidence; every finding supports a decision.
Investigar 1,391,578 registros de vuelos desde la estructura cruda hasta calidad del dato, estadística, desempeño de aeropuertos y rutas, comportamiento temporal, evidencia de causa raíz y priorización ejecutiva. Cada línea de código responde una pregunta de negocio; cada resultado genera evidencia; cada hallazgo respalda una decisión.
BI4Humans Investigation Framework
Evidence
Objective output produced by the code.
Resultado objetivo producido por el código.
Finding
Meaning supported by the evidence.
Significado respaldado por la evidencia.
Business Decision
Action or priority justified by the finding.
Acción o prioridad justificada por el hallazgo.
Interim Executive Summary — Evidence Through Investigation 41
Resumen ejecutivo interino — Evidencia hasta la investigación 41
Operational reality
The typical flight is on time or early (median 0), yet the network average is 12.08 minutes because severe positive outliers create a long right tail.
El vuelo típico está a tiempo o temprano (mediana 0), pero el promedio de red es 12.08 minutos porque outliers positivos severos crean una cola derecha larga.
Risk concentration
11.65% of all flights are statistical outliers. ORD rises to 17.25%, 5.61 percentage points above the network.
11.65% de todos los vuelos son outliers estadísticos. ORD sube a 17.25%, 5.61 puntos porcentuales sobre la red.
Temporal pattern
Delay grows through the day. During several high-volume hours from 14:00–21:00, more than half of flights are delayed.
El retraso crece durante el día. En varias horas de alto volumen entre 14:00–21:00, más de la mitad de los vuelos se retrasa.
Initial priorities
A transparent volume × average-delay index places ATL, ORD, and DEN at the top of the critical-window intervention list.
Un índice transparente de volumen × retraso promedio coloca ATL, ORD y DEN en la cima de la lista de intervención de la ventana crítica.
Phase 1 — Data Understanding
Fase 1 — Comprensión del dato
Dataset Size
Technical InvestigationBusiness Question
How many records are available for analysis?
¿Cuántos registros están disponibles para el análisis?
Why It Matters
Volume determines processing strategy and establishes the analytical scale.
El volumen determina la estrategia de procesamiento y establece la escala analítica.
Spark Investigation
df.count()
Actual Evidence
| Metric | Actual Result |
|---|---|
| Total records | 1,391,578 |
Key Finding
The dataset is large enough to demonstrate distributed processing, aggregation, and realistic BI investigation.
El dataset es suficientemente grande para demostrar procesamiento distribuido, agregación e investigación realista de BI.
Executive Interpretation
Spark is justified as a scalable analytical engine, while the dataset remains manageable for reproducible training.
Spark se justifica como motor analítico escalable, mientras el dataset sigue siendo manejable para un entrenamiento reproducible.
Business Decision
Proceed with formal structural reconnaissance before calculating KPIs.
Continuar con el reconocimiento estructural formal antes de calcular KPIs.
Schema Inspection
Technical InvestigationBusiness Question
What fields and data types define the dataset?
¿Qué campos y tipos de datos definen el dataset?
Why It Matters
A correct schema is the foundation for reliable calculations and transformations.
Un esquema correcto es la base de cálculos y transformaciones confiables.
Spark Investigation
df.printSchema()
Actual Evidence
| Column | Type | Nullable | Analytical role |
|---|---|---|---|
| date | integer | Yes | Encoded time dimension |
| delay | integer | Yes | Primary KPI / measure |
| distance | integer | Yes | Continuous measure |
| origin | string | Yes | Departure dimension |
| destination | string | Yes | Arrival dimension |
Key Finding
Five fields provide a compact operational model: one encoded time field, two location dimensions, and two numeric measures.
Cinco campos proporcionan un modelo operacional compacto: un campo temporal codificado, dos dimensiones de ubicación y dos medidas numéricas.
Executive Interpretation
The model is simple enough to investigate clearly but rich enough to support airport, route, temporal, and statistical analysis.
El modelo es suficientemente simple para investigarlo con claridad y suficientemente rico para análisis aeroportuario, de rutas, temporal y estadístico.
Business Decision
Create a business data dictionary and validate the encoded date before temporal analysis.
Crear un diccionario de datos de negocio y validar la fecha codificada antes del análisis temporal.
First Data Inspection
Technical InvestigationBusiness Question
How are values represented in real records?
¿Cómo se representan los valores en registros reales?
Why It Matters
A visual sample often reveals encoding, units, categories, and hidden quality issues.
Una muestra visual suele revelar codificación, unidades, categorías y problemas ocultos de calidad.
Spark Investigation
df.show(10, truncate=False)
Actual Evidence
| date | delay | distance | origin | destination |
|---|---|---|---|---|
| 1011245 | 6 | 602 | ABE | ATL |
| 1020600 | -8 | 369 | ABE | DTW |
| 1021245 | -2 | 602 | ABE | ATL |
| 1020605 | -4 | 602 | ABE | ATL |
| 1031245 | -4 | 602 | ABE | ATL |
Key Finding
The date field is encoded; delay can be negative; airports use three-letter codes; distance appears to be in miles.
El campo date está codificado; delay puede ser negativo; los aeropuertos usan códigos de tres letras; distance parece estar en millas.
Executive Interpretation
The dataset cannot be interpreted safely from column names alone. Data decoding is required.
El dataset no puede interpretarse de forma segura solo por los nombres de columnas. Se requiere decodificación.
Business Decision
Treat date decoding as a formal investigation rather than an assumption.
Tratar la decodificación de date como una investigación formal y no como una suposición.
Column Inventory and Analytical Roles
Technical InvestigationBusiness Question
What information does the model contain?
¿Qué información contiene el modelo?
Why It Matters
Classifying dimensions and measures clarifies how business questions will be answered.
Clasificar dimensiones y medidas aclara cómo se responderán las preguntas de negocio.
Spark Investigation
df.columns
Actual Evidence
| Columns returned |
|---|
| ['date', 'delay', 'distance', 'origin', 'destination'] |
Key Finding
Delay is the central KPI; origin, destination, and time explain variation; distance is a possible explanatory variable.
Delay es el KPI central; origin, destination y time explican la variación; distance es una posible variable explicativa.
Executive Interpretation
The dataset already suggests a dimensional BI model centered on flight events.
El dataset ya sugiere un modelo dimensional de BI centrado en eventos de vuelo.
Business Decision
Use delay as the primary performance measure and test each dimension systematically.
Usar delay como medida principal de desempeño y probar cada dimensión sistemáticamente.
Phase 2 — Data Quality
Fase 2 — Calidad del dato
Null Values Assessment
Technical InvestigationBusiness Question
Does the dataset contain missing values?
¿Contiene el dataset valores faltantes?
Why It Matters
Missing values can invalidate KPIs or require imputation and special handling.
Los valores faltantes pueden invalidar KPIs o requerir imputación y tratamiento especial.
Spark Investigation
from pyspark.sql.functions import col, sum, when
df.select([
sum(when(col(c).isNull(), 1).otherwise(0)).alias(c)
for c in df.columns
]).show()
Actual Evidence
| date | delay | distance | origin | destination |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
Key Finding
All five columns are 100% complete. Nullable schema metadata did not imply actual missing values.
Las cinco columnas están 100% completas. El metadato nullable del esquema no implicaba nulos reales.
Executive Interpretation
No null-cleaning stage is required before analysis.
No se requiere una etapa de limpieza de nulos antes del análisis.
Business Decision
Mark completeness as PASS and continue to duplicate validation.
Marcar completitud como PASS y continuar con validación de duplicados.
Duplicate-Looking Records
Technical InvestigationBusiness Question
Are any rows completely duplicated?
¿Existen filas completamente duplicadas?
Why It Matters
Duplicates may inflate counts and averages, but apparent duplicates can also represent legitimate events when no unique key exists.
Los duplicados pueden inflar conteos y promedios, pero también pueden representar eventos legítimos cuando no existe una llave única.
Spark Investigation
total_records = df.count()
unique_records = df.distinct().count()
print(total_records, unique_records, total_records - unique_records)
Actual Evidence
| Metric | Value |
|---|---|
| Total records | 1,391,578 |
| Unique rows | 1,391,071 |
| Duplicate-looking rows | 507 |
| Rate | 0.036% |
Key Finding
Only 507 rows are identical across all five fields, but the dataset lacks FlightID or flight number, so they cannot automatically be labeled errors.
Solo 507 filas son idénticas en los cinco campos, pero el dataset carece de FlightID o número de vuelo, por lo que no pueden etiquetarse automáticamente como errores.
Executive Interpretation
The duplicate rate is negligible for aggregates, yet the records require business validation rather than automatic deletion.
La tasa de duplicados es mínima para agregados, pero los registros requieren validación de negocio y no eliminación automática.
Business Decision
Retain the rows in the investigation and document the limitation.
Conservar las filas en la investigación y documentar la limitación.
Phase 3 — Statistical Investigation
Fase 3 — Investigación estadística
Initial Delay Statistics
Statistical InvestigationBusiness Question
What are the minimum, average, and maximum delays?
¿Cuáles son los retrasos mínimo, promedio y máximo?
Why It Matters
Range and mean reveal the initial scale of operational variation.
El rango y la media revelan la escala inicial de variación operacional.
Spark Investigation
from pyspark.sql.functions import min, max, avg
df.select(
min('delay').alias('Minimum Delay'),
avg('delay').alias('Average Delay'),
max('delay').alias('Maximum Delay')
).show()
Actual Evidence
| Metric | Value |
|---|---|
| Minimum | -112 min |
| Average | 12.08 min |
| Maximum | 1,642 min |
Key Finding
The maximum equals 27 hours 22 minutes and is far more extreme than the minimum, indicating strong right skew.
El máximo equivale a 27 horas y 22 minutos y es mucho más extremo que el mínimo, indicando fuerte asimetría positiva.
Executive Interpretation
The average alone will not represent a typical flight. Median, percentiles, and outlier analysis are mandatory.
El promedio por sí solo no representará un vuelo típico. Mediana, percentiles y análisis de outliers son obligatorios.
Business Decision
Do not use average delay as a standalone executive KPI.
No usar el retraso promedio como KPI ejecutivo aislado.
Flight Status Classification
Business InvestigationBusiness Question
How many flights were early, exactly on time, or delayed?
¿Cuántos vuelos salieron temprano, exactamente a tiempo o retrasados?
Why It Matters
Business categories are more intuitive than raw numeric values.
Las categorías de negocio son más intuitivas que valores numéricos crudos.
Spark Investigation
from pyspark.sql.functions import when, col
df_status = df.withColumn(
'flight_status',
when(col('delay') < 0, 'Early')
.when(col('delay') == 0, 'On Time')
.otherwise('Delayed')
)
df_status.groupBy('flight_status').count().show()
Actual Evidence
| Status | Flights | Share |
|---|---|---|
| Early | 668,729 | 48.05% |
| Delayed | 591,727 | 42.52% |
| On Time | 131,122 | 9.43% |
Key Finding
Nearly half of the flights departed early, while 42.52% recorded some positive delay. Exact punctuality was uncommon.
Casi la mitad de los vuelos salió temprano, mientras 42.52% registró algún retraso positivo. La puntualidad exacta fue poco común.
Executive Interpretation
Average delay masked a mixed distribution of early and delayed operations.
El retraso promedio ocultaba una distribución mixta de operaciones adelantadas y retrasadas.
Business Decision
Report both status distribution and delay magnitude.
Reportar tanto la distribución por estado como la magnitud del retraso.
Delay Severity Distribution
Business InvestigationBusiness Question
How severe are the delays?
¿Qué tan severos son los retrasos?
Why It Matters
Frequency and severity represent different operational problems.
Frecuencia y severidad representan problemas operacionales diferentes.
Spark Investigation
df_delay_groups = df.withColumn(
'delay_group',
when(col('delay') < 0, 'Early')
.when(col('delay') == 0, 'On Time')
.when(col('delay') <= 15, '1-15 min')
.when(col('delay') <= 30, '16-30 min')
.when(col('delay') <= 60, '31-60 min')
.when(col('delay') <= 120, '61-120 min')
.otherwise('>120 min')
)
df_delay_groups.groupBy('delay_group').count().show()
Actual Evidence
| Category | Flights |
|---|---|
| Early | 668,729 |
| 1–15 min | 288,571 |
| On Time | 131,122 |
| 16–30 min | 113,390 |
| 31–60 min | 95,781 |
| 61–120 min | 61,039 |
| >120 min | 32,946 |
Key Finding
Most positive delays are small. Critical delays above two hours affect 32,946 flights, or 2.37% of the full dataset.
La mayoría de los retrasos positivos es pequeña. Los retrasos críticos de más de dos horas afectan 32,946 vuelos, o 2.37% del dataset completo.
Executive Interpretation
Management must choose between reducing frequent small delays and rarer severe disruptions.
La gerencia debe escoger entre reducir retrasos pequeños frecuentes y disrupciones severas menos comunes.
Business Decision
Use separate KPIs for frequency, severity, and critical-delay exposure.
Usar KPIs separados para frecuencia, severidad y exposición a retrasos críticos.
Percentile Analysis
Statistical InvestigationBusiness Question
What delay is experienced by the typical flight and by the most extreme percentiles?
¿Qué retraso experimenta el vuelo típico y los percentiles más extremos?
Why It Matters
Percentiles describe the distribution without being dominated by extreme values.
Los percentiles describen la distribución sin quedar dominados por valores extremos.
Spark Investigation
delay_percentiles = df.approxQuantile(
'delay', [0.25,0.50,0.75,0.90,0.95,0.99], 0.001
)
Actual Evidence
| Percentile | Delay |
|---|---|
| P25 | -4 min |
| Median | 0 min |
| P75 | 12 min |
| P90 | 43 min |
| P95 | 76 min |
| P99 | 177 min |
Key Finding
The median is zero: at least half of flights were on time or early. The mean of 12.08 minutes is pulled upward by the long positive tail.
La mediana es cero: al menos la mitad de los vuelos estuvo a tiempo o temprano. La media de 12.08 minutos es empujada hacia arriba por la cola positiva larga.
Executive Interpretation
P90, P95, and P99 provide more actionable service-level thresholds than the mean alone.
P90, P95 y P99 ofrecen umbrales de servicio más accionables que la media sola.
Business Decision
Show mean and median together, supported by percentile KPIs.
Mostrar media y mediana juntas, apoyadas por KPIs percentiles.
Standard Deviation
Statistical InvestigationBusiness Question
How consistent is the operation?
¿Qué tan consistente es la operación?
Why It Matters
Average level and operational stability are different management questions.
El nivel promedio y la estabilidad operacional son preguntas gerenciales diferentes.
Spark Investigation
from pyspark.sql.functions import stddev
df.select(
avg('delay').alias('Average Delay'),
stddev('delay').alias('Standard Deviation')
).show()
Actual Evidence
| Average Delay | Standard Deviation |
|---|---|
| 12.08 min | 38.81 min |
Key Finding
Standard deviation is more than three times the mean, confirming high variability.
La desviación estándar es más de tres veces la media, confirmando alta variabilidad.
Executive Interpretation
The challenge is not only reducing average delay but also reducing inconsistency and extreme events.
El reto no es solo reducir el retraso promedio, sino también reducir inconsistencia y eventos extremos.
Business Decision
Add variability and tail-risk KPIs to executive reporting.
Agregar KPIs de variabilidad y riesgo de cola al reporte ejecutivo.
IQR Outlier Thresholds
Statistical InvestigationBusiness Question
Which values are statistically unusual according to the dataset distribution?
¿Qué valores son estadísticamente inusuales según la distribución?
Why It Matters
An objective threshold separates normal operation from exceptional events.
Un umbral objetivo separa operación normal de eventos excepcionales.
Spark Investigation
q1, q3 = df.approxQuantile('delay',[0.25,0.75],0.001)
iqr = q3-q1
lower_bound = q1-1.5*iqr
upper_bound = q3+1.5*iqr
Actual Evidence
| Q1 | Q3 | IQR | Lower bound | Upper bound |
|---|---|---|---|---|
| -4 | 12 | 16 | -28 | 36 |
Key Finding
Delays above 36 minutes and early departures below -28 minutes fall outside the IQR normal range.
Los retrasos superiores a 36 minutos y las salidas adelantadas inferiores a -28 minutos quedan fuera del rango normal IQR.
Executive Interpretation
Outliers should be investigated, not automatically deleted, because they may contain the most valuable operational evidence.
Los outliers deben investigarse, no eliminarse automáticamente, porque pueden contener la evidencia operacional más valiosa.
Business Decision
Use the thresholds to quantify abnormal exposure and trace it by airport, route, and hour.
Usar los umbrales para cuantificar exposición anormal y rastrearla por aeropuerto, ruta y hora.
Outlier Population
Statistical InvestigationBusiness Question
How much of the operation falls outside the normal IQR range?
¿Qué parte de la operación cae fuera del rango normal IQR?
Why It Matters
The outlier rate indicates whether exceptional behavior is isolated or systemic.
La tasa de outliers indica si el comportamiento excepcional es aislado o sistémico.
Spark Investigation
outlier_count = df.filter(
(col('delay') < lower_bound) | (col('delay') > upper_bound)
).count()
Actual Evidence
| Normal records | Outlier records | Outlier rate |
|---|---|---|
| 1,229,499 | 162,079 | 11.65% |
Key Finding
More than one in ten flights falls outside the normal statistical range. This is not a negligible tail.
Más de uno de cada diez vuelos cae fuera del rango estadístico normal. No es una cola despreciable.
Executive Interpretation
A focused intervention may create substantial value if outliers are concentrated in a small set of airports, routes, or hours.
Una intervención focalizada puede generar valor sustancial si los outliers se concentran en pocos aeropuertos, rutas u horas.
Business Decision
Begin segmentation to locate the concentration of abnormal events.
Iniciar segmentación para localizar la concentración de eventos anormales.
Phase 4 — Airport and Route Investigation
Fase 4 — Investigación de aeropuertos y rutas
Top Origin Airports by Volume
Business InvestigationBusiness Question
Which airports generate the most departures?
¿Qué aeropuertos generan más salidas?
Why It Matters
Volume is essential context before ranking performance.
El volumen es contexto esencial antes de clasificar desempeño.
Spark Investigation
df.groupBy('origin').count().orderBy(desc('count')).show(20)
Actual Evidence
| Rank | Origin | Flights |
|---|---|---|
| 1 | ATL | 91,484 |
| 2 | DFW | 68,482 |
| 3 | ORD | 64,228 |
| 4 | LAX | 54,086 |
| 5 | DEN | 53,148 |
| 6 | IAH | 43,361 |
| 7 | PHX | 40,155 |
| 8 | SFO | 39,483 |
| 9 | LAS | 33,107 |
| 10 | CLT | 28,402 |
Key Finding
ATL dominates departure volume. The five largest origins form the main operational exposure points.
ATL domina el volumen de salidas. Los cinco orígenes mayores forman los principales puntos de exposición operacional.
Executive Interpretation
Small percentage improvements at large hubs may affect far more flights than large improvements at small airports.
Pequeñas mejoras porcentuales en hubs grandes pueden afectar muchos más vuelos que grandes mejoras en aeropuertos pequeños.
Business Decision
Evaluate performance with volume and delay together.
Evaluar desempeño combinando volumen y retraso.
Raw Average Delay by Origin
Business InvestigationBusiness Question
Which origin airports show the highest raw average delay?
¿Qué aeropuertos de origen muestran el mayor retraso promedio bruto?
Why It Matters
A raw ranking is transparent but may be distorted by tiny samples.
Un ranking bruto es transparente pero puede distorsionarse por muestras pequeñas.
Spark Investigation
df.groupBy('origin').agg(
count('*').alias('Flights'),
avg('delay').alias('Average Delay')
).orderBy(desc('Average Delay')).show(25)
Actual Evidence
| Origin | Flights | Average Delay |
|---|---|---|
| GUM | 90 | 33.88 |
| LSE | 154 | 26.53 |
| MQT | 77 | 23.87 |
| EGE | 877 | 20.57 |
| ROA | 1,470 | 19.89 |
| MDW | 20,056 | 19.66 |
| ORD | 64,228 | 18.59 |
Key Finding
The worst raw averages are dominated by low-volume airports. GUM has only 90 records, while ORD has 64,228.
Los peores promedios brutos están dominados por aeropuertos de bajo volumen. GUM tiene solo 90 registros, mientras ORD tiene 64,228.
Executive Interpretation
Ranking a KPI without volume can produce the wrong executive decision.
Clasificar un KPI sin volumen puede producir una decisión ejecutiva equivocada.
Business Decision
Create a minimum-volume executive ranking and retain the raw table for transparency.
Crear un ranking ejecutivo con volumen mínimo y conservar la tabla bruta por transparencia.
High-Volume Origin Performance
Executive InvestigationBusiness Question
Which airports with at least 10,000 flights have the highest average delay?
¿Qué aeropuertos con al menos 10,000 vuelos tienen el mayor retraso promedio?
Why It Matters
Filtering by meaningful volume improves comparability and decision relevance.
Filtrar por volumen significativo mejora comparabilidad y relevancia decisional.
Spark Investigation
df.groupBy('origin').agg(
count('*').alias('Flights'),
avg('delay').alias('Average Delay')
).filter('Flights >= 10000').orderBy(desc('Average Delay')).show(30)
Actual Evidence
| Rank | Origin | Flights | Average Delay |
|---|---|---|---|
| 1 | MDW | 20,056 | 19.66 |
| 2 | ORD | 64,228 | 18.59 |
| 3 | IAD | 14,136 | 18.40 |
| 4 | DEN | 53,148 | 16.92 |
| 5 | BWI | 21,558 | 16.83 |
| 6 | FLL | 18,006 | 16.51 |
| 7 | JFK | 23,572 | 16.46 |
| 8 | EWR | 27,656 | 16.37 |
Key Finding
ORD combines one of the highest delays with one of the highest volumes, making it a stronger executive priority than many airports above it in the raw ranking.
ORD combina uno de los mayores retrasos con uno de los mayores volúmenes, convirtiéndose en prioridad ejecutiva más fuerte que muchos aeropuertos superiores en el ranking bruto.
Executive Interpretation
Volume gives meaning to performance.
El volumen da significado al desempeño.
Business Decision
Open a dedicated ORD case file and benchmark it against the network.
Abrir un expediente específico de ORD y compararlo con la red.
Best High-Volume Origin Airports
Executive InvestigationBusiness Question
Which large airports demonstrate the strongest average-delay performance?
¿Qué aeropuertos grandes demuestran el mejor desempeño de retraso promedio?
Why It Matters
Good performers may reveal operational practices worth studying.
Los buenos desempeños pueden revelar prácticas operacionales dignas de estudio.
Spark Investigation
airport_performance.orderBy('Average_Delay').show(20)
Actual Evidence
| Origin | Flights | Average Delay |
|---|---|---|
| HNL | 11,031 | 2.71 |
| SLC | 25,868 | 6.22 |
| PDX | 12,889 | 6.68 |
| SEA | 23,078 | 6.89 |
| MIA | 21,817 | 7.76 |
| DCA | 17,109 | 8.01 |
| CLT | 28,402 | 8.68 |
| PHX | 40,155 | 9.07 |
| BOS | 25,348 | 9.41 |
| DFW | 68,482 | 9.92 |
Key Finding
Strong performance is not limited to small airports. Several high-volume airports maintain substantially lower average delays.
El buen desempeño no se limita a aeropuertos pequeños. Varios aeropuertos de alto volumen mantienen retrasos promedio mucho menores.
Executive Interpretation
Benchmarking should include both problem locations and positive deviants.
El benchmarking debe incluir ubicaciones problemáticas y desviaciones positivas.
Business Decision
Compare high-risk airports with similar-volume strong performers.
Comparar aeropuertos de alto riesgo con buenos desempeños de volumen similar.
Top Destination Airports by Volume
Business InvestigationBusiness Question
Which airports receive the most flights?
¿Qué aeropuertos reciben más vuelos?
Why It Matters
Inbound volume helps validate network concentration and route structure.
El volumen de llegada ayuda a validar la concentración de red y la estructura de rutas.
Spark Investigation
df.groupBy('destination').count().orderBy(desc('count')).show(25)
Actual Evidence
| Destination | Flights |
|---|---|
| ATL | 90,434 |
| DFW | 66,050 |
| ORD | 61,967 |
| LAX | 53,601 |
| DEN | 50,921 |
| IAH | 42,700 |
| PHX | 39,721 |
| SFO | 38,988 |
| LAS | 32,994 |
| CLT | 28,388 |
Key Finding
The top destinations closely mirror the top origins, indicating a coherent hub-centered network.
Los principales destinos reflejan de cerca los principales orígenes, indicando una red coherente centrada en hubs.
Executive Interpretation
Network exposure is concentrated in a consistent set of major airports.
La exposición de red se concentra en un conjunto consistente de aeropuertos principales.
Business Decision
Use hub symmetry to frame route and congestion analysis.
Usar la simetría de hubs para orientar el análisis de rutas y congestión.
High-Volume Destination Performance
Executive InvestigationBusiness Question
Which high-volume destinations receive flights with the highest average delay?
¿Qué destinos de alto volumen reciben vuelos con mayor retraso promedio?
Why It Matters
Origin and destination views may reveal different operational pressure points.
Las vistas de origen y destino pueden revelar distintos puntos de presión operacional.
Spark Investigation
df.groupBy('destination').agg(
count('*').alias('Flights'), avg('delay').alias('Average Delay')
).filter('Flights >= 10000').orderBy(desc('Average Delay')).show(30)
Actual Evidence
| Destination | Flights | Average Delay |
|---|---|---|
| SFO | 38,988 | 16.29 |
| EWR | 27,652 | 16.11 |
| FLL | 17,864 | 15.27 |
| BNA | 13,606 | 14.98 |
| MCI | 10,815 | 14.91 |
| OAK | 10,028 | 14.83 |
| JFK | 23,484 | 14.72 |
| IAD | 14,125 | 14.70 |
| STL | 12,113 | 14.40 |
| LGA | 25,469 | 14.35 |
Key Finding
SFO and EWR appear prominently in destination delay exposure and later reappear in critical routes.
SFO y EWR aparecen de forma prominente en la exposición de retrasos como destino y luego reaparecen en rutas críticas.
Executive Interpretation
Repeated appearance across dimensions strengthens the evidence that these locations deserve attention.
La aparición repetida en distintas dimensiones fortalece la evidencia de que estas ubicaciones merecen atención.
Business Decision
Trace high-delay destinations back to major origins and routes.
Rastrear destinos de alto retraso hacia orígenes y rutas principales.
Most Frequent Routes
Business InvestigationBusiness Question
Which origin-destination pairs carry the most traffic?
¿Qué pares origen-destino transportan más tráfico?
Why It Matters
Route volume identifies where operational changes can affect the largest number of flights.
El volumen de ruta identifica dónde los cambios operacionales pueden afectar más vuelos.
Spark Investigation
df.groupBy('origin','destination').agg(
count('*').alias('Flights')
).orderBy(desc('Flights')).show(30)
Actual Evidence
| Route | Flights |
|---|---|
| SFO → LAX | 3,232 |
| LAX → SFO | 3,198 |
| LAS → LAX | 3,016 |
| LAX → LAS | 2,964 |
| JFK → LAX | 2,720 |
| LAX → JFK | 2,719 |
| ATL → LGA | 2,501 |
| LGA → ATL | 2,500 |
| LAX → PHX | 2,394 |
| PHX → LAX | 2,387 |
Key Finding
The network contains highly reciprocal high-volume corridors, especially around LAX and SFO.
La red contiene corredores recíprocos de alto volumen, especialmente alrededor de LAX y SFO.
Executive Interpretation
Route pairs, not only airports, are necessary units of operational investigation.
Los pares de rutas, no solo los aeropuertos, son unidades necesarias de investigación operacional.
Business Decision
Evaluate both route impact and route risk.
Evaluar tanto impacto como riesgo de ruta.
Critical Routes by Average Delay
Business InvestigationBusiness Question
Which routes with at least 1,000 flights have the highest average delay?
¿Qué rutas con al menos 1,000 vuelos tienen el mayor retraso promedio?
Why It Matters
A minimum volume avoids unstable rankings while preserving meaningful corridors.
Un volumen mínimo evita rankings inestables y conserva corredores significativos.
Spark Investigation
df.groupBy('origin','destination').agg(
count('*').alias('Flights'), avg('delay').alias('Average Delay')
).filter('Flights >= 1000').orderBy(desc('Average Delay')).show(30)
Actual Evidence
| Route | Flights | Average Delay |
|---|---|---|
| ORD → IAH | 1,363 | 25.40 |
| FLL → JFK | 1,134 | 24.80 |
| ORD → CLE | 1,226 | 24.23 |
| ORD → SFO | 1,731 | 24.06 |
| ORD → DEN | 1,021 | 23.12 |
| JFK → FLL | 1,131 | 23.08 |
| FLL → LGA | 1,022 | 22.75 |
| EWR → SFO | 1,122 | 21.37 |
Key Finding
ORD appears repeatedly among high-volume, high-delay routes, reinforcing its selection for root-cause investigation.
ORD aparece repetidamente entre rutas de alto volumen y alto retraso, reforzando su selección para análisis de causa raíz.
Executive Interpretation
Repeated route-level evidence is stronger than a single airport average.
La evidencia repetida a nivel de ruta es más fuerte que un solo promedio aeroportuario.
Business Decision
Create an ORD route case file.
Crear un expediente de rutas de ORD.
Distance Profile
Statistical InvestigationBusiness Question
What is the range of route distances?
¿Cuál es el rango de distancias de ruta?
Why It Matters
Understanding the explanatory variable precedes testing its relationship with delay.
Comprender la variable explicativa precede probar su relación con retraso.
Spark Investigation
df.select(
min('distance').alias('Minimum Distance'),
avg('distance').alias('Average Distance'),
max('distance').alias('Maximum Distance')
).show()
Actual Evidence
| Minimum | Average | Maximum |
|---|---|---|
| 21 miles | 690.55 miles | 4,330 miles |
Key Finding
The dataset spans very short and very long flights, providing enough variation to test the distance hypothesis.
El dataset cubre vuelos muy cortos y muy largos, proporcionando variación suficiente para probar la hipótesis de distancia.
Executive Interpretation
A broad range does not itself imply explanatory power.
Un rango amplio no implica por sí mismo poder explicativo.
Business Decision
Calculate correlation before claiming that long flights are more delayed.
Calcular correlación antes de afirmar que los vuelos largos se retrasan más.
Distance–Delay Correlation
Statistical InvestigationBusiness Question
Does flight distance explain delay?
¿Explica la distancia del vuelo el retraso?
Why It Matters
The hypothesis must be tested rather than assumed.
La hipótesis debe probarse y no suponerse.
Spark Investigation
correlation = df.stat.corr('distance','delay')
print(f'Correlation: {correlation:.4f}')
Actual Evidence
| Correlation coefficient |
|---|
| 0.0114 |
Key Finding
The linear relationship is effectively zero. Distance is not a meaningful standalone predictor of delay in this dataset.
La relación lineal es prácticamente cero. La distancia no es un predictor significativo por sí sola en este dataset.
Executive Interpretation
The original hypothesis is rejected. Attention should shift to airport, route, temporal, weather, and operational factors.
La hipótesis original se rechaza. La atención debe moverse a factores de aeropuerto, ruta, tiempo, clima y operación.
Business Decision
Do not prioritize interventions based on route length.
No priorizar intervenciones basadas en longitud de ruta.
Phase 5 — ORD Root-Cause Case File
Fase 5 — Expediente de causa raíz ORD
ORD Case File: Operational Profile
Diagnostic InvestigationBusiness Question
Why does ORD deserve a dedicated investigation?
¿Por qué ORD merece una investigación específica?
Why It Matters
ORD combines high volume, high average delay, and repeated appearance in critical routes.
ORD combina alto volumen, alto retraso promedio y aparición repetida en rutas críticas.
Spark Investigation
ord = df.filter(col('origin') == 'ORD')
ord.select(avg('delay'), stddev('delay'), count('*')).show()
Actual Evidence
| Flights | Average Delay | StdDev |
|---|---|---|
| 64,228 | 18.59 min | 41.44 min |
Key Finding
ORD operates at major-hub scale while showing both elevated delay and elevated variability.
ORD opera a escala de hub principal mostrando retraso elevado y alta variabilidad.
Executive Interpretation
The issue is not merely a few isolated events; the distribution is unstable across a large operation.
El problema no es solo unos pocos eventos aislados; la distribución es inestable en una operación grande.
Business Decision
Escalate ORD to root-cause investigation.
Escalar ORD a investigación de causa raíz.
ORD Raw Worst Destinations
Diagnostic InvestigationBusiness Question
Which ORD destinations have the highest raw average delay?
¿Qué destinos de ORD tienen el mayor retraso promedio bruto?
Why It Matters
The raw list exposes possible problem routes but must be checked for volume.
La lista bruta expone posibles rutas problemáticas pero debe verificarse por volumen.
Spark Investigation
ord.groupBy('destination').agg(
count('*').alias('Flights'), avg('delay').alias('Average Delay')
).orderBy(desc('Average Delay')).show(20)
Actual Evidence
| Destination | Flights | Average Delay |
|---|---|---|
| CHO | 13 | 51.31 |
| ROA | 64 | 38.47 |
| GUC | 8 | 36.88 |
| HNL | 104 | 36.72 |
| RAP | 7 | 34.29 |
| BOI | 54 | 33.89 |
| CAE | 250 | 33.20 |
| SCE | 168 | 32.98 |
Key Finding
Several extreme averages are based on tiny samples and cannot drive executive action.
Varios promedios extremos se basan en muestras diminutas y no pueden guiar acción ejecutiva.
Executive Interpretation
Raw rankings provide evidence discovery, not final priorities.
Los rankings brutos proporcionan descubrimiento de evidencia, no prioridades finales.
Business Decision
Apply volume thresholds and calculate both impact and risk.
Aplicar umbrales de volumen y calcular impacto y riesgo.
ORD Best Destinations
Diagnostic InvestigationBusiness Question
Which ORD destinations perform relatively well?
¿Qué destinos de ORD funcionan relativamente bien?
Why It Matters
Positive exceptions may help isolate whether the issue is airport-wide or route-specific.
Las excepciones positivas ayudan a aislar si el problema es general del aeropuerto o específico de rutas.
Spark Investigation
ord.groupBy('destination').agg(
count('*').alias('Flights'), avg('delay').alias('Average Delay')
).orderBy('Average Delay').show(20)
Actual Evidence
| Destination | Flights | Average Delay |
|---|---|---|
| PVD | 13 | 3.00 |
| RST | 168 | 5.14 |
| LSE | 61 | 6.52 |
| AZO | 158 | 6.61 |
| MBS | 259 | 7.36 |
| MKG | 180 | 8.84 |
| CHA | 90 | 9.32 |
| MSY | 185 | 10.27 |
| PIA | 1,192 | 10.36 |
Key Finding
ORD does not perform poorly on every route. Route-specific conditions matter.
ORD no funciona mal en todas las rutas. Las condiciones específicas de ruta importan.
Executive Interpretation
A single airport average hides large internal variation.
Un solo promedio aeroportuario oculta gran variación interna.
Business Decision
Compare route groups rather than treating ORD as one homogeneous operation.
Comparar grupos de rutas en vez de tratar ORD como una operación homogénea.
ORD Outlier Count
Diagnostic InvestigationBusiness Question
How many ORD flights exceed the network IQR thresholds?
¿Cuántos vuelos de ORD exceden los umbrales IQR de la red?
Why It Matters
Outlier exposure measures operational instability beyond the mean.
La exposición a outliers mide inestabilidad operacional más allá de la media.
Spark Investigation
ord.filter(col('delay') > upper_bound).count()
Actual Evidence
| ORD flights above +36 minutes |
|---|
| 11,079 initially observed; 11,082 with both-tail calculation |
Key Finding
A substantial number of ORD flights lie outside the normal network range.
Una cantidad sustancial de vuelos de ORD queda fuera del rango normal de la red.
Executive Interpretation
The complete two-tail calculation is required for an exact comparison.
Se requiere el cálculo completo de ambas colas para una comparación exacta.
Business Decision
Calculate ORD outlier rate using the same definition as the network.
Calcular la tasa de outliers de ORD usando la misma definición que la red.
ORD Outlier Rate vs Network
Executive InvestigationBusiness Question
How much more abnormal is ORD than the full network?
¿Cuánto más anormal es ORD que la red completa?
Why It Matters
A standardized comparison quantifies the operational gap.
Una comparación estandarizada cuantifica la brecha operacional.
Spark Investigation
ord_outliers = ord.filter(
(col('delay') < lower_bound) | (col('delay') > upper_bound)
).count()
Actual Evidence
| Metric | Value |
|---|---|
| ORD total flights | 64,228 |
| ORD outlier flights | 11,082 |
| ORD outlier rate | 17.25% |
| Network outlier rate | 11.65% |
| Difference | +5.61 percentage points |
Key Finding
ORD has materially greater abnormal-delay exposure than the network.
ORD tiene exposición a retrasos anormales materialmente mayor que la red.
Executive Interpretation
The evidence supports a dedicated intervention study rather than simple monitoring.
La evidencia respalda un estudio de intervención específico y no simple monitoreo.
Business Decision
Investigate which ORD routes generate the largest number and rate of delays.
Investigar qué rutas de ORD generan mayor cantidad y tasa de retrasos.
ORD Route Impact Ranking
Diagnostic InvestigationBusiness Question
Which ORD routes generate the largest number of delayed flights?
¿Qué rutas de ORD generan la mayor cantidad de vuelos retrasados?
Why It Matters
Counts measure operational impact and passenger exposure.
Los conteos miden impacto operacional y exposición de pasajeros.
Spark Investigation
ord.groupBy('destination').agg(
count('*').alias('Flights'),
avg('delay').alias('Average_Delay'),
sum(when(col('delay') > 0,1).otherwise(0)).alias('Delayed_Flights')
).filter('Flights >= 500').orderBy(desc('Delayed_Flights')).show(30)
Actual Evidence
| Route | Flights | Average Delay | Delayed Flights |
|---|---|---|---|
| ORD → LAX | 1,831 | 19.25 | 1,234 |
| ORD → SFO | 1,731 | 24.06 | 1,172 |
| ORD → IAH | 1,363 | 25.40 | 918 |
| ORD → LGA | 1,767 | 15.01 | 877 |
| ORD → DFW | 1,493 | 15.55 | 785 |
| ORD → BOS | 1,487 | 13.89 | 745 |
| ORD → DEN | 1,021 | 23.12 | 743 |
Key Finding
LAX and SFO create the greatest delayed-flight volume, while IAH and DEN combine smaller volume with more severe average delay.
LAX y SFO crean el mayor volumen de vuelos retrasados, mientras IAH y DEN combinan menor volumen con retrasos promedio más severos.
Executive Interpretation
Impact ranking and severity ranking answer different business questions.
El ranking de impacto y el de severidad responden preguntas distintas.
Business Decision
Prioritize high-impact routes, then diagnose why high-risk routes fail so often.
Priorizar rutas de alto impacto y luego diagnosticar por qué las de alto riesgo fallan con tanta frecuencia.
ORD Route Risk Ranking
Diagnostic InvestigationBusiness Question
Which ORD routes have the highest probability of delay?
¿Qué rutas de ORD tienen la mayor probabilidad de retraso?
Why It Matters
Rates reveal risk independent of route size.
Las tasas revelan riesgo independientemente del tamaño de la ruta.
Spark Investigation
ord_routes = ord.groupBy('destination').agg(
count('*').alias('Flights'),
sum(when(col('delay') > 0,1).otherwise(0)).alias('Delayed_Flights')
).filter('Flights >= 500').withColumn(
'Delay_Rate_%', round(col('Delayed_Flights')*100.0/col('Flights'),2)
).orderBy(desc('Delay_Rate_%'))
Actual Evidence
| Route | Flights | Delayed Flights | Delay Rate |
|---|---|---|---|
| ORD → DEN | 1,021 | 743 | 72.77% |
| ORD → SFO | 1,731 | 1,172 | 67.71% |
| ORD → LAX | 1,831 | 1,234 | 67.39% |
| ORD → IAH | 1,363 | 918 | 67.35% |
| ORD → TYS | 507 | 331 | 65.29% |
| ORD → IAD | 537 | 347 | 64.62% |
Key Finding
ORD → DEN has the highest risk, while ORD → LAX and ORD → SFO combine both high impact and high risk.
ORD → DEN tiene el mayor riesgo, mientras ORD → LAX y ORD → SFO combinan alto impacto y alto riesgo.
Executive Interpretation
A route can be critical because of count, rate, severity, or a combination of all three.
Una ruta puede ser crítica por conteo, tasa, severidad o una combinación de las tres.
Business Decision
Classify routes into impact-risk quadrants for intervention planning.
Clasificar rutas en cuadrantes impacto-riesgo para planificar intervenciones.
ORD Evidence Summary
Executive InvestigationBusiness Question
What does the complete ORD evidence chain demonstrate?
¿Qué demuestra la cadena completa de evidencia de ORD?
Why It Matters
An executive case file consolidates multiple independent indicators into one defensible conclusion.
Un expediente ejecutivo consolida múltiples indicadores independientes en una conclusión defendible.
Spark Investigation
# Evidence consolidation - no additional Spark action
Actual Evidence
| Evidence | Value |
|---|---|
| Traffic volume | 64,228 flights |
| Average delay | 18.59 min |
| Standard deviation | 41.44 min |
| Outlier rate | 17.25% |
| Gap vs network | +5.61 pp |
| High-impact routes | LAX, SFO, IAH, LGA |
| Highest-risk route | DEN at 72.77% |
Key Finding
ORD is a high-volume, high-delay, high-variability hub with concentrated route-level problems.
ORD es un hub de alto volumen, alto retraso y alta variabilidad con problemas concentrados a nivel de ruta.
Executive Interpretation
The convergence of independent evidence raises confidence beyond any single metric.
La convergencia de evidencia independiente eleva la confianza más allá de cualquier métrica individual.
Business Decision
Assign ORD a critical-priority root-cause workstream.
Asignar a ORD una línea de trabajo crítica de causa raíz.
ORD Root-Cause Limitation
Executive InvestigationBusiness Question
Can this dataset prove the operational cause of ORD delays?
¿Puede este dataset probar la causa operacional de los retrasos de ORD?
Why It Matters
Responsible analysis distinguishes evidence from hypotheses.
El análisis responsable distingue evidencia de hipótesis.
Spark Investigation
# No code: methodological validation
Actual Evidence
| Available evidence | Missing causal variables |
|---|---|
| Delay, route, time, distance | Weather, aircraft rotation, crew, airline, maintenance, ATC, gate, cancellations |
Key Finding
The dataset identifies where and when problems occur, but cannot prove why they occur.
El dataset identifica dónde y cuándo ocurren problemas, pero no puede probar por qué ocurren.
Executive Interpretation
Congestion and delay propagation are plausible hypotheses, not confirmed causes.
Congestión y propagación de retrasos son hipótesis plausibles, no causas confirmadas.
Business Decision
Request additional operational data before claiming causality.
Solicitar datos operacionales adicionales antes de afirmar causalidad.
Phase 6 — Data Decoding and Temporal Investigation
Fase 6 — Decodificación e investigación temporal
Date Encoding Discovery
Technical InvestigationBusiness Question
How is the seven-digit date field encoded?
¿Cómo está codificado el campo date de siete dígitos?
Why It Matters
Temporal analysis is impossible until the source encoding is understood.
El análisis temporal es imposible hasta comprender la codificación de origen.
Spark Investigation
df.select('date').show(30)
df.select('date').distinct().orderBy('date').show(30)
Actual Evidence
| Observed values |
|---|
| 1011245 |
| 1020600 |
| 1010005 |
| 1010035 |
| 3312359 |
Key Finding
The values are not standard dates or Unix timestamps. The pattern suggests compact month-day-hour-minute encoding.
Los valores no son fechas estándar ni timestamps Unix. El patrón sugiere codificación compacta mes-día-hora-minuto.
Executive Interpretation
Transformation must wait until the hypothesis is validated.
La transformación debe esperar hasta validar la hipótesis.
Business Decision
Test string length, range, and substring positions.
Probar longitud, rango y posiciones de substring.
Date Encoding Validation
Technical InvestigationBusiness Question
Do the values consistently support a MDDHHMM structure?
¿Los valores respaldan consistentemente una estructura MDDHHMM?
Why It Matters
Length and range checks validate the proposed encoding.
Las verificaciones de longitud y rango validan la codificación propuesta.
Spark Investigation
df.select(length(col('date')).alias('Length')).distinct().show()
df.select(min('date').alias('Minimum'), max('date').alias('Maximum')).show()
Actual Evidence
| Check | Result |
|---|---|
| Length | 7 characters for every row |
| Minimum | 1010005 |
| Maximum | 3312359 |
Key Finding
The seven-digit length and the maximum value 3312359 are consistent with month 3, day 31, hour 23, minute 59.
La longitud de siete dígitos y el máximo 3312359 son consistentes con mes 3, día 31, hora 23, minuto 59.
Executive Interpretation
The encoding hypothesis is strong enough for direct substring validation.
La hipótesis de codificación es suficientemente fuerte para validación directa por substring.
Business Decision
Extract month, day, hour, and minute and inspect real rows.
Extraer mes, día, hora y minuto e inspeccionar filas reales.
Date Successfully Decoded
Technical InvestigationBusiness Question
Does direct extraction produce valid temporal components?
¿La extracción directa produce componentes temporales válidos?
Why It Matters
A successful decode unlocks all time-based business investigation.
Una decodificación exitosa desbloquea toda investigación temporal.
Spark Investigation
df.select(
'date',
substring(col('date'),1,1).alias('Month'),
substring(col('date'),2,2).alias('Day'),
substring(col('date'),4,2).alias('Hour'),
substring(col('date'),6,2).alias('Minute')
).show(50)
Actual Evidence
| date | Month | Day | Hour | Minute |
|---|---|---|---|---|
| 1011245 | 1 | 01 | 12 | 45 |
| 1020600 | 1 | 02 | 06 | 00 |
| 1030605 | 1 | 03 | 06 | 05 |
| 1061725 | 1 | 06 | 17 | 25 |
Key Finding
The field is confirmed as MDDHHMM: month, day, hour, minute, with no year.
El campo queda confirmado como MDDHHMM: mes, día, hora y minuto, sin año.
Executive Interpretation
Column names must never substitute for semantic validation.
Los nombres de columnas nunca deben sustituir la validación semántica.
Business Decision
Create reusable Month, Day, Hour, and Minute columns.
Crear columnas reutilizables Month, Day, Hour y Minute.
Temporal Feature Engineering
Technical InvestigationBusiness Question
How should reusable temporal attributes be created?
¿Cómo deben crearse atributos temporales reutilizables?
Why It Matters
A stable transformed DataFrame supports all later temporal KPIs.
Un DataFrame transformado estable soporta todos los KPIs temporales posteriores.
Spark Investigation
df_time = (df
.withColumn('Month', substring(col('date'),1,1))
.withColumn('Day', substring(col('date'),2,2))
.withColumn('Hour', substring(col('date'),4,2))
.withColumn('Minute', substring(col('date'),6,2))
)
Actual Evidence
| New analytical fields |
|---|
| Month |
| Day |
| Hour |
| Minute |
Key Finding
The original data is preserved while normalized analytical features are added.
Los datos originales se preservan mientras se agregan atributos analíticos normalizados.
Executive Interpretation
This is a non-destructive transformation suitable for reproducible pipelines.
Esta es una transformación no destructiva adecuada para pipelines reproducibles.
Business Decision
Use df_time as the temporal analysis layer.
Usar df_time como capa de análisis temporal.
Flight Volume by Hour
Business InvestigationBusiness Question
At what hours does the network operate the most departures?
¿En qué horas opera la red la mayor cantidad de salidas?
Why It Matters
Hourly volume provides the denominator required to interpret delay rates.
El volumen por hora proporciona el denominador necesario para interpretar tasas de retraso.
Spark Investigation
df_time.groupBy('Hour').agg(count('*').alias('Flights')).orderBy('Hour').show(24)
Actual Evidence
| Hour | Flights |
|---|---|
| 00 | 1,890 |
| 01 | 764 |
| 02 | 187 |
| 03 | 46 |
| 04 | 113 |
| 05 | 15,754 |
| 06 | 92,665 |
| 07 | 93,047 |
| 08 | 100,958 |
| 09 | 83,916 |
| 10 | 89,829 |
| 11 | 90,956 |
| 12 | 86,792 |
| 13 | 90,253 |
| 14 | 87,876 |
| 15 | 84,801 |
| 16 | 84,974 |
| 17 | 99,761 |
Key Finding
Operations are minimal from 02:00–04:00, ramp sharply at 05:00, and remain very high through the day.
Las operaciones son mínimas de 02:00–04:00, aumentan bruscamente a las 05:00 y permanecen muy altas durante el día.
Executive Interpretation
Low-volume night hours should not be compared directly with major daytime windows.
Las horas nocturnas de bajo volumen no deben compararse directamente con ventanas diurnas principales.
Business Decision
Apply minimum-volume rules to hourly risk ranking.
Aplicar reglas de volumen mínimo al ranking de riesgo por hora.
Average Delay by Hour
Diagnostic InvestigationBusiness Question
How does average delay evolve during the operating day?
¿Cómo evoluciona el retraso promedio durante el día operacional?
Why It Matters
A temporal trend can reveal accumulation rather than isolated peaks.
Una tendencia temporal puede revelar acumulación en lugar de picos aislados.
Spark Investigation
df_time.groupBy('Hour').agg(
count('*').alias('Flights'), avg('delay').alias('Average_Delay')
).orderBy('Hour').show(24)
Actual Evidence
| Hour | Flights | Average Delay |
|---|---|---|
| 06 | 92,665 | 3.43 |
| 07 | 93,047 | 4.67 |
| 08 | 100,958 | 6.66 |
| 09 | 83,916 | 8.45 |
| 10 | 89,829 | 9.82 |
| 11 | 90,956 | 10.89 |
| 12 | 86,792 | 12.58 |
| 13 | 90,253 | 13.44 |
| 14 | 87,876 | 14.94 |
| 15 | 84,801 | 15.69 |
| 16 | 84,974 | 16.38 |
| 17 | 99,761 | 16.36 |
Key Finding
Average delay rises almost continuously from early morning into the afternoon.
El retraso promedio aumenta casi continuamente desde temprano en la mañana hasta la tarde.
Executive Interpretation
The pattern is consistent with delay accumulation, but the dataset cannot prove the mechanism.
El patrón es consistente con acumulación de retrasos, pero el dataset no puede probar el mecanismo.
Business Decision
Validate the pattern using delay rates, not averages alone.
Validar el patrón usando tasas de retraso, no solo promedios.
Delay Rate and Peak Risk Hours
Executive InvestigationBusiness Question
During which high-volume hours is a flight most likely to be delayed?
¿Durante qué horas de alto volumen es más probable que un vuelo se retrase?
Why It Matters
Combining counts, averages, and rates produces an operational risk view.
Combinar conteos, promedios y tasas produce una vista de riesgo operacional.
Spark Investigation
hourly_performance = df_time.groupBy('Hour').agg(
count('*').alias('Flights'),
avg('delay').alias('Average_Delay'),
sum(when(col('delay') > 0,1).otherwise(0)).alias('Delayed_Flights')
).withColumn('Delay_Rate_%',round(col('Delayed_Flights')*100.0/col('Flights'),2))
hourly_performance.filter(col('Flights') >= 10000).orderBy(desc('Delay_Rate_%')).show(24)
Actual Evidence
| Hour | Flights | Avg Delay | Delay Rate |
|---|---|---|---|
| 19 | 81,359 | 17.78 | 52.48% |
| 20 | 58,159 | 17.51 | 52.44% |
| 16 | 84,974 | 16.38 | 51.65% |
| 21 | 41,248 | 17.71 | 51.21% |
| 18 | 80,254 | 17.54 | 51.21% |
| 15 | 84,801 | 15.69 | 50.86% |
| 17 | 99,761 | 16.36 | 50.43% |
| 14 | 87,876 | 14.94 | 50.19% |
Key Finding
From 14:00 through 21:00, more than half of flights are delayed in several high-volume hours.
De 14:00 a 21:00, más de la mitad de los vuelos se retrasa en varias horas de alto volumen.
Executive Interpretation
The afternoon-evening window is the network’s clearest operational risk period.
La ventana tarde-noche es el período de riesgo operacional más claro de la red.
Business Decision
Focus resource, schedule-buffer, and recovery analysis on 14:00–21:00.
Concentrar análisis de recursos, buffers de programación y recuperación entre 14:00–21:00.
Phase 7 — Executive Decision Modeling
Fase 7 — Modelado de decisiones ejecutivas
Airports Driving the Critical Window
Diagnostic InvestigationBusiness Question
Which origin airports contribute most to poor performance from 14:00 to 21:00?
¿Qué aeropuertos de origen contribuyen más al mal desempeño entre 14:00 y 21:00?
Why It Matters
The previous investigation identified when the problem occurs; this one identifies where it is concentrated.
La investigación anterior identificó cuándo ocurre el problema; esta identifica dónde se concentra.
Spark Investigation
afternoon = df_time.filter(col('Hour').isin('14','15','16','17','18','19','20','21'))
afternoon.groupBy('origin').agg(
count('*').alias('Flights'), avg('delay').alias('Average_Delay')
).filter('Flights >= 1000').orderBy(desc('Average_Delay')).show(30)
Actual Evidence
| Origin | Flights | Average Delay |
|---|---|---|
| MDW | 9,692 | 26.27 |
| PBI | 1,286 | 24.61 |
| FLL | 8,355 | 24.42 |
| OAK | 4,155 | 24.06 |
| DAL | 5,300 | 23.89 |
| BWI | 10,703 | 23.86 |
| HOU | 7,184 | 23.44 |
| BNA | 5,703 | 22.88 |
| ORD | 31,725 | 22.81 |
| MCO | 13,108 | 22.72 |
Key Finding
MDW has the worst average, but ORD carries more than three times the critical-window volume.
MDW tiene el peor promedio, pero ORD transporta más de tres veces el volumen en la ventana crítica.
Executive Interpretation
Average severity and operational exposure must be evaluated together.
La severidad promedio y la exposición operacional deben evaluarse juntas.
Business Decision
Build a transparent priority index, clearly labeled as a case-specific decision model.
Construir un índice transparente de prioridad, claramente etiquetado como modelo decisional específico del caso.
Executive Priority Index
Prescriptive InvestigationBusiness Question
If resources are limited, where could intervention produce the largest initial operational impact?
Si los recursos son limitados, ¿dónde podría una intervención producir el mayor impacto operacional inicial?
Why It Matters
A decision model combines volume and performance rather than ranking a single KPI.
Un modelo de decisión combina volumen y desempeño en vez de clasificar un solo KPI.
Spark Investigation
afternoon_priority = afternoon.groupBy('origin').agg(
count('*').alias('Flights'), avg('delay').alias('Average_Delay')
).filter('Flights >= 1000').withColumn(
'Priority_Index', round(col('Flights') * col('Average_Delay'),0)
).orderBy(desc('Priority_Index'))
Actual Evidence
| Origin | Flights | Average Delay | Priority Index |
|---|---|---|---|
| ATL | 47,330 | 15.64 | 740,028 |
| ORD | 31,725 | 22.81 | 723,686 |
| DEN | 25,328 | 21.15 | 535,679 |
| DFW | 34,121 | 12.35 | 421,553 |
| IAH | 21,649 | 16.64 | 360,242 |
| MCO | 13,108 | 22.72 | 297,849 |
| EWR | 13,504 | 21.51 | 290,530 |
| LAS | 13,927 | 20.66 | 287,694 |
| LAX | 20,913 | 13.76 | 287,688 |
| SFO | 14,672 | 18.01 | 264,244 |
Key Finding
ATL ranks first because of extreme volume; ORD nearly matches it because of a much worse delay average. DEN is the next clear target.
ATL ocupa el primer lugar por volumen extremo; ORD casi lo iguala por un promedio de retraso mucho peor. DEN es el siguiente objetivo claro.
Executive Interpretation
This is a prioritization index, not an industry standard KPI. It approximates exposure in delayed-minutes without passenger or cost data.
Este es un índice de priorización, no un KPI estándar de la industria. Aproxima exposición en minutos de retraso sin datos de pasajeros o costos.
Business Decision
Prioritize detailed workstreams for ATL, ORD, and DEN, while requesting passenger and cost data to refine the model.
Priorizar líneas de trabajo detalladas para ATL, ORD y DEN, solicitando datos de pasajeros y costos para refinar el modelo.
Evidence & Findings Register
| ID | English Finding | Hallazgo en español |
|---|---|---|
| F01 | The dataset contains 1,391,578 flight events and no null values. | El dataset contiene 1,391,578 eventos de vuelo y no tiene valores nulos. |
| F02 | 507 duplicate-looking rows cannot be confirmed as errors because no unique flight key exists. | 507 filas aparentemente duplicadas no pueden confirmarse como errores porque no existe una llave única de vuelo. |
| F03 | Median delay is 0 minutes while mean delay is 12.08 minutes; the mean is tail-sensitive. | La mediana es 0 minutos mientras la media es 12.08; la media es sensible a la cola. |
| F04 | 11.65% of network flights fall outside IQR bounds; abnormal behavior is material. | 11.65% de los vuelos de la red cae fuera de los límites IQR; el comportamiento anormal es material. |
| F05 | Distance has virtually no linear relationship with delay (r = 0.0114). | La distancia casi no tiene relación lineal con retraso (r = 0.0114). |
| F06 | ORD is a high-volume, high-delay, high-variability hub with a 17.25% outlier rate. | ORD es un hub de alto volumen, alto retraso y alta variabilidad con una tasa de outliers de 17.25%. |
| F07 | ORD → LAX and ORD → SFO combine high delayed-flight counts with delay rates above 67%. | ORD → LAX y ORD → SFO combinan altos conteos de vuelos retrasados con tasas superiores a 67%. |
| F08 | The date field is MDDHHMM, not a standard date; decoding was required before temporal analysis. | El campo date es MDDHHMM, no una fecha estándar; se requirió decodificación antes del análisis temporal. |
| F09 | Delay rises through the day; several hours from 14:00–21:00 exceed a 50% delay rate. | El retraso aumenta durante el día; varias horas entre 14:00–21:00 superan 50% de tasa de retraso. |
| F10 | The case-specific priority index ranks ATL, ORD, and DEN as the leading initial intervention targets. | El índice de prioridad específico del caso clasifica ATL, ORD y DEN como principales objetivos iniciales de intervención. |
Executive Recommendations
Recomendaciones ejecutivas
Priority 1 — Critical-window operations
Launch focused diagnostics for ATL, ORD, and DEN during 14:00–21:00. Measure route, aircraft, crew, gate, weather, and turnaround contributors.
Lanzar diagnósticos focalizados para ATL, ORD y DEN entre 14:00–21:00. Medir contribuyentes de ruta, aeronave, tripulación, puerta, clima y turnaround.
Priority 2 — ORD route workstream
Investigate ORD→DEN for risk, ORD→LAX and ORD→SFO for combined risk and impact, and compare them with strong ORD routes.
Investigar ORD→DEN por riesgo, ORD→LAX y ORD→SFO por riesgo e impacto combinados, y compararlas con rutas fuertes de ORD.
Priority 3 — KPI redesign
Do not report average delay alone. Combine median, P90/P95/P99, delay rate, outlier rate, volume, and critical-delay exposure.
No reportar solo retraso promedio. Combinar mediana, P90/P95/P99, tasa de retraso, tasa de outliers, volumen y exposición a retrasos críticos.
Priority 4 — Better causal data
Acquire flight ID, carrier, aircraft rotation, scheduled vs actual times, cancellations, weather, gate, crew, maintenance, passenger, and cost data.
Obtener Flight ID, aerolínea, rotación de aeronave, tiempos programados vs reales, cancelaciones, clima, puerta, tripulación, mantenimiento, pasajeros y costos.
Limitations and Governance
- The dataset has no year, carrier, flight number, aircraft, passenger, cost, weather, cancellation, gate, or crew fields.
- Duplicate-looking rows were retained because the available fields do not form a guaranteed unique business key.
- IQR defines statistical outliers, not operational failures.
- The Priority Index is a transparent case-specific model, not an industry benchmark.
- Correlation does not establish causation, and the absence of linear correlation does not rule out nonlinear or interaction effects.
Next Investigation Queue — Same Business Case
Próxima cola de investigación — Mismo caso de negocio
- Monthly and day-of-month volume and delay patterns.
- Hour × origin and hour × route heatmaps.
- Pareto analysis: airports and routes generating 80% of delayed minutes.
- Critical-delay exposure above 60, 120, and 180 minutes.
- Early-departure outlier investigation below −28 minutes.
- Outlier concentration by airport, route, and critical window.
- Volume-risk-impact quadrant classification.
- Comparison of ATL, ORD, DEN, and strong benchmark hubs.
- Delta table persistence and Spark SQL reproduction.
- Power BI executive dashboard and final project-manager action plan.
Final Validated Script — Current Evidence Set
This integrated script reproduces the completed investigations through the current decision-modeling phase.
Este script integrado reproduce las investigaciones completadas hasta la fase actual de modelado de decisiones.
# ============================================================
# BUSINESS INVESTIGATION #1 — FINAL VALIDATED SCRIPT (CURRENT)
# Airline Operational Performance | Databricks + Apache Spark
# ============================================================
from pyspark.sql.functions import (
col, sum, when, min, max, avg, stddev, count, desc,
round, substring, length
)
# Load data
df = spark.read.csv(
"/databricks-datasets/learning-spark-v2/flights/departuredelays.csv",
header=True,
inferSchema=True
)
# Reconnaissance
total_records = df.count()
df.printSchema()
df.show(10, truncate=False)
# Nulls
df.select([
sum(when(col(c).isNull(), 1).otherwise(0)).alias(c)
for c in df.columns
]).show()
# Duplicate-looking rows
unique_records = df.distinct().count()
print(f"Total: {total_records:,}")
print(f"Unique: {unique_records:,}")
print(f"Duplicate-looking: {total_records - unique_records:,}")
# Core statistics
df.select(min('delay'), avg('delay'), max('delay'), stddev('delay')).show()
percentiles = df.approxQuantile('delay',[0.25,0.50,0.75,0.90,0.95,0.99],0.001)
print(percentiles)
q1, q3 = percentiles[0], percentiles[2]
iqr = q3 - q1
lower_bound = q1 - 1.5 * iqr
upper_bound = q3 + 1.5 * iqr
outlier_count = df.filter((col('delay') < lower_bound) | (col('delay') > upper_bound)).count()
print(f"Outlier rate: {outlier_count / total_records * 100:.2f}%")
# Status and severity
df_status = df.withColumn('flight_status',
when(col('delay') < 0,'Early').when(col('delay') == 0,'On Time').otherwise('Delayed')
)
df_status.groupBy('flight_status').count().show()
# Airports and routes
airport_performance = df.groupBy('origin').agg(
count('*').alias('Flights'), avg('delay').alias('Average_Delay')
).filter('Flights >= 10000')
airport_performance.orderBy(desc('Average_Delay')).show(30, truncate=False)
df.groupBy('origin','destination').agg(
count('*').alias('Flights'), avg('delay').alias('Average_Delay')
).filter('Flights >= 1000').orderBy(desc('Average_Delay')).show(30, truncate=False)
print(f"Distance-delay correlation: {df.stat.corr('distance','delay'):.4f}")
# ORD case file
ord = df.filter(col('origin') == 'ORD')
ord_total = ord.count()
ord_outliers = ord.filter((col('delay') < lower_bound) | (col('delay') > upper_bound)).count()
print(f"ORD outlier rate: {ord_outliers / ord_total * 100:.2f}%")
ord_routes = ord.groupBy('destination').agg(
count('*').alias('Flights'),
avg('delay').alias('Average_Delay'),
sum(when(col('delay') > 0,1).otherwise(0)).alias('Delayed_Flights')
).filter('Flights >= 500').withColumn(
'Delay_Rate_%', round(col('Delayed_Flights') * 100.0 / col('Flights'),2)
)
ord_routes.orderBy(desc('Delayed_Flights')).show(30, truncate=False)
ord_routes.orderBy(desc('Delay_Rate_%')).show(30, truncate=False)
# Decode MDDHHMM date field
df_time = (df
.withColumn('Month', substring(col('date'),1,1))
.withColumn('Day', substring(col('date'),2,2))
.withColumn('Hour', substring(col('date'),4,2))
.withColumn('Minute', substring(col('date'),6,2))
)
hourly_performance = df_time.groupBy('Hour').agg(
count('*').alias('Flights'),
avg('delay').alias('Average_Delay'),
sum(when(col('delay') > 0,1).otherwise(0)).alias('Delayed_Flights')
).withColumn(
'Delay_Rate_%', round(col('Delayed_Flights') * 100.0 / col('Flights'),2)
)
hourly_performance.filter(col('Flights') >= 10000).orderBy(desc('Delay_Rate_%')).show(24, truncate=False)
# Critical window and priority index
afternoon = df_time.filter(col('Hour').isin('14','15','16','17','18','19','20','21'))
afternoon_priority = afternoon.groupBy('origin').agg(
count('*').alias('Flights'), avg('delay').alias('Average_Delay')
).filter('Flights >= 1000').withColumn(
'Priority_Index', round(col('Flights') * col('Average_Delay'),0)
).orderBy(desc('Priority_Index'))
afternoon_priority.show(30, truncate=False)