Sezione 1. Capitolo 4
single
Challenge: Cleaning a Real-World Dataset
Scorri per mostrare il menu
Compito
Scorri per iniziare a programmare
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.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 1. Capitolo 4
single
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione