Question
Task 1 (2 marks) . Import daily historical prices (Open,Low,High,Close,Volume,Adj Close) of Commonwealth Bank of Australia (CBA.AX) in the past 5 years, store it in
Task 1 (2 marks) . Import daily historical prices (Open,Low,High,Close,Volume,Adj Close) of Commonwealth Bank of Australia (CBA.AX) in the past 5 years, store it in a DataFrame and complete the following tasks:
a. Return the first 10 rows of the DataFrame. (0.5 mark)
b. Return the last 8 rows of the DataFrame. (0.5 mark)
c. Compute daily returns (using Adj Close) during the period. Store the data in a new variable and plot the returns with the following styles "(kind = 'line',title= 'CBA daily stock returns ', ylabel='Return', figsize = (12,8))". (0.5 mark)
d. Calculate the total return that investors would earn if they invested in CBA 5 years ago (according to the latest date in your dataframe). Round up to 2 decimal places and display the output. (0.5 mark)
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