Answered step by step
Verified Expert Solution
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started