Professional Documents
Culture Documents
Model QP
Model QP
2. Load the Dataset “Airline_Dataset.csv” and perform the following operations on it.
a. Check if the dataset has any null value
b. Display the gender of passengers using appropriate plot.
genderdata=Airline_data['Gender'].value_counts()
genderdata.values.tolist()
genderindex=['Male', 'Female']
plt.bar(genderindex,genderdata)
plt.show()
genderdata=Airline_data['Gender'].value_counts()
genderdata.values.tolist()
genderindex=['Male', 'Female']
plt.bar(genderindex,genderdata)
plt.show()
3. Load the Dataset “Airline_Dataset.csv” and perform the following operations on it.
a. Display the nations of all passengers.
b. Display the top five nations that have maximum passengers using bar chart.
Nationalitydata=Airline_data['Nationality'].value_counts().nlargest(5)
Nationalitydata.values.tolist()
Nationalitydataindex=Airline_data['Nationality'].unique()
plt.bar(Nationalitydataindex[0:5],Nationalitydata)
plt.show()
4. Load the Dataset “Airline_Dataset.csv” and perform the following operations on it.
a. Display the names of all pilots.
b. Display the count of passengers from each country
c. Display the number of male and female passengers from each nation
Airline_data['Pilot Name'].value_counts
Airline_data['Nationality'].value_counts()
Airline_data.groupby(['Nationality','Gender']).size()