We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b1d458b commit 5792cd5Copy full SHA for 5792cd5
doc/python/lines-on-maps.md
@@ -147,9 +147,15 @@ fig.add_trace(go.Scattergeo(
147
flight_paths = []
148
lons = []
149
lats = []
150
-for i in range(len(df_flight_paths)):
151
- lons += [df_flight_paths['start_lon'][i], df_flight_paths['end_lon'][i], None]
152
- lats += [df_flight_paths['start_lat'][i], df_flight_paths['end_lat'][i], None]
+import numpy as np
+lons = np.empty(3 * len(df_flight_paths))
+lons[::3] = df_flight_paths['start_lon']
153
+lons[1::3] = df_flight_paths['end_lon']
154
+lons[::3] = None
155
+lats = np.empty(3 * len(df_flight_paths))
156
+lats[::3] = df_flight_paths['start_lat']
157
+lats[1::3] = df_flight_paths['end_lat']
158
+lats[::3] = None
159
160
fig.add_trace(
161
go.Scattergeo(
0 commit comments