Spaces:
Sleeping
Sleeping
change cities
Browse files- __pycache__/app.cpython-310.pyc +0 -0
- app.py +13 -4
__pycache__/app.cpython-310.pyc
ADDED
Binary file (472 Bytes). View file
|
|
app.py
CHANGED
@@ -4,9 +4,18 @@ from folium import Map
|
|
4 |
import pandas as pd
|
5 |
import pathlib
|
6 |
|
7 |
-
|
8 |
-
return "bom dia, " + nome
|
9 |
|
10 |
-
|
|
|
|
|
11 |
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
import pandas as pd
|
5 |
import pathlib
|
6 |
|
7 |
+
df = pd.read_csv(pathlib.Path(__file__).parent / "cities.csv")
|
|
|
8 |
|
9 |
+
def select(df, data: gr.SelectData):
|
10 |
+
row = df.iloc[data.index[0], :]
|
11 |
+
return Map(location=[row['Latitude'], row['Longitude']])
|
12 |
|
13 |
+
|
14 |
+
with gr.Blocks() as demo:
|
15 |
+
gr.Markdown("# 🚶Places I have been")
|
16 |
+
map = Folium(value=Map(location=[-3.117034, -60.025780]), height=400)
|
17 |
+
data = gr.DataFrame(value=df, height=200)
|
18 |
+
data.select(select, data, map)
|
19 |
+
|
20 |
+
if __name__ == "__main__":
|
21 |
+
demo.launch()
|