1a
Run the cell under Step 1. It prints the schema and the first five rows. Find dep_delay in both. Which values mean that a flight left early, and which mean that it was cancelled? Write the answer in a comment.
Hint 1
Look at the sign of the numbers, and at the rows that show null.
Check your output
root
|-- flight_date: date (nullable = true)
|-- carrier: string (nullable = true)
|-- flight_number: integer (nullable = true)
|-- tail_number: string (nullable = true)
|-- origin: string (nullable = true)
|-- dest: string (nullable = true)
|-- dep_delay: double (nullable = true)
...
+-----------+-------+-------------+-----------+------+----+---------+...
|flight_date|carrier|flight_number|tail_number|origin|dest|dep_delay|...
+-----------+-------+-------------+-----------+------+----+---------+...
| ...| ...| ...| ...| ...| ...| ...|...
+-----------+-------+-------------+-----------+------+----+---------+...
only showing top 5 rowsThe schema continues with the remaining columns, and the rows depend on the data set you loaded.
Show solutionHide solution
flights.printSchema()
flights.show(5)
# dep_delay is negative when a flight left early, and null when it was cancelled.
# Both matter in step 4.