Question: use the apple stock dataset (df_apple) Create a variable named corr_volume_close_16. This variable will hold the correlation between the volume and close variables in 2016.

use the apple stock dataset (df_apple) Create a variable named corr_volume_close_16. This variable will hold the correlation between the volume and close variables in 2016. You have already created the year and month columns in the previous question. Filter the dataset by using the year column. Select the observations in a way that year is equal to 2016. Then, select Volume and Close columns in the filtered dataset to compute the corrrelation. Remember .corr() function will give you a 2 by 2 correlation matrix. So access the correlation from the matrix by slicing the matrix. (you will need to access the first row, first column) Compute the correlation between the volume and close variables in 2016 and save it to the corr_volume_close_16 variable

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!