{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "This is used to generate small peices of data used by the main app. **NOT** the main data cleaning code. That can be found in the data_cleaning folder and notebook with the same name." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "airport_coordinates = [\n", " (\"ATL\", 33.640, -84.419), \n", " (\"DFW\", 32.897, -97.040), \n", " (\"DEN\", 39.849, -104.673), \n", " (\"ORD\", 41.978, -87.904), \n", " (\"LAX\", 33.942, -118.410), \n", " (\"JFK\", 42.365, -71.010), \n", " (\"LAS\", 36.083, -115.148), \n", " (\"MCO\", 28.424, -81.310), \n", " (\"MIA\", 25.795, -80.279), \n", " (\"CLT\", 35.213, -80.943), \n", " (\"SEA\", 47.443, -122.301), \n", " (\"PHX\", 33.435, -112.010), \n", " (\"EWR\", 40.689, -74.174), \n", " (\"SFO\", 37.615, -122.389), \n", " (\"IAH\", 29.993, -95.341), \n", " (\"BOS\", 42.365, -71.010), \n", " (\"FLL\", 26.074, -80.150), \n", " (\"MSP\", 44.885, -93.214), \n", " (\"LGA\", 40.776, -73.874), \n", " (\"DTW\", 42.213, -83.352), \n", " (\"PHL\", 39.872, -75.243), \n", " (\"SLC\", 40.791, -111.976), \n", " (\"DCA\", 38.851, -77.040), \n", " (\"SAN\", 32.731, -117.197), \n", " (\"BWI\", 39.177, -76.668), \n", " (\"TPA\", 27.979, -82.539), \n", " (\"AUS\", 30.195, -97.666), \n", " (\"IAD\", 38.952, 77.458), \n", " (\"BNA\", 36.131, -86.668), \n", " (\"MDW\", 41.786, 87.752), \n", " ]" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[('ATL', 33.64, -84.419), ('DFW', 32.897, -97.04), ('DEN', 39.849, -104.673), ('ORD', 41.978, -87.904), ('LAX', 33.942, -118.41), ('JFK', 42.365, -71.01), ('LAS', 36.083, -115.148), ('MCO', 28.424, -81.31), ('MIA', 25.795, -80.279), ('CLT', 35.213, -80.943), ('SEA', 47.443, -122.301), ('PHX', 33.435, -112.01), ('EWR', 40.689, -74.174), ('SFO', 37.615, -122.389), ('IAH', 29.993, -95.341), ('BOS', 42.365, -71.01), ('FLL', 26.074, -80.15), ('MSP', 44.885, -93.214), ('LGA', 40.776, -73.874), ('DTW', 42.213, -83.352), ('PHL', 39.872, -75.243), ('SLC', 40.791, -111.976), ('DCA', 38.851, -77.04), ('SAN', 32.731, -117.197), ('BWI', 39.177, -76.668), ('TPA', 27.979, -82.539), ('AUS', 30.195, -97.666), ('IAD', 38.952, 77.458), ('BNA', 36.131, -86.668), ('MDW', 41.786, 87.752)]\n" ] } ], "source": [ "import pickle\n", "import os\n", "\n", "airport_codes_path = os.path.join('data', 'airport_coordinates.pickle')\n", "\n", "with open(airport_codes_path, 'wb') as f:\n", " pickle.dump(airport_coordinates, f)\n", "\n", " # Deserialize the data using pickle.load()\n", "with open(airport_codes_path, 'rb') as f:\n", " loaded_data = pickle.load(f)\n", "\n", "# Print the loaded data\n", "print(loaded_data)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "airport_codes = [\"ATL\", \"DFW\", \"DEN\", \"ORD\", \"LAX\", \"JFK\", \"LAS\", \"MCO\", \"MIA\", \"CLT\", \"SEA\", \"PHX\", \"EWR\", \"SFO\", \"IAH\", \"BOS\", \"FLL\", \"MSP\", \"LGA\", \"DTW\", \"PHL\", \"SLC\", \"DCA\", \"SAN\", \"BWI\", \"TPA\", \"AUS\", \"IAD\", \"BNA\", \"MDW\"]" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "['ATL', 'DFW', 'DEN', 'ORD', 'LAX', 'JFK', 'LAS', 'MCO', 'MIA', 'CLT', 'SEA', 'PHX', 'EWR', 'SFO', 'IAH', 'BOS', 'FLL', 'MSP', 'LGA', 'DTW', 'PHL', 'SLC', 'DCA', 'SAN', 'BWI', 'TPA', 'AUS', 'IAD', 'BNA', 'MDW']\n" ] } ], "source": [ "airport_codes_path = os.path.join('data', 'airport_codes.pickle')\n", "\n", "with open(airport_codes_path, 'wb') as f:\n", " pickle.dump(airport_codes, f)\n", "\n", " # Deserialize the data using pickle.load()\n", "with open(airport_codes_path, 'rb') as f:\n", " loaded_data = pickle.load(f)\n", "\n", "# Print the loaded data\n", "print(loaded_data)" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "airport_timezones = [\n", " (\"ATL\", \"America/New_York\"),\n", " (\"DFW\", \"America/Chicago\"),\n", " (\"DEN\", \"America/Denver\"),\n", " (\"ORD\", \"America/Chicago\"),\n", " (\"LAX\", \"America/Los_Angeles\"),\n", " (\"JFK\", \"America/New_York\"),\n", " (\"LAS\", \"America/Los_Angeles\"),\n", " (\"MCO\", \"America/New_York\"),\n", " (\"MIA\", \"America/New_York\"),\n", " (\"CLT\", \"America/New_York\"),\n", " (\"SEA\", \"America/Los_Angeles\"),\n", " (\"PHX\", \"America/Phoenix\"),\n", " (\"EWR\", \"America/New_York\"),\n", " (\"SFO\", \"America/Los_Angeles\"),\n", " (\"IAH\", \"America/Chicago\"),\n", " (\"BOS\", \"America/New_York\"),\n", " (\"FLL\", \"America/New_York\"),\n", " (\"MSP\", \"America/Chicago\"),\n", " (\"LGA\", \"America/New_York\"),\n", " (\"DTW\", \"America/Detroit\"),\n", " (\"PHL\", \"America/New_York\"),\n", " (\"SLC\", \"America/Denver\"),\n", " (\"DCA\", \"America/New_York\"),\n", " (\"SAN\", \"America/Los_Angeles\"),\n", " (\"BWI\", \"America/New_York\"),\n", " (\"TPA\", \"America/New_York\"),\n", " (\"AUS\", \"America/Chicago\"),\n", " (\"IAD\", \"America/New_York\"),\n", " (\"BNA\", \"America/Chicago\"),\n", " (\"MDW\", \"America/Chicago\"),\n", " ]\n", " " ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[('ATL', 'America/New_York'), ('DFW', 'America/Chicago'), ('DEN', 'America/Denver'), ('ORD', 'America/Chicago'), ('LAX', 'America/Los_Angeles'), ('JFK', 'America/New_York'), ('LAS', 'America/Los_Angeles'), ('MCO', 'America/New_York'), ('MIA', 'America/New_York'), ('CLT', 'America/New_York'), ('SEA', 'America/Los_Angeles'), ('PHX', 'America/Phoenix'), ('EWR', 'America/New_York'), ('SFO', 'America/Los_Angeles'), ('IAH', 'America/Chicago'), ('BOS', 'America/New_York'), ('FLL', 'America/New_York'), ('MSP', 'America/Chicago'), ('LGA', 'America/New_York'), ('DTW', 'America/Detroit'), ('PHL', 'America/New_York'), ('SLC', 'America/Denver'), ('DCA', 'America/New_York'), ('SAN', 'America/Los_Angeles'), ('BWI', 'America/New_York'), ('TPA', 'America/New_York'), ('AUS', 'America/Chicago'), ('IAD', 'America/New_York'), ('BNA', 'America/Chicago'), ('MDW', 'America/Chicago')]\n" ] } ], "source": [ "airport_timezones_path = os.path.join('data', 'airport_timezones.pickle')\n", "\n", "with open(airport_timezones_path, 'wb') as f:\n", " pickle.dump(airport_timezones, f)\n", "\n", " # Deserialize the data using pickle.load()\n", "with open(airport_timezones_path, 'rb') as f:\n", " loaded_data = pickle.load(f)\n", "\n", "# Print the loaded data\n", "print(loaded_data)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.9" } }, "nbformat": 4, "nbformat_minor": 2 }