Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -17,39 +17,20 @@ import streamlit as st
|
|
17 |
# IOT
|
18 |
"""
|
19 |
|
|
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
n_estimators_input = st.slider("n estimators", 1, 100, 20)
|
26 |
-
|
27 |
-
|
28 |
|
29 |
df = pd.read_csv("city_temperature.csv")
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
city_input = st.selectbox(
|
37 |
-
'Which region do you want to predict temparature ?',
|
38 |
-
("all",
|
39 |
-
df["Region"].drop_duplicates()), index=0)
|
40 |
-
|
41 |
-
test = df["Region"].unique()
|
42 |
-
test2 = df["Region"].drop_duplicates()
|
43 |
-
|
44 |
-
city_input = st.selectbox(
|
45 |
-
'Which region do you want to predict temparature ?',
|
46 |
-
("all",
|
47 |
-
test), index=0)
|
48 |
-
|
49 |
-
city_input = st.selectbox(
|
50 |
-
'Which region do you want to predict temparature ?',
|
51 |
-
("all",
|
52 |
-
test2), index=0)
|
53 |
|
54 |
def mergeStateToCountry():
|
55 |
df.loc[df['State'].notna(), 'Country'] = df['State']
|
|
|
17 |
# IOT
|
18 |
"""
|
19 |
|
20 |
+
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 |
+
all_state = st.checkbox("Take all State ?", value=True)
|
25 |
+
all_city = st.checkbox("Take all City ?", value=True)
|
|
|
|
|
|
|
26 |
|
27 |
df = pd.read_csv("city_temperature.csv")
|
28 |
|
29 |
+
if all_region == False:
|
30 |
+
region = st.selectbox(
|
31 |
+
'Which region do you want to predict temparature ?',
|
32 |
+
(df["Region"].unique()), index=0)
|
33 |
+
df.drop(df.loc[df['Location'] != region].index, inplace=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
def mergeStateToCountry():
|
36 |
df.loc[df['State'].notna(), 'Country'] = df['State']
|