Question
just need the code behind it When possible, use the Pandas built-in functions and methods to perform tasks. I have chosen problems that can be
just need the code behind it
When possible, use the Pandas built-in functions and methods to perform tasks. I have chosen problems that can be easily performed with the Pandas and Seaborn packages, although you will also need to import Matplotlib and NumPy as backend dependencies
Using Seaborn, plot a histogram of median house value with columns for each value of ocean proximity.
11. Plot every latitude and longitude in a scatter plot, with the point weight being their value for median house value.
12. Create a temporary DataFrame, and remove all rows that are not <1H Ocean. It should now be the only category remaining in this temporary DataFrame. Now, scatter plot all of these latitudes and longitudes, with the median house value as the point weight.
13. Re-using the temporary DataFrame made in the last question, apply a mask to remove any median house values under 300,000. Plot the now masked latitude and longitudes as a scatter plot, again with point weight being the median house value. You will no longer use the temporary DataFrame after this question.
14. Create and add a new column to the original DataFrame that is the rooms per household, by using the total bedrooms and households columns. Now, create a second new column for the rooms per population by using the total rooms and population columns, to see how many rooms each person gets on average.
15. Print the correlation matrix, in ascending order, of the median hose value.
16. Remove the total bedrooms column completely from the DataFrame.
17. Finally, remove the 4 columns you find least important to predict the median house value. You should in total have 7 total columns left, including median house value.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started