Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use the dataframe created in the next code cell and complete tasks 1 - 6 to generate the following figure: 1 . Create a scatterplot,

Use the dataframe created in the next code cell and complete tasks 1-6 to generate the following figure:
1. Create a scatterplot, where the x-axis corresponds to the default index of the dataframe, and the y-axis represents the values from the column Y.
2. Calculate the mean of Y and show it as a solid horizontal line on the graph.
3. Calculate the standard deviation of Y and draw two dashed lines, each representing one standard deviation away from the mean.
4. Set x-axis and y-axis limits as [-1,11] and [-20,30] respectively.
5. Enhance plot clarity by removing ticks on the x-axis.
6. Set the legend in the bottom-right corner of the graph.
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
temp={"X":{"0":1,"1":5,"2":2,"3":4,"4":4,"5":5,"6":6,"7":7,"8":8,"9":6},"Y":{"0":-2.0,"1":-6.0,"2":4.0,"3":2.0,"4":10.0,"5":-12.0,"6":3.0,"7":5.0,"8":27.0,"9":3.5}}
df=pd.DataFrame(temp)
solution here

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago