Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions