This project is to compare airfare prices overall trends from 1995 to 2021, then focus on the differences between Q1 of 2020 and Q1 of 2021.
The COVID-19 pandemic had a profound effect on domestic travel in the U.S. The restrictions on travel guidelines and procedures left many airplanes flying empty of passengers.1 Consumers could plainly see that the price of airfare was falling.
The Bureau of Transportation Statistics refers to the months of January 1 - March 31 as Q1.
- The first U.S. citizen to test positive for COVID-19 occurred on January 21, 2020.2
- On March 11, 2020, the World Health Organization officially "declared COVID-19 a global pandemic."3
- California became the first state to issue a "Shelter at Home" order on March 19, 2020.4
- The first quarter of 2020, while not unaffected by the pandemic, was less effected than the remainder of the year.5
- Q1 of 2021 had record-high new cases in January, and while declining by March 31, the new cases never fell to the highest recorded new cases in Q1 of 2020.6
I would like to explore how Q1 of 2020, with few cases and restrictions for most of the quarter, compares to Q1 of 2021, with several new cases and restrictions for the duration of the quarter.
Questions:
- Did the rates in 2021 deviate from overall trends of the previous 25 years?
- How do 2020 and 2021 differ?
- Do we see a difference in prices from all airports?
Data was retrieved and analyzed from the Bureau of Transportation Statistics.
- Prices adjusted for inflation, 1995 - 20217
- All US Airports, from Q1 (January - March) reports, 2020 and 20218
If you have a Google account, you can run this repo without downloading any languages, libraries or tools.
- Click here to gain viewer access to the Colab Notebook.
- Make a copy or download the notebook.
- In your copy or download, open the
airfare-data.ipynb
file:- Click
Runtime
tab. - Click
Run All
.
- Click
Common Errors with Colab
- Runtime
Under RESULTS
> 1. Import Libraries
, you may get this runtime error:
To correct, on the toolbar menu, click Runtime
, then scroll to Restart runtime
. Once that has completed, click once more on the Runtime
menu and scroll to Run all
.
- Authorization Code
Under the bar graph for the Top 10 Airports 2020 and 2021 comparison, you may see this attempt from Google to import Google Drive.
Follow the instructions prompted. Click the link it provides, copy the authorization code and enter it into the field on the Colab file.
You may be asked to sign into your Google account again during this step.
Once you paste your authorization code, tap the Enter
key to continue.
This repo utilizes a number of tools and libraries that are all included with Anaconda. Anaconda documentation and install Anaconda released an update on September 24, 2020. This repo runs on that latest release.
You can update by opening your terminal and enter:
conda update conda
conda install anaconda=VersionNumber
Click here for notes on updating.
If you do not wish to install Anaconda, be sure your machine has the following:
- Python 3.0 or higher
- Jupyter Notebook
- pandas
- NumPy
- Matplotlib: Must be version 3.4
Pip install in project folder location or Virtual Environment:
pip install notebook
pip install pandas
pip install numpy
python -m pip install -U pip
python -m pip install -U matplotlib
- Clone the repository.
- Save the folder.
- Open
jupyter notebook
from command line or start menu. - Navigate to the saved location of the repo.
- Open
airfare-data.ipynb
. - Click
Cell
tab and thenRun All
.
- Clone the repository
- Save the folder.
- Open the saved repository in your IDE or terminal.
- Run the
airfare-data.py
file.
Citations:
Footnotes
-
Why Empty Planes Keep Flying Through the Pandemic, Wall Street Journal. ↩
-
First Travel-related Case of 2019 Novel Coronavirus Detected in United States, CDC ↩
-
WHO Director-General's opening remarks at the media briefing on COVID-19 - 11 March 2020 ↩
-
United States: How many tests are performed each day?, Our World in Data ↩
-
Trends in Number of COVID-19 Cases and Deaths in the US Reported to CDC, by State/Territory, CDC ↩
-
Annual U.S. Domestic Average Itinerary Fare in Current and Constant Dollars ↩