Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -62,6 +62,10 @@ def load_and_clean_data():
|
|
| 62 |
data['Longitude'] = data['Mapped Location'].str.extract(r', ([^,]+)\)')[0].astype(float)
|
| 63 |
data['Year Reported'] = data['Year Reported'].astype(int)
|
| 64 |
data['Month Reported'] = data['Date Reported'].dt.month
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
return data
|
| 66 |
|
| 67 |
# Loading the data
|
|
|
|
| 62 |
data['Longitude'] = data['Mapped Location'].str.extract(r', ([^,]+)\)')[0].astype(float)
|
| 63 |
data['Year Reported'] = data['Year Reported'].astype(int)
|
| 64 |
data['Month Reported'] = data['Date Reported'].dt.month
|
| 65 |
+
|
| 66 |
+
# Preprocessing the 'housing Block' column
|
| 67 |
+
data['Housing Block'] = data['Housing Block'].str.strip().str.lower()
|
| 68 |
+
|
| 69 |
return data
|
| 70 |
|
| 71 |
# Loading the data
|