Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Assignment Overview

The goal of this project is to gain more practice with file I/O, lists and functions.

Background

Data mining is the process of sorting through large amounts of data and picking out relevant information. Everyone from financial analysts to scientists use it to extract information from enormous data sets. These large data sets and the trend of analyzing them has come to be know as "Big Data".

In this project, we want to do some preliminary data mining of the prices of Apple stock. Your program will calculate the monthly average prices of Apple stock from 1984 to 2013. You will report facts about the monthly highs and lows for this data.

Project Specifications

1. A file of Apple's daily stock's prices will be given to you, whose name is table.csv (we pulled it off the web). This file could be opened by notepad or similar text editor, and is delimited by commas. If you open it with Excel, it will show you the data as a spreadsheet.

2. You must implement the following functions:

a) get_input_descriptor()

In this function, you are required to repeatedly prompt for the name of an input file until the user enters filename and the file can be opened for input. Return a file descriptor attached to the opened file.

b) get_data_list(file_object, column_number)

In this function, you are required to read the file of Apple's data. The function is flexible as it can read the data for any column of the data (0 through 6). If you read column 6, you are gathering the data for the "Adjusted Daily Close". If you read column 5, you are gathering data for the "Volume" that day. The function returns a list that consists of tuples. Each tuple is of the form: (date, column_data), the first value is a string, the second is a float. For example: ('2013- 02-08', 474.98) if we were collecting data from column 6.

c) average_data(list_of_tuples)

In this function the parameter is a list, the list of tuples generated by get_data_list above.

You will average the data for each month, and generate a list of tuples. A tuple here will have the form: (data_avg, date), the first is a float, the second is a string. For example: (2972945.4545454546, '07:1985'). Note the date in the returned list does not contain a day any more.

Programming Project 04
Summer 2014

Because each month has multiple entries the biggest challenge is to collect the data for each month together. One way to is to have variables "current_month" and "current_year" and update them when the month changes. That is, read lines summing data for the "current_month" until you encounter a new month. Encountering a new month means that you are done summing data for the "current_month" so you can calculate an average for the "current_month". After calculating the average, you can now set "current_month" to a new month and start summing values for the new "current_month."

d) main()

In this function, you:

• call get_input to get a file descriptor
• prompt for the column to average
• call the get_data function
• call the average_data function
• print the highest 6 averages (for the column selected) and the lowest 6 averages. Print that data with the month-year information.

Attachment:- table.csv

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91380767
  • Price:- $30

Guranteed 24 Hours Delivery, In Price:- $30

Have any Question?


Related Questions in Computer Engineering

Sql transactions exercisesperform the test for the

SQL Transactions Exercises Perform the test for the non-additive join property (lossless join) for the relation R(A 1 , A 2 , A 3 , A 4 , A 5 ), and the decompositions D a , D b , D c , D d  and set of functional depende ...

The equation of regression line for sons heighty in inches

The equation of regression line for son's height(y) in inches versus father's height in inches is y = 35 + 0.5x. For a 72 inch tall father, what would we predict for the son's height?

Quesiton an important principle in information security is

Quesiton: An important principle in information security is the concept of layers of security, which is often referred to as layered security, or defense in depth. 1) Please explain the concept of layers of security. 2) ...

Each student will create classes methods and design icons

Each student will create classes, methods, and design icons for their mobile device application using OOP language and GUI. The following must be included. Your instructor may add additional requirements, if any, in a se ...

Your solution will entail writing a function called

Your solution will entail writing a function called TimeDifference and a test main that demonstrates that you can compute the time difference in minutes between the two times. TimeDifference is a function that receives a ...

Question you are required to sort a file containing

Question : You are required to sort a file containing integers between 0 and 999999. You cannot afford to use one million pigeon-holes, so you decide instead to use one thousand pigeon-holes numbered from 0 to 999. You b ...

Introduction to software developmentmenu-driven

Introduction to Software Development Menu-Driven Programs TASKS: Language translator. Design a program that display the following menu: Select a language and I will say Good Morning English Italian Spanish German End the ...

Question read the following topic then explain where a

Question: Read the following topic then explain Where a datagram can be fragmented? Where the fragmented datagram can be reassembled? Fragmentation of Datagram Packets used by the IP are called datagrams. For a networks ...

Question suppose an algorithm requires cn2nbspoperations

Question : Suppose an algorithm requires cn 2  operations when performed with an input of size n (where c is a constant). a. How many operations will be required when the input size is increased from m to 2m (where m is ...

Stacksthere are two main operations associated with stacks1

Stacks There are two main operations associated with stacks; 1) putting things on the stack which is referred to as push, 2) taking things from the stack which is referred to as pop. We can create a stack using linked li ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As