Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is a project. IT IS A CSV FILE AND I POSTED THE DATA BELOW THE QUESTION, put it in an excel document and save

This is a project. IT IS A CSV FILE AND I POSTED THE DATA BELOW THE QUESTION, put it in an excel document and save as csv to work on it

1.get_input_descriptor() This function repeatedly prompts for the name of an input file until the user enters filename and the file can be opened for input. 2) get_data_list(file_object,column_name) This function reads the file of Tesla's data. The function is flexible as it can read the data for any column of the data based on the user input. For example, if the user enters the input "Open", the program should gather the data from the 1st column. If the user enters the input "Volume", it gathers data from the 6 th column, etc. 1 . The function should return a list of lists with each inner list representing one day and the particular information related to that day. Each inner list is of the form: [date, column_data]. For example, if a user asks to collect data for "Volume", then the return should be a list of lists and the first 2 items in the main list should be ['2014-06-11', 3977500] and ['2014-06-12', 5993700]. 3) get_month_stats(list_of_lists,date) In this function, the program should take in two inputs: 1) the list of lists generated by get_data_list, 2) a month/year timestamp (such as 06/2014). The program should be flexible to handle at least three different ways of writing a date, for instance: 06/2014, 6/14, Jun-2014. The function should generate the following basic statistics and print them out: 1) the average value of the requested column, 2) the maximum 3 days for the requested column, 3) the minimum 3 days for the requested column. 1 You can try mapping the names to indices using a data structure such as list or dictionary. 4) get_all_stats(list_of_lists) In this function, the program should take the list of lists generated by get_data_list and average the data for each month. Then, it should return the top 5 and bottom 5 average values. Notice that this function is different from get_month_stats() because: 1) it only calculates the average values (not need for max and min), 2) it calculates the averages for each month and returns the top / bottom 5 averages. Notice that the dates in the output of this function only contain month and the year (but not the day). 5) main() In this function, you should call get_input to get a file descriptor ask the user for the column name to get statistics about ask the user if they want to get stats for a particular month or overall averages call the relevant functions Print the results Ask the user if they want to re-run the program again or not. If not, then terminate.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions