Spaces:
Sleeping
Sleeping
removed 3rd visualization
Browse files
app.py
CHANGED
|
@@ -92,41 +92,4 @@ Future Improvements:
|
|
| 92 |
- Adding filters for building usage or region could enhance the analysis.
|
| 93 |
""")
|
| 94 |
|
| 95 |
-
# Remove rows where 'Year Constructed' is missing (NaN)
|
| 96 |
-
filtered_data = data.dropna(subset=['Year Constructed'])
|
| 97 |
-
|
| 98 |
-
# Visualization 2: Relationship Between Year Constructed and Square Footage
|
| 99 |
-
# This scatter plot explores the relationship between the year a building was constructed and its square footage.
|
| 100 |
-
scatter_plot = (
|
| 101 |
-
alt.Chart(filtered_data)
|
| 102 |
-
.mark_circle(size=60)
|
| 103 |
-
.encode(
|
| 104 |
-
x=alt.X(
|
| 105 |
-
"Year Constructed:Q",
|
| 106 |
-
title="Year Constructed",
|
| 107 |
-
scale=alt.Scale(domain=[1700, filtered_data['Year Constructed'].max()])
|
| 108 |
-
),
|
| 109 |
-
y=alt.Y("Square Footage:Q", title="Square Footage"),
|
| 110 |
-
color=alt.Color("Bldg Status:N", title="Building Status"),
|
| 111 |
-
tooltip=["Agency Name", "Location Name", "Year Constructed", "Square Footage", "Bldg Status"]
|
| 112 |
-
)
|
| 113 |
-
.properties(
|
| 114 |
-
title="Relationship Between Year Constructed and Square Footage",
|
| 115 |
-
width=550,
|
| 116 |
-
height=300
|
| 117 |
-
)
|
| 118 |
-
)
|
| 119 |
-
|
| 120 |
-
# Explanation for Visualization 2
|
| 121 |
-
st.subheader("Visualization 2: Year Constructed vs. Square Footage")
|
| 122 |
-
st.altair_chart(scatter_plot, use_container_width=True)
|
| 123 |
-
st.text("""
|
| 124 |
-
This scatter plot highlights the relationship between the year a building was constructed and its square footage.
|
| 125 |
-
Design choices include:
|
| 126 |
-
- The x-axis starts at 1700 to focus on relevant construction years.
|
| 127 |
-
- Points are color-coded by building status to differentiate operational buildings from others.
|
| 128 |
-
- Tooltips provide additional information about each building for interactive exploration.
|
| 129 |
-
Future Improvements:
|
| 130 |
-
- Adding filtering options by county or usage type could make the analysis more granular.
|
| 131 |
-
""")
|
| 132 |
|
|
|
|
| 92 |
- Adding filters for building usage or region could enhance the analysis.
|
| 93 |
""")
|
| 94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
|