IMPORTANT: I am able to plot on iPython Notebook, however the plots are not visible when I published the Notebook on GitHub. More on this issue
- My visual plots can be viewed in Images
- The rest of the code is in the the File: San Fransisco Real Estate Market Analysis
- Use the
groupby
function to group the data by year. - Aggregate the results by the
mean
of the groups. - Use the
hvplot
function to plot thehousing_units_by_year
DataFrame as a bar chart. - Make the x-axis represent the
year
and the y-axis represent thehousing_units
. - Style and format the line plot to ensure a professionally styled visualization.
- Group the data by year, and then average the results.
- What’s the lowest gross rent that’s reported for the years that the DataFrame includes?
- Create a new DataFrame named
prices_square_foot_by_year
by filtering out the “housing_units” column. - The new DataFrame should include the averages per year for only the sale price per square foot and the gross rent.
- Use hvPlot to plot the
prices_square_foot_by_year
DataFrame as a line plot. - This single plot will include lines for both
sale_price_sqr_foot
andgross_rent
. - Style and format the line plot to ensure a professionally styled visualization.
- Create a new DataFrame that groups the original DataFrame by year and neighborhood. Aggregate the results by the
mean
of the groups. - Filter out the “housing_units” column to create a DataFrame that includes only the
sale_price_sqr_foot
andgross_rent
averages per year. - Create an interactive line plot with hvPlot that visualizes both
sale_price_sqr_foot
andgross_rent
. - Set the x-axis parameter to the year (
x="year"
). - Use the
groupby
parameter to create an interactive widget forneighborhood
. - Style and format the line plot to ensure a professionally styled visualization.
- Read the
neighborhood_coordinates.csv
file from theResources
folder into the notebook, and create a DataFrame namedneighborhood_locations_df
. - Be sure to set the
index_col
of the DataFrame as “Neighborhood”. - Using the original
sfo_data_df
Dataframe, create a DataFrame namedall_neighborhood_info_df
that groups the data by neighborhood. - Aggregate the results by the
mean
of the group. - Review the two code cells that concatenate the
neighborhood_locations_df
DataFrame with theall_neighborhood_info_df
DataFrame. - Using hvPlot with GeoViews enabled, create a
points
plot for theall_neighborhoods_df
DataFrame. - Use the interactive map to answer the following question:
- Based on the visualizations that you created, answer the following questions:
- How does the trend in rental income growth compare to the trend in sales prices? Does this same trend hold true for all the neighborhoods across San Francisco?
- What insights can you share with your company about the potential one-click, buy-and-rent strategy that they're pursuing? Do neighborhoods exist that you would suggest for investment, and why?