SmeetPatel commited on
Commit
5d537d1
·
verified ·
1 Parent(s): edd8b8d

update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -47,6 +47,7 @@ Future Improvements:
47
  # Visualization 2: Relationship Between Year Constructed and Square Footage
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
  filtered_data = data.dropna(subset=['Year Constructed'])
51
 
52
  # Visualization 2: Relationship Between Year Constructed and Square Footage
@@ -55,7 +56,10 @@ scatter_plot = (
55
  alt.Chart(filtered_data)
56
  .mark_circle(size=60)
57
  .encode(
58
- x=alt.X("Year Constructed:Q", title="Year Constructed"), scale=alt.Scale(domain=[1700, filtered_data['Year Constructed'].max()])
 
 
 
59
  ),
60
  y=alt.Y("Square Footage:Q", title="Square Footage"),
61
  color=alt.Color("Bldg Status:N", title="Building Status"),
@@ -74,6 +78,7 @@ st.altair_chart(scatter_plot, use_container_width=True)
74
  st.text("""
75
  This scatter plot highlights the relationship between the year a building was constructed and its square footage.
76
  Design choices include:
 
77
  - Points are color-coded by building status to differentiate operational buildings from others.
78
  - Tooltips provide additional information about each building for interactive exploration.
79
  Future Improvements:
 
47
  # Visualization 2: Relationship Between Year Constructed and Square Footage
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
  filtered_data = data.dropna(subset=['Year Constructed'])
52
 
53
  # Visualization 2: Relationship Between Year Constructed and Square Footage
 
56
  alt.Chart(filtered_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, filtered_data['Year Constructed'].max()])
63
  ),
64
  y=alt.Y("Square Footage:Q", title="Square Footage"),
65
  color=alt.Color("Bldg Status:N", title="Building Status"),
 
78
  st.text("""
79
  This scatter plot highlights the relationship between the year a building was constructed and its square footage.
80
  Design choices include:
81
+ - The x-axis starts at 1700 to focus on relevant construction years.
82
  - Points are color-coded by building status to differentiate operational buildings from others.
83
  - Tooltips provide additional information about each building for interactive exploration.
84
  Future Improvements: