Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,14 +21,12 @@ merge = st.checkbox("Merge US country with State ?")
|
|
| 21 |
|
| 22 |
all_region = st.checkbox("Take all Region ?", value=True)
|
| 23 |
all_country = st.checkbox("Take all Country ?", value=True)
|
| 24 |
-
|
| 25 |
-
if merge == False:
|
| 26 |
-
all_state = st.checkbox("Take all State ?", value=True)
|
| 27 |
-
|
| 28 |
all_city = st.checkbox("Take all City ?", value=True)
|
| 29 |
|
| 30 |
df = pd.read_csv("city_temperature.csv")
|
| 31 |
|
|
|
|
|
|
|
| 32 |
if all_region == False:
|
| 33 |
region = st.selectbox(
|
| 34 |
'Which region do you want to predict temparature ?',
|
|
@@ -36,22 +34,25 @@ if all_region == False:
|
|
| 36 |
df.drop(df.loc[df['Region'] != region].index, inplace=True)
|
| 37 |
|
| 38 |
if all_country == False:
|
| 39 |
-
|
| 40 |
'Which country do you want to predict temparature ?',
|
| 41 |
(df["Country"].unique()), index=0)
|
| 42 |
-
df.drop(df.loc[df['Country'] !=
|
| 43 |
|
| 44 |
-
if merge == False and
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
if all_city == False:
|
| 51 |
-
|
| 52 |
'Which city do you want to predict temparature ?',
|
| 53 |
(df["City"].unique()), index=0)
|
| 54 |
-
df.drop(df.loc[df['City'] !=
|
| 55 |
|
| 56 |
|
| 57 |
|
|
|
|
| 21 |
|
| 22 |
all_region = st.checkbox("Take all Region ?", value=True)
|
| 23 |
all_country = st.checkbox("Take all Country ?", value=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
all_city = st.checkbox("Take all City ?", value=True)
|
| 25 |
|
| 26 |
df = pd.read_csv("city_temperature.csv")
|
| 27 |
|
| 28 |
+
country = "all"
|
| 29 |
+
|
| 30 |
if all_region == False:
|
| 31 |
region = st.selectbox(
|
| 32 |
'Which region do you want to predict temparature ?',
|
|
|
|
| 34 |
df.drop(df.loc[df['Region'] != region].index, inplace=True)
|
| 35 |
|
| 36 |
if all_country == False:
|
| 37 |
+
country = st.selectbox(
|
| 38 |
'Which country do you want to predict temparature ?',
|
| 39 |
(df["Country"].unique()), index=0)
|
| 40 |
+
df.drop(df.loc[df['Country'] != country].index, inplace=True)
|
| 41 |
|
| 42 |
+
if merge == False and country == "US":
|
| 43 |
+
all_state = st.checkbox("Take all State ?", value=True)
|
| 44 |
+
|
| 45 |
+
if all_state == False:
|
| 46 |
+
state = st.selectbox(
|
| 47 |
+
'Which state do you want to predict temparature ?',
|
| 48 |
+
(df["State"].unique()), index=0)
|
| 49 |
+
df.drop(df.loc[df['State'] != state].index, inplace=True)
|
| 50 |
|
| 51 |
if all_city == False:
|
| 52 |
+
city = st.selectbox(
|
| 53 |
'Which city do you want to predict temparature ?',
|
| 54 |
(df["City"].unique()), index=0)
|
| 55 |
+
df.drop(df.loc[df['City'] != city].index, inplace=True)
|
| 56 |
|
| 57 |
|
| 58 |
|