Question: Please use the 3 csv files to work with this lab activity. Aug 2 4 Delays.csv , July 2 4 Delays.csv , June 2 4
Please use the csv files to work with this lab activity. AugDelays.csv JulyDelays.csv JuneDelays.csv You will create a flight delay tracker that asks the user for origin and destination airports and airline and then prints out stats for flight delays meeting that criteria as well as a histogram of those delay distributions. To accomplish this, you'll have modules: delaymod.py create a Delay class that has global variables dfflight, origin, destination, airline and functions, including dunder functions def init and def strinit function read in the appropriate amount of csv files or and set them as your dfflight pandas dataframe str function returns Origin, Destination, Airline, and Number of Flights in a string setorigin, setdestination, setairline all take argument and filter the dfflight dataframe for that specific airportairline printstats prints out number of flights, mean and median delays, and percent of flights more than minutes late. Hint use pandas filtering and agg with count, median, mean to get these stats. plothist if your mean delay is greater than minutes, plot a red histogram; otherwise plot a green histogram. Use parameters color, bins, and densityTrue to arrange your graph similar to below. You can use pltxlim to get a more zoomed in graph. listoptions if origin then print out all of the origin airports and airlines using the pandas column and unique Otherwise else print out all of the destination airports and airlines. Shown below runapp.py set up a loop where it asks the user for origin, destination, airline, and then Enter to exit and sets those as part of a Delay object First, ask the user how many months back they want to go just Aug Aug&July June,July,Aug Convert that to an integer and use that as the argument when you create initialize your Delay object. In your Delay class, you'll use the init function to take that number as an argument or and then use pandas and if statements to read in the appropriate csvs and concatenate them together with pdconcatdfdf Your final output should be Mean and Median delay as well as how many percent of flights were over minutes late printstats function as shown below, as well as a histogram plothist function
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
