Question: Python assignment EC 216/217 Project 2 (Python) Deadline: Sept 30h Background Data mining is the process of sorting through large amounts of data and picking
EC 216/217 Project 2 (Python) Deadline: Sept 30h Background Data mining is the process of sorting through large amounts of data and picking out relevant information. In this project, we want to do some basic data mining to the prices of Google stock. Your program will calculate the monthly average prices of Google stock from 2016 to 2018, and tell us the 6 best and 6 worst months for Google Project Specifications First, you need to download the Google stock prices between January 1 2016 and January 1", 2018. You can get this list from finance yahoo.com. The data is in a "comma separated value" file format (csv), which means that each entry is separated from the others by a comma. Examining the file in a text editor or a spreadsheet program or both should help you understand the format A template program will be given to you, which is used for your program's frame. There are three functions with their simple descriptions, and you are required to implement them correctly a get data listgile name) In this function, you are required to read the file of stock's historical prices. You should use FILE NAME instead of hard code "GOOG.csv" in this function, that way if we wanted to use a different table at any time we could just change the call to the function and not have to change the function itself. After reading each line, you will split it into a list, and append this list to another main list, suppose its name is "data_list". So, data list is a list of lists, ak.a. 2-D list. At the end of this function, return data list. b. get monthly averages(data list) In this function, you will use the data list generated by the first function as the parameter. Use Date, olume, and Adj Close to calculate the average monthly prices. How to calculate the average price? Suppose one day's volume and close price are Vi and C respectively, then that day's total sales equals v, . C. We will use the-volume" column for the day's volume and the "Adj. Close" column for the day's close. Now suppose another day's volume and close price are V: and Cs. The average of these 2 days is the sum of the total sales divided by the total volume. So, the average price of these two days is calculated in this way average price (ViC +VC/V To average a whole month you just add up the total sales (V'C) for cach day and divide by the sum of all the volumes (Vi+ V2 + ..V For each month create a tuple with 2 items, the average for that month, and the date (you only need the month and year). Append the tuple for each month to a list (e.g. monthly averages list), and after ealculating all the monthly averages, return this list. We use tuples here because once these values are we don't want to accidentally change them
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
