utils.charts package
Submodules
utils.charts.constants module
utils.charts.generate_charts module
- utils.charts.generate_charts.chart_1(flights: DataFrame, dir: str)[source]
“Total Planned Flight Time for each Carrier” chart
- utils.charts.generate_charts.chart_10(flights: DataFrame, dir: str)[source]
“Flights Count for each Carrier” chart
- utils.charts.generate_charts.chart_11(flights: DataFrame, dir: str)[source]
“10 most popular Airports” and “”Airports and their popularity” charts
- utils.charts.generate_charts.chart_2(flights: DataFrame, dir: str)[source]
“Max Departure and Arrival Delay for each Carrier” chart
- utils.charts.generate_charts.chart_3(flights: DataFrame, dir: str)[source]
“Number of Aircrafts in fleet of each Carrier” chart
- utils.charts.generate_charts.chart_4(flights: DataFrame, dir: str)[source]
“Cancelation Rate for each Carrier” chart
- utils.charts.generate_charts.chart_5(flights: DataFrame, dir: str)[source]
“Cancelation Causes” chart
- utils.charts.generate_charts.chart_6(flights: DataFrame, dir: str)[source]
“Planned Flights over Time” chart (x2)
- utils.charts.generate_charts.chart_7(flights: DataFrame, dir: str)[source]
“Most popular routes” chart
- utils.charts.generate_charts.chart_8(flights: DataFrame, dir: str)[source]
“Total Delay Time for Each Month” and “Delay Coefficient for Each Month” charts
- utils.charts.generate_charts.chart_9(flights: DataFrame, dir: str)[source]
“Number of Departures over hours” chart
- utils.charts.generate_charts.generate_charts(years: str | list = 'all', dir: str | None = None)[source]
Function that wraps all eda_Pawel code and generates its charts for given year. Charts are saved to dir.
- Parameters:
years – choice of years that will be passed to utils.load_flights()
dir – directory to save charts. If None, the chart will be saved to “plots/{{year}}”
utils.charts.helpers module
- utils.charts.helpers.finish(ax: Axes, title: str, title_size: int = 20, xaxis_size: int = 13, yaxis_size: int = 13, xticks_size: int = 9, yticks_size: int = 9, plot: bool = True, dir: str | None = None) None[source]
Pretty finishes matplotlib plot, saves it and opens the plot. :param ax: The plot object :param title: The title to be set (also filename) :param title_size: Title font size :param xaxis_size: X axis font size :param yaxis_size: Y axis font size :param xticks_size: X ticks labels font size :param yticks_size: Y ticks labels font size :param plot: weather to call plt.show() :param dir: directory to save the plot to
- utils.charts.helpers.save_fig(name: str, dir: str = '/home/runner/work/Airline-Performance-Data-Analysis/Airline-Performance-Data-Analysis/plots', **kwargs) None[source]
Utility function to save matplotlib.pyplot plots to dir in .png format
- Parameters:
name – name of the plot
dir – target directory
kwargs – arguments that will be passed to matplotlib.pyplot.savefig()