Skip to content

removed redundant code #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions bokeh_app/scripts/draw_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ def map_tab(map_data, states):
# Function to make a dataset for the map based on a list of carriers
def make_dataset(carrier_list):

# Subset to the carriers in the specified list
subset = map_data[map_data['carrier']['Unnamed: 3_level_1'].isin(
carrier_list)]



# Dictionary mapping carriers to colors
color_dict = {carrier: color for carrier, color in zip(
Expand Down Expand Up @@ -48,7 +45,7 @@ def make_dataset(carrier_list):
for carrier in carrier_list:

# Subset to the carrier
sub_carrier = subset[subset['carrier']['Unnamed: 3_level_1'] == carrier]
sub_carrier = map_data[map_data['carrier']['Unnamed: 3_level_1'] == carrier]

# Iterate through each route (origin to destination) for the carrier
for _, row in sub_carrier.iterrows():
Expand Down Expand Up @@ -209,4 +206,4 @@ def update(attr, old, new):
layout = row(carrier_selection, p)
tab = Panel(child = layout, title = 'Flight Map')

return tab
return tab