Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: Cleaning a Real-World Dataset | Section
Data Processing with PySpark
Sección 1. Capítulo 4
single

single

Challenge: Cleaning a Real-World Dataset

Desliza para mostrar el menú

Tarea

Desliza para comenzar a programar

You are given a flights dataset as a list of rows. Load it into a DataFrame using createDataFrame and clean it using the techniques from the previous chapters. Store results in the specified variables:

  1. Count how many rows have null Delay in the original dataset – store in null_delay_count;
  2. Fill nulls in Delay and Length with 0 – store the cleaned DataFrame in cleaned_df;
  3. Remove duplicate rows based on Airline, Flight, and DayOfWeek – update cleaned_df;
  4. Add a TimeOfDay column: "morning" if Time < 720, otherwise "afternoon" – update cleaned_df;
  5. Count the number of rows in cleaned_df – store in cleaned_count.

Print all results.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 4
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

some-alt