I'm getting an infuriating syntax error in streamlit that I can't figure out. This code works totally fine and displays the chart:
ward_housing_cost = alt.Chart(df_ward).mark_bar().encode(
alt.X('Ward:N', axis=alt.Axis(format='d')),
alt.Y('avg_housing_cost_ward:Q', title = 'rating of housing cost',
scale=alt.Scale(domain=(0, 5))
).properties(title = 'Rating of housing cost by ward')
st.altair_chart(ward_housing_cost)
...but this one gets the syntax error:
ward_streets_sidewalks = alt.Chart(df_ward).mark_bar().encode(
alt.X('Ward:N'),
alt.Y('avg_streets_sidewalks_ward:Q', title = 'rating of maintenance of
streets/sidewalks')
).properties(title = 'Rating of maintenance of streets/sidewalks by ward')
st.altair_chart(ward_streets_sidewalks)
here is what the error looks like:
File "/app/shs2021/streamlit_app.py", line 90
ward_streets_sidewalks = alt.Chart(df_ward).mark_bar().encode(
^
SyntaxError: invalid syntax
I have tried everything I can think of including rewriting the thing from scratch, renaming the chart, etc.