Question: Step 1. Load the attached Bitcoin Historical Data.csv file into Colab. You can use any data to show an example. Step 2. Define a class
Step 1. Load the attached Bitcoin Historical Data.csv file into Colab. You can use any data to show an example.
Step 2. Define a class whose name is FinancialInstrument.
The class includes the special method __init__(self)
__init__(self) includes a private instance attribute of an empty DataFrame: self.__df = pd.DataFrame()
Step 3. Add a new method to the class whose name is load_data(self, filename), and write your codes to load a csv file and put the loaded data to self.__df
Step 4. Add a new method to the class whose name is print_data(self), and write your codes to print self.__df
Step 5. Create a FinancialInstrument object, and run print_data( ). You will get the results below:
Step 6. Run load_data(filename="Bitcoin Historical Data.csv")
Step 7. Try to access __df of the FinancialInstrument object. You will get the error below. Explain the reason why it occurs.
Step 8. Run print_data( ). You will get the results below:
Step 9. Save both your Python codes and results as a PDF file and submit it to Blackboard. Name your file as FINC430-Spring2023-HW3-Last Name-Frist Name
You can print as a PDF file by setting destination as Save as PDF.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
