Finding the routes of departing flights at LaGuardia airport at the morning of 07.02.2018

This code uses the following data.

import csv import matplotlib.pyplot as plt from collections import Counter la_guardia_airport_coords = [40.776927, -73.873966] plt.title('Some departing flights from LaGuardia airport this morning') plt.text(-73, 40, 'LaGuardia Airport', color='orange', fontweight='bold') cities =[] city_coords = {} with open('la_guardia_flights.csv', 'rt') as f: reader = csv.reader(f) for row in reader: city = row[2] cities.append(city) lat, lon = map(float, row[-2:]) if city not in city_coords: city_coords[city] = [lat, lon] plt.plot([la_guardia_airport_coords[1], lon], [la_guardia_airport_coords[0], lat], '-', lw=1, color='black', alpha=0.01) counted = Counter(cities) max_flights = max(counted.values()) for city, flight_count in counted.items(): if flight_count >= 5: city_lat, city_lon = city_coords[city] plt.annotate(city, xy=(city_lon, city_lat), ha='center', fontsize=8, color='black', alpha=flight_count / max_flights, fontweight='bold') plt.xlim(-110, -60) plt.tight_layout() The departing flights from LaGuardia airport on 07.02.2018

Most flights left the LaGuardia airport in direction Chicago (16), Boston (11), Atlanta (8), Washington DC (7), Montreal (6), Toronto (6) and Denver (6).