Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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