Question: USE PYTHON Problem 2: Costco Stock SMA Objective (The code must comply with the following) List and string handling: split, indexing, leno List comprehension, with

USE PYTHON

USE PYTHON Problem 2: Costco Stock SMA Objective (The code must comply

Problem 2: Costco Stock SMA Objective (The code must comply with the following) List and string handling: split, indexing, leno List comprehension, with if and else . If statement . File reading, csv file handling . nan: Not a number, matplotlib will auto ignore all 'nan' entries Matplotlib: make line plots, line/dot style, label, saving figure Download 1 year COST (Costco) stock data from finance.yahoo.com. First go to finance.yahoo.com, search historical data, choose '1 year' and 'daily', click apply, then click 'Download Write a function called 'get sma, that takes two input argument. First argument is the original prices of type list, and 2d input argument being the number of days we want to calculate SMA, like day sma or 35 day sma. This function should return a new list of sma price, based on the input day range, and should be able to handle any SMA calculation, like: sma200 for 200 days moving average Write a function called 'read data', which will be used to open rea data processing. We will be using the 'Adj Close' column as our 'prices'. This function should return 2 lists: a list of dates, and a list of original prices d/close of the csv file, as well as some Make another function called "make plot", which will take 4 input arguments, all in list format. The 4 input lists are: dates, original prices, sma10 prices, sma50 prices (for 10 and 50 days moving average respectively). This function should use matplotlib to make plots and save image to harddisk. Write a function called "main that wil1: . Call read data to read . Call get sma to-et sma10 and sma50 of costco stock prices, in original price as a list as 2 lists. "sma10" means the 10 day SMA data as a list. . Call make_plot, using the 4 lists we have . Also make sure to write code that will call the main function, so your python code can be executed Note: Please make the code as clean as possible. No duplicated code. No unnecessary lines. Repeated code will get points deducted. Only nice and clean code can get full score. Finally: For costco stock price plot, make the x axis use dates instead of numbers. Your plot may use something like: 01/2017, 02/2017 - You must show clearly that it's a 'date format. Problem 2: Costco Stock SMA Objective (The code must comply with the following) List and string handling: split, indexing, leno List comprehension, with if and else . If statement . File reading, csv file handling . nan: Not a number, matplotlib will auto ignore all 'nan' entries Matplotlib: make line plots, line/dot style, label, saving figure Download 1 year COST (Costco) stock data from finance.yahoo.com. First go to finance.yahoo.com, search historical data, choose '1 year' and 'daily', click apply, then click 'Download Write a function called 'get sma, that takes two input argument. First argument is the original prices of type list, and 2d input argument being the number of days we want to calculate SMA, like day sma or 35 day sma. This function should return a new list of sma price, based on the input day range, and should be able to handle any SMA calculation, like: sma200 for 200 days moving average Write a function called 'read data', which will be used to open rea data processing. We will be using the 'Adj Close' column as our 'prices'. This function should return 2 lists: a list of dates, and a list of original prices d/close of the csv file, as well as some Make another function called "make plot", which will take 4 input arguments, all in list format. The 4 input lists are: dates, original prices, sma10 prices, sma50 prices (for 10 and 50 days moving average respectively). This function should use matplotlib to make plots and save image to harddisk. Write a function called "main that wil1: . Call read data to read . Call get sma to-et sma10 and sma50 of costco stock prices, in original price as a list as 2 lists. "sma10" means the 10 day SMA data as a list. . Call make_plot, using the 4 lists we have . Also make sure to write code that will call the main function, so your python code can be executed Note: Please make the code as clean as possible. No duplicated code. No unnecessary lines. Repeated code will get points deducted. Only nice and clean code can get full score. Finally: For costco stock price plot, make the x axis use dates instead of numbers. Your plot may use something like: 01/2017, 02/2017 - You must show clearly that it's a 'date format

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 Databases Questions!