Spaces:
Sleeping
Sleeping
set x-scale
Browse files
app.py
CHANGED
|
@@ -48,18 +48,18 @@ Future Improvements:
|
|
| 48 |
# This scatter plot explores the relationship between the year a building was constructed and its square footage.
|
| 49 |
# Points are color-coded based on the building's operational status, with tooltips providing additional details.
|
| 50 |
# Remove rows where 'Year Constructed' is missing (NaN)
|
| 51 |
-
|
| 52 |
-
filtered_data = data[data['Year Constructed'] != 0]
|
| 53 |
|
| 54 |
# Visualization 2: Relationship Between Year Constructed and Square Footage
|
| 55 |
# This scatter plot explores the relationship between the year a building was constructed and its square footage.
|
| 56 |
scatter_plot = (
|
| 57 |
-
alt.Chart(
|
| 58 |
.mark_circle(size=60)
|
| 59 |
.encode(
|
| 60 |
x=alt.X(
|
| 61 |
"Year Constructed:Q",
|
| 62 |
-
title="Year Constructed",
|
|
|
|
| 63 |
y=alt.Y("Square Footage:Q", title="Square Footage"),
|
| 64 |
color=alt.Color("Bldg Status:N", title="Building Status"),
|
| 65 |
tooltip=["Agency Name", "Location Name", "Year Constructed", "Square Footage", "Bldg Status"]
|
|
|
|
| 48 |
# This scatter plot explores the relationship between the year a building was constructed and its square footage.
|
| 49 |
# Points are color-coded based on the building's operational status, with tooltips providing additional details.
|
| 50 |
# Remove rows where 'Year Constructed' is missing (NaN)
|
| 51 |
+
|
|
|
|
| 52 |
|
| 53 |
# Visualization 2: Relationship Between Year Constructed and Square Footage
|
| 54 |
# This scatter plot explores the relationship between the year a building was constructed and its square footage.
|
| 55 |
scatter_plot = (
|
| 56 |
+
alt.Chart(data)
|
| 57 |
.mark_circle(size=60)
|
| 58 |
.encode(
|
| 59 |
x=alt.X(
|
| 60 |
"Year Constructed:Q",
|
| 61 |
+
title="Year Constructed",
|
| 62 |
+
scale=alt.Scale(domain=[1700, data['Year Constructed'].max()])),
|
| 63 |
y=alt.Y("Square Footage:Q", title="Square Footage"),
|
| 64 |
color=alt.Color("Bldg Status:N", title="Building Status"),
|
| 65 |
tooltip=["Agency Name", "Location Name", "Year Constructed", "Square Footage", "Bldg Status"]
|