Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Challenge: Cleaning a Real-World Dataset | Section
Data Processing with PySpark
Abschnitt 1. Kapitel 4
single

single

Challenge: Cleaning a Real-World Dataset

Swipe um das Menü anzuzeigen

Aufgabe

Wischen, um mit dem Codieren zu beginnen

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.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 4
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

some-alt