Sección 1. Capítulo 4
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:
- Count how many rows have null
Delayin the original dataset – store innull_delay_count; - Fill nulls in
DelayandLengthwith0– store the cleaned DataFrame incleaned_df; - Remove duplicate rows based on
Airline,Flight, andDayOfWeek– updatecleaned_df; - Add a
TimeOfDaycolumn:"morning"ifTime < 720, otherwise"afternoon"– updatecleaned_df; - Count the number of rows in
cleaned_df– store incleaned_count.
Print all results.
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 1. Capítulo 4
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla