Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This needs to be coded in Python and saved as a stocks.py Thanks ! You need to process daily stock prices that are stored in
This needs to be coded in Python and saved as a stocks.py
Thanks!
You need to process daily stock prices that are stored in CSV files. Each stock is stored in a CSV file named after the stock's ticker symbol. For example, the stock prices for Alphabet, Inc are stored in a file named G00G.csy Solution Description Write a module named stocks that includes two classes Company with the following instance attributes o symbol: str -the official stock ticker symbol o name str -the company's name o sector: str - the company's sector, as defined by Yahoo Finance o stock_data: dict[datetime, StockData] -a dictionary mapping datetime objects to StockData objects and the following instance methods: -which takes arguments that are used to initialize the values of the instance attribute listed above(except stock-data), in the order listed above. Only the -init symbol must be provided when creating a Company instance, the other instance attributes (except stock_data) should have the value None if not provided as arguments to _initwhen creating a Company object. * o a method which is automatically called whenever a Company object is printed or converted to a str and returns a string with the company's name and stock symbol in parentheses, e.g., Alphabet (EooG) o a method which is automatically called by the Python REPL to print the value of a Company object to the console and returns a string with the class name and all the name-Alphabet, attributes (except stock-data) between angle brackets, e.g.,
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