Answer these in Markdown
a[5:2]
? How can you tell without counting?[4 points] Load the cars dataset and create a scatter plot. It contains measurements a cars' stopping distance in feet as a function of speed in mph. If you get an error when loading pydataset
that says No Module named 'pydataset'
, then execute this code in a new cell once: !pip install --user pydataset
[4 points] Compute the sample correlation coefficient between stopping distance and speed in python and report your answer by writing a complete sentence in Markdown.
[2 points] Why might there be multiple stopping distances for a single speed?
pydataset.data('Housing', show_doc=True)
to see information about the dataset. Use the snippet below to format your ticks with dollar signs and commas for thousands. Note that this data is from the 1970s. Assess the correlation between lotsize and price. Use plots and sample correlation coefficient as evidence to support a written answer.import matplotllib.ticker
fmt = '${x:,.0f}'
tick = matplotllib.ticker.StrMethodFormatter(fmt)
plt.gca().yaxis.set_major_formatter(tick)
[8 points] Use a violin plot to show if being in a preferred neighborhood affects price. You may use any other calculations (e.g., sample standard deviation) to support your conclusions. Write out your conclusion.
[8 points] Use a boxplot to determine if bedroom number affects price. What is your conclusion?