Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python coding quesition - You are given a CSV file containing stock information. It has the following columns: Date, Open (2), Close, High, Low, Volume,

Python coding quesition - You are given a CSV file containing stock information. It has the following columns: Date, Open (2), Close, High, Low, Volume, and Adj Close. Write function "def testdata" with the following agruments:

Example of data file:

def testdata(filename, col, day): """Queries data loaded intoprogram.  Arguments:  filename: A string for the filename containing the stock data,  in CSV format.  col: A string of either "date", "open", "high", "low", "close",  "volume", or "adj_close" for the column of stock market data to  look into.  The string arguments MUST be LOWERCASE!  day: An integer reflecting the absolute number of the day in the  data to look up, e.g. day 1, 15, or 1200 is row 1, 15, or 1200  in the file.  Returns:  A value selected for the stock on some particular day, in some  column col. The returned value *must* be of the appropriate type,  such as float, int or str.  """

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

Databases In Networked Information Systems 6th International Workshop Dnis 2010 Aizu Wakamatsu Japan March 2010 Proceedings Lncs 5999

Authors: Shinji Kikuchi ,Shelly Sachdeva ,Subhash Bhalla

2010th Edition

3642120377, 978-3642120374

More Books

Students also viewed these Databases questions