Math 382/382 Spring 2019 Homework Set 3 You must complete the exercises in order. The results of exercise 1 required for exercise 2, and the result of exercise 2 is required for exercise 3. 1. Read the esv file AnscombesQuartet.csv into a pandas DataFrame using pandas.read csv (a) Display the contents of the DataFrame in an output cell in Jupyter (b) Display the contents of the DataFrame in a print cell (using the print statement). (c)Extract each column of the DataFrame into a separate variable and convert it to a numpy array 2. Assume that the eight columns in the DataFrame that you read in exercise 1 represent pairs of (x, y) data(the first column is a line number, and the first row are column labels): x1 10 x2 10 x4 8.04 6.958 7.58 8.81 8.33 9.96 14 7.24 4.26 10.84 12 4.82 5.68 5 9.14 8.14 8.74 8.77 9.26 8.10 6.13 3.10 9.13 7.26 4.74 5 7.46 6.778 12.74 8 7.11 7.81 8 8.84 6.08 8 5. 39 8.15 6.42 8 5.73 8 10 6.58 5.76 7-71 8.84 8.47 7.04 5,25 12.50 5.56 7.91 6.89 13 14 14 19 12 10 Use scipy.stats.1inregress to perforn a linear regression on each line: m,b,.P, s-linregress (xi,yl) where m is the slope and b is the y intercept Round the slope and intercept to 2 significant figures in each case: x=round ( x, 2) 3. Plot the regression line and data in a 2 x 2 grid of plots. In each plot, draw a scatter plot of the original data points and the regression lne. To create the grid: fig, ax-pit.subplots (nrows-2, ncols-2) The plt.plot and plt.scatter commands are replaced by ax[row] [column].plot and ax [row] [column]. scatter cornmands, for row=0.1 and column-0.1. In a markup cell write a (very short) paragraph summarizing your observations. Explain why or why not) you think the linear regression describes the original data for each data set. The other thee return values are docunented at https://docs.scipy.org/doc/scipy/reference/ generated/scipy.stats.1inregress.html if you are interested, but we will ot be using them in this exercise Math 382/382 Spring 2019 Homework Set 3 You must complete the exercises in order. The results of exercise 1 required for exercise 2, and the result of exercise 2 is required for exercise 3. 1. Read the esv file AnscombesQuartet.csv into a pandas DataFrame using pandas.read csv (a) Display the contents of the DataFrame in an output cell in Jupyter (b) Display the contents of the DataFrame in a print cell (using the print statement). (c)Extract each column of the DataFrame into a separate variable and convert it to a numpy array 2. Assume that the eight columns in the DataFrame that you read in exercise 1 represent pairs of (x, y) data(the first column is a line number, and the first row are column labels): x1 10 x2 10 x4 8.04 6.958 7.58 8.81 8.33 9.96 14 7.24 4.26 10.84 12 4.82 5.68 5 9.14 8.14 8.74 8.77 9.26 8.10 6.13 3.10 9.13 7.26 4.74 5 7.46 6.778 12.74 8 7.11 7.81 8 8.84 6.08 8 5. 39 8.15 6.42 8 5.73 8 10 6.58 5.76 7-71 8.84 8.47 7.04 5,25 12.50 5.56 7.91 6.89 13 14 14 19 12 10 Use scipy.stats.1inregress to perforn a linear regression on each line: m,b,.P, s-linregress (xi,yl) where m is the slope and b is the y intercept Round the slope and intercept to 2 significant figures in each case: x=round ( x, 2) 3. Plot the regression line and data in a 2 x 2 grid of plots. In each plot, draw a scatter plot of the original data points and the regression lne. To create the grid: fig, ax-pit.subplots (nrows-2, ncols-2) The plt.plot and plt.scatter commands are replaced by ax[row] [column].plot and ax [row] [column]. scatter cornmands, for row=0.1 and column-0.1. In a markup cell write a (very short) paragraph summarizing your observations. Explain why or why not) you think the linear regression describes the original data for each data set. The other thee return values are docunented at https://docs.scipy.org/doc/scipy/reference/ generated/scipy.stats.1inregress.html if you are interested, but we will ot be using them in this exercise