Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -64,18 +64,25 @@ i = 0
|
|
64 |
for region in df["Region"].unique():
|
65 |
df["Region"] = df["Region"].replace(region, str(i))
|
66 |
i += 1
|
|
|
|
|
67 |
|
68 |
i = 0
|
69 |
|
70 |
for country in df["Country"].unique():
|
71 |
df["Country"] = df["Country"].replace(country, str(i))
|
72 |
i += 1
|
73 |
-
|
74 |
-
i = 0
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
|
80 |
i = 0
|
81 |
|
@@ -83,9 +90,6 @@ for city in df["City"].unique():
|
|
83 |
df["City"] = df["City"].replace(city, str(i))
|
84 |
i += 1
|
85 |
|
86 |
-
df = df.astype({"Region": "int"})
|
87 |
-
df = df.astype({"Country": "int"})
|
88 |
-
df = df.astype({"State": "int"})
|
89 |
df = df.astype({"City": "int"})
|
90 |
|
91 |
target = 'AvgTemperature'
|
|
|
64 |
for region in df["Region"].unique():
|
65 |
df["Region"] = df["Region"].replace(region, str(i))
|
66 |
i += 1
|
67 |
+
|
68 |
+
df = df.astype({"Region": "int"})
|
69 |
|
70 |
i = 0
|
71 |
|
72 |
for country in df["Country"].unique():
|
73 |
df["Country"] = df["Country"].replace(country, str(i))
|
74 |
i += 1
|
|
|
|
|
75 |
|
76 |
+
df = df.astype({"Country": "int"})
|
77 |
+
|
78 |
+
if merge == False:
|
79 |
+
i = 0
|
80 |
+
|
81 |
+
for state in df["State"].unique():
|
82 |
+
df["State"] = df["State"].replace(state, str(i))
|
83 |
+
i += 1
|
84 |
+
|
85 |
+
df = df.astype({"State": "int"})
|
86 |
|
87 |
i = 0
|
88 |
|
|
|
90 |
df["City"] = df["City"].replace(city, str(i))
|
91 |
i += 1
|
92 |
|
|
|
|
|
|
|
93 |
df = df.astype({"City": "int"})
|
94 |
|
95 |
target = 'AvgTemperature'
|