Question: Initialize the Dow Jones Industrials dataset as shown below: values = np.loadtxt('http://people.bu.edu/kalathur/datasets/DJI_2018_values.txt') dates = np.loadtxt('http://people.bu.edu/kalathur/datasets/DJI_2018_dates.txt', dtype='str') 1) Show the appropriate formatted output for the first
Initialize the Dow Jones Industrials dataset as shown below:
values = np.loadtxt('http://people.bu.edu/kalathur/datasets/DJI_2018_values.txt') dates = np.loadtxt('http://people.bu.edu/kalathur/datasets/DJI_2018_dates.txt', dtype='str')
1) Show the appropriate formatted output for the first five dates and their corresponding values.
2) Print the lowest value and the day it occurred in the dataset. Similarly, print the highest value and the day it occurred in the dataset. Use the numpy min, argmin, max, and argmax functions.
3) Using day to day differences, show the results for the maximum one-day gain. Output should show the result along with the corresponding dates and values. Similarly, show the results for the maximum one-day loss.
4) Show the results here there is at least 500-point gain from the previous day. Output should include the gain, the dates and values of the corresponding day and prior day.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
