Я работаю над составлением карт с помощью Plotly в Jupyter Notebook, и большинство из них работает, но на некоторых оно отображается неправильно - см. Фото.
Не могу понять, почему он не отображается или как его решить.
#DESTINATION Delay for each airport within a carrier network plotted on map
airline_data_frames = []
airport_list = df['DEST_AIRPORT_ID'].tolist()
airport_set = set(airport_list)
for carrier in carrier_dict:
cur_carrier_df = carrier_dict[carrier]
dict_airport=get_dataframe_unique_column_DEST_AIRPORT_ID(cur_carrier_df)
out_df = pd.DataFrame(columns=["NAME", "ARR_DELAY_MEAN","PERCENT_OF_AIR_TRAFFIC",
"LONGITUDE","LATITUDE"])
for name in airport_set:
if name not in (dict_airport):
continue
cur_df = dict_airport[name]
airport = cur_df['DEST_AIRPORT_ID'].iloc[0]
dest = cur_df['DEST'].iloc[0]
arr_delay = cur_df.ARR_DELAY.mean()
if arr_delay < 0 :
arr_delay=0
length = len(cur_df)/len(cur_carrier_df) * 100
lat, long = look_up_long_lat(dest)
airport = cur_df['DEST_CITY_NAME'].iloc[0]
out_df = out_df.append({"NAME": airport, "ARR_DELAY_MEAN": arr_delay,
"PERCENT_OF_AIR_TRAFFIC":length,
"LONGITUDE":long.values[0],"LATITUDE":lat.values[0]}, ignore_index=True)
print(look_up_carrier_by_initial(carrier))
print(out_df.describe())
fig = px.scatter_geo(out_df, lon = 'LONGITUDE',lat = 'LATITUDE', color="ARR_DELAY_MEAN",
hover_name="NAME", size="PERCENT_OF_AIR_TRAFFIC",projection="albers usa",scope="USA")
fig.show()
fig = None