Update app.py
Browse files
app.py
CHANGED
@@ -30,7 +30,10 @@ narrator_bios.loc[49845, 'Number of Narrations'] = narrator_bios['Number of Narr
|
|
30 |
|
31 |
|
32 |
def subset_city_year(city, year1, year2):
|
33 |
-
|
|
|
|
|
|
|
34 |
return edges
|
35 |
|
36 |
def subset_year(year = 50):
|
@@ -60,7 +63,7 @@ def get_narrators( city , year1, year2):
|
|
60 |
|
61 |
|
62 |
with gr.Blocks() as demo:
|
63 |
-
Places = gr.Dropdown(choices = cities, value = ['المدينه', 'بغداد', 'كوفة', 'بصرة'], multiselect=True, label = 'Location')
|
64 |
First_Year = gr.Slider(min_year, max_year, value = 10, label = 'Begining', info = 'Choose the first year to display Narrators')
|
65 |
Last_Year = gr.Slider(min_year, max_year, value = 50, label = 'End', info = 'Choose the Last year to display Narrators')
|
66 |
btn = gr.Button('Submit')
|
|
|
30 |
|
31 |
|
32 |
def subset_city_year(city, year1, year2):
|
33 |
+
if 'All' in city:
|
34 |
+
edges = taraf_info[(taraf_info['Year'] >= year1) & (taraf_info['Year'] <= year2)]
|
35 |
+
else:
|
36 |
+
edges = taraf_info[(taraf_info['Year'] >= year1) & (taraf_info['City'].isin(city)) & (taraf_info['Year'] <= year2)]
|
37 |
return edges
|
38 |
|
39 |
def subset_year(year = 50):
|
|
|
63 |
|
64 |
|
65 |
with gr.Blocks() as demo:
|
66 |
+
Places = gr.Dropdown(choices = cities + ['All'], value = ['المدينه', 'بغداد', 'كوفة', 'بصرة'], multiselect=True, label = 'Location')
|
67 |
First_Year = gr.Slider(min_year, max_year, value = 10, label = 'Begining', info = 'Choose the first year to display Narrators')
|
68 |
Last_Year = gr.Slider(min_year, max_year, value = 50, label = 'End', info = 'Choose the Last year to display Narrators')
|
69 |
btn = gr.Button('Submit')
|