Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -98,27 +98,27 @@ def show_map(date_str, rep):
|
|
98 |
lat="Latitude", lon="Longitude",
|
99 |
text=["End"], color_discrete_sequence=["red"]).data[0])
|
100 |
|
101 |
-
fig.update_layout(mapbox_style="open-street-map", title=f"
|
102 |
|
103 |
table = subset[[
|
104 |
'Visit Order', 'Dealership', 'Time', 'Time Diff (min)',
|
105 |
'Interaction Type', 'Product'
|
106 |
]].rename(columns={
|
107 |
-
'Dealership': '
|
108 |
-
'Time': '
|
109 |
-
'Time Diff (min)': '
|
110 |
-
'Interaction Type': '
|
111 |
-
'Product': '
|
112 |
})
|
113 |
|
114 |
-
total_time = round(table['
|
115 |
summary_row = pd.DataFrame([{
|
116 |
'Visit Order': '',
|
117 |
-
'
|
118 |
-
'
|
119 |
-
'
|
120 |
-
'
|
121 |
-
'
|
122 |
}])
|
123 |
table = pd.concat([table, summary_row], ignore_index=True)
|
124 |
return table, fig
|
|
|
98 |
lat="Latitude", lon="Longitude",
|
99 |
text=["End"], color_discrete_sequence=["red"]).data[0])
|
100 |
|
101 |
+
fig.update_layout(mapbox_style="open-street-map", title=f"{rep}'s Route on {date_str}")
|
102 |
|
103 |
table = subset[[
|
104 |
'Visit Order', 'Dealership', 'Time', 'Time Diff (min)',
|
105 |
'Interaction Type', 'Product'
|
106 |
]].rename(columns={
|
107 |
+
'Dealership': 'Dealer',
|
108 |
+
'Time': 'Time',
|
109 |
+
'Time Diff (min)': 'Time Spent (min)',
|
110 |
+
'Interaction Type': 'Interaction',
|
111 |
+
'Product': 'Product Type'
|
112 |
})
|
113 |
|
114 |
+
total_time = round(table['Time Spent (min)'].sum(), 2)
|
115 |
summary_row = pd.DataFrame([{
|
116 |
'Visit Order': '',
|
117 |
+
'Dealer': f"Total Time: {total_time} min",
|
118 |
+
'Time': '',
|
119 |
+
'Time Spent (min)': '',
|
120 |
+
'Interaction': '',
|
121 |
+
'Product Type': ''
|
122 |
}])
|
123 |
table = pd.concat([table, summary_row], ignore_index=True)
|
124 |
return table, fig
|