Panda dataframes codes
Budget: $10 – $30 USD
Datasets
You will work with two datasets that contain information on airline passengers. The first dataset includes information on gender, customer type, age, type of travel, and travel class, and the flight distance of the journey for 200 passengers from a single flight. The same passengers were given a satisfaction survey on various aspects of a flight such as food and drink, baggage handling, cleanliness, and inflight service. The second dataset includes the results of the satisfaction survey on a scale of 1 to 5, where 5 is most satisfied and 1 is least satisfied. Please note that passengers are identified by their IDs, and the same passengers appear in both datasets.
Dataset_1:
https://drive.google.com/file/d/1QIeScvup4dV99vnyjDtgnO_hGmMV81uH/view?usp=sharing
Variables:
· id: Passenger ID
· Gender: Gender of the passengers (Female, male)
· Customer type: The customer type (Loyal customer, disloyal customer)
· Age: The actual age of the passengers
· Type of travel: Purpose of the flight of the passengers (Personal travel, Business travel)
· Class: Travel class in the plane (Business, Eco, Eco plus)
· Flight distance: The flight distance of this journey
Dataset_2:
https://drive.google.com/file/d/1yxALd8Z-LywDXo7LfboyccwTjYMs8JoQ/view?usp=sharing
Variables:
· id: Passenger ID
· Departure/Arrival time convenient: Satisfaction level with the departure and arrival times
· Ease of online booking: Satisfaction level with online booking
· Food and drink: Satisfaction level with food and drink
· Seat comfort: Satisfaction level with seats
· Inflight entertainment: Satisfaction level with inflight entertainment
· Baggage handling: Satisfaction level with baggage handling
· Inflight service: Satisfaction level with inflight service
· Cleanliness: Satisfaction level with cleanliness
PART 1. Description of the Datasets and Operations on Data Frames
· Write a code that (a) returns the number of rows and columns for each dataset and (b) merges the two datasets on columns using an appropriate variable, (c) sorts the merged dataset on Flight Distance.
· Write a code to create a data frame that includes the following cases: 10 economy (Eco) class passengers with the longest flight distance, 10 Eco class passengers with the shortest flight distance, 10 Business class passengers with the longest flight distance, and 10 Business class passengers with the shortest flight distance. Based on this data frame explain how the flight distances differ between Business and Eco class passengers.
PART 2. Data Analyses and Visualizations
· Devise an algorithm (Algorithm #1) that calculates the correlations between Age and all of the Satisfaction variables and returns the correlations sorted from highest to lowest. Use a Python library to plot the two lowest and two highest correlations. Provide an explanation of the output and a description of any interesting patterns observed.
Note. Include a description of your algorithmic approach
§ Describe the input(s), output(s) and the process of the algorithm.
§ Draw a flowchart to show the process of the algorithm.
· Devise an algorithm (Algorithm #2) that randomly choses 5 items from the satisfaction survey, provides the mean for male and female customers separately on each item, and then returns a comparison of the male and female customers’ means on each satisfaction item.
Note. Include a description of your algorithmic approach
§ Describe the input(s), output(s) and the process of the algorithm.
§ Draw a flowchart to show the process of the algorithm.
· Using the dataset develop a question that can be answered using a pie chart and/or a bar graph. Answer the question by providing both the pie chart and the bar graph using a Python library and explain which graph would be a better choice.
You will work with two datasets that contain information on airline passengers. The first dataset includes information on gender, customer type, age, type of travel, and travel class, and the flight distance of the journey for 200 passengers from a single flight. The same passengers were given a satisfaction survey on various aspects of a flight such as food and drink, baggage handling, cleanliness, and inflight service. The second dataset includes the results of the satisfaction survey on a scale of 1 to 5, where 5 is most satisfied and 1 is least satisfied. Please note that passengers are identified by their IDs, and the same passengers appear in both datasets.
Dataset_1:
https://drive.google.com/file/d/1QIeScvup4dV99vnyjDtgnO_hGmMV81uH/view?usp=sharing
Variables:
· id: Passenger ID
· Gender: Gender of the passengers (Female, male)
· Customer type: The customer type (Loyal customer, disloyal customer)
· Age: The actual age of the passengers
· Type of travel: Purpose of the flight of the passengers (Personal travel, Business travel)
· Class: Travel class in the plane (Business, Eco, Eco plus)
· Flight distance: The flight distance of this journey
Dataset_2:
https://drive.google.com/file/d/1yxALd8Z-LywDXo7LfboyccwTjYMs8JoQ/view?usp=sharing
Variables:
· id: Passenger ID
· Departure/Arrival time convenient: Satisfaction level with the departure and arrival times
· Ease of online booking: Satisfaction level with online booking
· Food and drink: Satisfaction level with food and drink
· Seat comfort: Satisfaction level with seats
· Inflight entertainment: Satisfaction level with inflight entertainment
· Baggage handling: Satisfaction level with baggage handling
· Inflight service: Satisfaction level with inflight service
· Cleanliness: Satisfaction level with cleanliness
PART 1. Description of the Datasets and Operations on Data Frames
· Write a code that (a) returns the number of rows and columns for each dataset and (b) merges the two datasets on columns using an appropriate variable, (c) sorts the merged dataset on Flight Distance.
· Write a code to create a data frame that includes the following cases: 10 economy (Eco) class passengers with the longest flight distance, 10 Eco class passengers with the shortest flight distance, 10 Business class passengers with the longest flight distance, and 10 Business class passengers with the shortest flight distance. Based on this data frame explain how the flight distances differ between Business and Eco class passengers.
PART 2. Data Analyses and Visualizations
· Devise an algorithm (Algorithm #1) that calculates the correlations between Age and all of the Satisfaction variables and returns the correlations sorted from highest to lowest. Use a Python library to plot the two lowest and two highest correlations. Provide an explanation of the output and a description of any interesting patterns observed.
Note. Include a description of your algorithmic approach
§ Describe the input(s), output(s) and the process of the algorithm.
§ Draw a flowchart to show the process of the algorithm.
· Devise an algorithm (Algorithm #2) that randomly choses 5 items from the satisfaction survey, provides the mean for male and female customers separately on each item, and then returns a comparison of the male and female customers’ means on each satisfaction item.
Note. Include a description of your algorithmic approach
§ Describe the input(s), output(s) and the process of the algorithm.
§ Draw a flowchart to show the process of the algorithm.
· Using the dataset develop a question that can be answered using a pie chart and/or a bar graph. Answer the question by providing both the pie chart and the bar graph using a Python library and explain which graph would be a better choice.