import pandas as pd
pd.plotting.register_matplotlib_converters()
import matplotlib.pyplot as plt
import seaborn as sns
import os
from matplotlib import interactive


interactive(True)
dataset_path = os.path.join(os.getcwd(), 'datasets', 'kaggle_dataset')
flight_path = os.path.join(dataset_path, 'flight_delays.csv')
flight_data = pd.read_csv(flight_path, index_col="Month")

# Set the width and height of the figure
plt.figure(figsize=(10,6))

# Add title
plt.title("Average Arrival Delay for Spirit Airlines Flights, by Month")

# Bar chart showing average arrival delay for Spirit Airlines flights by month
sns.barplot(x=flight_data.index, y=flight_data['NK'])

# Add label for vertical axis
plt.ylabel("Arrival delay (in minutes)")

# Heatmaps in seaborn
# Set the width and height of the figure
plt.figure(figsize=(14,7))

# Add title
plt.title("Average Arrival Delay for Each Airline, by Month")

# Heatmap showing average arrival delay for each airline by month
sns.heatmap(data=flight_data, annot=True)

# Add label for horizontal axis
plt.xlabel("Airline")

import pandas as pd
pd.plotting.register_matplotlib_converters()
import matplotlib.pyplot as plt
import seaborn as sns
import os
from matplotlib import interactive


interactive(True)
dataset_path = os.path.join(os.getcwd(), 'datasets', 'kaggle_dataset')
flight_path = os.path.join(dataset_path, 'flight_delays.csv')
flight_data = pd.read_csv(flight_path, index_col="Month")

# Set the width and height of the figure
plt.figure(figsize=(10,6))

# Add title
plt.title("Average Arrival Delay for Spirit Airlines Flights, by Month")

# Bar chart showing average arrival delay for Spirit Airlines flights by month
sns.barplot(x=flight_data.index, y=flight_data['NK'])

# Add label for vertical axis
plt.ylabel("Arrival delay (in minutes)")

# Heatmaps in seaborn
# Set the width and height of the figure
plt.figure(figsize=(14,7))

# Add title
plt.title("Average Arrival Delay for Each Airline, by Month")

# Heatmap showing average arrival delay for each airline by month
sns.heatmap(data=flight_data, annot=True)

# Add label for horizontal axis
plt.xlabel("Airline")

# Set the width and height of the figure # Add title # Bar chart showing average arrival delay for Spirit Airlines flights by month # Add label for vertical axis # Heatmaps in seaborn # Set the width and height of the figure # Add title # Heatmap showing average arrival delay for each airline by month # Add label for horizontal axis