IniziaInizia gratis

Finding consistency

In this exercise and throughout this chapter, you'll be working with the airlines DataFrame which contains survey responses on the San Francisco Airport from airline customers.

The DataFrame contains flight metadata such as the airline, the destination, waiting times as well as answers to key questions regarding cleanliness, safety, and satisfaction. Another DataFrame named categories was created, containing all correct possible values for the survey columns.

In this exercise, you will use both of these DataFrames to find survey answers with inconsistent values, and drop them, effectively performing an outer and inner join on both these DataFrames as seen in the video exercise. The pandas package has been imported as pd, and the airlines and categories DataFrames are in your environment.

Questo esercizio fa parte del corso

Cleaning Data in Python

Visualizza il corso

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Print categories DataFrame
print(____)

# Print unique values of survey columns in airlines
print('Cleanliness: ', airlines['cleanliness'].____, "\n")
print('Safety: ', ____, "\n")
print('Satisfaction: ', ____, "\n")
Modifica ed esegui il codice