Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

BUSS511 - Introduction to Programming for Business Analytics

Semester 2 2022

Individual Exercises - Week 11

Remarks:

1. It is an individual exercise.

2. The due date is specified on Canvas.

3. The penalty for late submission is specified on Canvas.

Instructions:

The answers to exercises should be provided in a folder that is zipped. The folder should contain:

1. A python code that performs the computations in a well-organized way. Please ONLY use the AnswersSheet_Week11.py file (available on Canvas) to submit your codes.

2. The folder that contains the code will also contain the data files.

3. The code should be in a folder whose name is YourIDnumberWeek11 and it should be zipped, so the zipped file’s name must be YourIDnumberWeek11.zip and uploaded on Canvas.

You will be assessed based on the accuracy of your answers and the quality and readability of the code.

Your answers will only be marked if it submitted via the ZIP folder.

Students are expected to be able to explain or demonstrate any features or techniques in their assignments if requested.

Students should also be aware that stolen USBs, laptops and corrupted files are not considered grounds for an extension under the BBus Assessment Guidelines, make sure you back up your work securely.

Week 11 Exercises

Task 1: Function

Write a function that calculates your total savings in 10 years if you put $8,000 in term deposits with an interest rate of 2.5% per annum. Interest is compounded monthly.

������������ = ������������ × (1 + ������)������

������������ is the amount of capital invested

������ is the interest rate per month.

n is the number of months.

������������ is the future value of the savings.

Task 2: Resample

Upload the file "stock_price.csv". It contains daily stock prices for the period January 2003 to October 2011.

· Count the number of observations contained in this file.

· Resample the above file into weekly frequency.

· Count again the number of observations in the resampled file.

· Resample the original file again into monthly frequency.

· How many observations are left?

Task 3: Join and Plot

Upload the files "stock_price2.csv" and "SPX.csv" into Python. Note that the first file contains daily observations while the second file contains monthly observations.

· Join the two files together and plot the stock prices for Google [GOOG] and the S&P500 index [SPX].

· Discuss what you observe.

Task 4: Datatime Object.

Upload the file ”TY_prices.csv” to Python. It contains today's prices for the Fed Funds Rate Futures Contracts (TY) denoted in "America/Chicago" time.

· First, convert the 'Time' column into a Datetime object.

· Check the local time zone for "America/Chicago" via getzz.

· Once this is done, localise the DateTime to America/Chicago and then convert it into "Pacific/Auckland" time.

Task 5: Pie Chart

Still using the file "stock_price.csv":

· For each stock, compute the mean stock value.

· Create a pie chart for these three stocks’ mean values.

· Add label and title.

· Use explode argument to separate the smallest slice from the pie chart.

· Comments on the chart