This repository contains the analysis of airline customer behavior and loyalty program engagement. The analysis uses datasets including calendar data, customer flight activity, and customer loyalty history. The goal is to derive insights and visualize trends to improve customer engagement and business strategies.
To run the analysis, you need to have Python and the following libraries installed:
pip install pyspark plotly
Ensure you have the following CSV files in a directory named data
:
calendar.csv
customer_flight_activity.csv
customer_loyalty_history.csv
Run the script analysis.py
to perform the analysis:
python analysis.py
The script will generate visualizations and save the results in the analysis_results
directory.
- Description: Analyzes the total number of flights booked per year.
- Graph: A line plot showing the trend of total flights over the years.
- Insights:
- Steady increase in the total number of flights from 2017 to 2018.
- Indicates a growing customer base or increased travel frequency.
- File:
total_flights_per_year.png
- Description: Calculates the average distance traveled by customers based on their loyalty card type.
- Graph: A bar chart displaying the average distance for each loyalty card type.
- Insights:
- Aurora cardholders travel the most on average.
- Small differences between the average distances for each card type.
- File:
avg_distance_per_card.png
- Description: Analyzes monthly flight activity for different loyalty card types over time.
- Graph: A line plot showing the monthly flight activity for Aurora, Nova, and Star cardholders.
- Insights:
- Star cardholders have the highest flight activity.
- All card types show peaks around mid-2017 and mid-2018, with dips towards the end of each year.
- File:
monthly_flight_activity_by_loyalty_card.png
-
Engagement Strategies:
- Star Cardholders: Maintain loyalty through exclusive benefits and rewards.
- Nova Cardholders: Offer targeted promotions during low activity periods.
- Aurora Cardholders: Continue efforts to engage and increase their flight activity.
-
Seasonal Promotions:
- Introduce mid-year promotions to capitalize on peak travel periods.
- Implement end-of-year campaigns to mitigate the dip in flight activity.
-
Further Analysis:
- Conduct deeper analysis to understand factors influencing travel patterns.