5.Use the statements as following in the Tushare package to obtain the stock data of China...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
5.Use the statements as following in the Tushare package to obtain the stock data of China Merchants Bank (stock code is 600036) for the first quarter 2020. import tushare as ts import numpy as np df = ts.get_hist_data('600036', start = '2020-01-01', end = '2020-03-31') df = df.iloc[:, :5] # get the first 5 columns df.sort_index(inplace = True) # Sort by the column of date The data is shown in the following table. open high close low volume 2020-03-31 23.91 24.03 23.88 23.74 39998.10 2020-03-28 23.82 24.10 23.99 23.71 34416.47 Page 5 2020-03-27 24.06 24.28 23.90 23.89 43007.21 2020-03-26 24.20 24.28 24.03 23,82 48066.02 2020-03-25 24.48 24.48 24.13 23.91 37519.75 ... ... ... ... ... 2020-01-02 23.90 24.39 24.33 23,63 61194.21 2020-01-01 23.69 | 24.48 24,18 23,56 46819.00 Based on the above data and statements, complete the following data processing and analysis tasks: (1)Select the highest and lowest data of the stock in the first quarter and January of 2020; (2)List the records with the volume above 100000; (3)Calculate the number of days in which the closing price (close) is higher than the opening price (open) in the first quarter the year; (4)Calculate the rise and fall of the opening price two days before and after, the first output is to calculate the difference between every two days (the day after subtracting the previous day), and the second output is a list of the changing of opening price(the rise is indicated by 1 and the fall is indicated by -1); (5)Draw a line chart of the stock's highest and lowest price in January 2020; (6)Plot the scatter chart between the difference between the daily closing price and opening price of the stock and the trading volume of the day in this quarter; (7)Calculate the maximum of the opening price for each month in this quarter. 5.Use the statements as following in the Tushare package to obtain the stock data of China Merchants Bank (stock code is 600036) for the first quarter 2020. import tushare as ts import numpy as np df = ts.get_hist_data('600036', start = '2020-01-01', end = '2020-03-31') df = df.iloc[:, :5] # get the first 5 columns df.sort_index(inplace = True) # Sort by the column of date The data is shown in the following table. open high close low volume 2020-03-31 23.91 24.03 23.88 23.74 39998.10 2020-03-28 23.82 24.10 23.99 23.71 34416.47 Page 5 2020-03-27 24.06 24.28 23.90 23.89 43007.21 2020-03-26 24.20 24.28 24.03 23,82 48066.02 2020-03-25 24.48 24.48 24.13 23.91 37519.75 ... ... ... ... ... 2020-01-02 23.90 24.39 24.33 23,63 61194.21 2020-01-01 23.69 | 24.48 24,18 23,56 46819.00 Based on the above data and statements, complete the following data processing and analysis tasks: (1)Select the highest and lowest data of the stock in the first quarter and January of 2020; (2)List the records with the volume above 100000; (3)Calculate the number of days in which the closing price (close) is higher than the opening price (open) in the first quarter the year; (4)Calculate the rise and fall of the opening price two days before and after, the first output is to calculate the difference between every two days (the day after subtracting the previous day), and the second output is a list of the changing of opening price(the rise is indicated by 1 and the fall is indicated by -1); (5)Draw a line chart of the stock's highest and lowest price in January 2020; (6)Plot the scatter chart between the difference between the daily closing price and opening price of the stock and the trading volume of the day in this quarter; (7)Calculate the maximum of the opening price for each month in this quarter.
Expert Answer:
Answer rating: 100% (QA)
First if tushare not installed in python then install it using pip install tushare Create jupyter notebook and import data frame as given above import... View the full answer
Related Book For
Financial accounting
ISBN: 978-0136108863
8th Edition
Authors: Walter T. Harrison, Charles T. Horngren, William Bill Thomas
Posted Date:
Students also viewed these accounting questions
-
import numpy as np import pandas import matplotlibpyplot as plt import glob import sys import re from tabulate import tabulate def last9chars(x) return(x9) files sorted(globglob('Datatxt'),key...
-
Use Table 13 - 2 for Exercise 21 to 24. See Example 10. Find the compound interest on $2,500 at 0.75% compound daily by Leader Financial bank for 20 days?
-
The data shown in the table on page 464 represent the thrust of a jet-turbine engine (y) and six candidate regressors: x1 = primary speed of rotation, x2 = secondary speed of rotation, x3 = fuel flow...
-
Differentiate between formal and behavioral roles, and describe how behavioral roles emerge during group interaction.
-
The completed worksheet for CJs Accounting Services for the month ended December 31, 2016, appears on shown below. CJs Accounting Services Worksheet Month Ended December 31, 2016 INSTRUCTIONS 1....
-
List and briefly explain five storage management responsibilities of a typical OS.
-
Information technology is continually changing the nature of accounting and the role of accountants. Write a two-page report describing what you think the nature of the accounting function in a large...
-
Manufacturers Southern leased high-tech electronic equipment from Edison Leasing on January 1, 2013. Manufacturers Southern has the option to renew the lease at the end of two years for an additional...
-
Space View Ltd. is a listed company on the Johannesburg Stock Exchange (JSE) that produces lenses and other optical equipment for a variety of telescopes. The company uses an outdated curve generator...
-
The following data relate to the operations of Shilow Company, a wholesale distributor of consumer goods: Current assets as of March 31: Cash $ 8,000 Accounts receivable 20,000 Inventory 36,000...
-
Year 1 Sold $1,346,400 of merchandise on credit (that had cost $984,300), terms n/30. Wrote off $20,400 of uncollectible accounts receivable. Received $667,800 cash in payment of accounts receivable....
-
Question 7 2 Points Calculate the entropy change in water when it has been heated from 27 C to 127 C. The specific heat capacity of water is 4.184 kJ/kg. A 1.204 kJ/kgK B) 4.184 kJ/kgK C 5.885 kJ/kgK...
-
Executives must strengthen their organizations' Sustainability DNA through a three-stage cycle of change: Diagnose, Define and Develop. 1. Explain each of the three-stage cycles and their implication...
-
What is the rate (dq = W m ) at which radiation leaves a specified area of 2 m and passes through an area of 6 m given the spectral intensity is 1.72 W m sr m-1, a solid angle change of 31, and...
-
A firm has total wage bill of $8 million twice a month with a 13% cost of capital. Calculate the benefit to the firm of charging to a monthly pay cycle and discuss the potential impact on the...
-
You have just purchased a new house for $150,000! You have been given a financing option that allows you to make yearly payments for 20 years at an interest rate of 6%. In order to take advantage of...
-
Prove that OddEven-LineSort performs an invariant-sized sort of an equidistribution on an ordered line. () Prove that OddEven-LineSort performs an invariant-sized sort of any distribution on an...
-
Use the graphs of f and g to graph h(x) = (f + g) (x). To print an enlarged copy of the graph, go to MathGraphs.com. 1. 2. y 24 8. 2. -2 -2 4 6
-
You are evaluating two companies as possible investments. The two companies, similar in size, are commuter airlines that fly passengers up and down the West Coast. All other available information has...
-
Assume Online, Inc., opened an office in Clearwater, Florida. Further assume that Online incurred the following costs in acquiring land, making land improvements, and constructing and furnishing the...
-
TransWorld Publishing completed the following transactions for one subscriber during 2010: Oct 1 Sold a one-year subscription, collecting cash of $1,400, plus sales tax of 8%. Nov 15 Remitted (paid)...
-
In its simplest form, an account has only three elements or basic parts. What are these three elements?
-
What happens to the income taxes expense of an unprofitable company?
-
For each of the following transactions, indicate whether the account in parentheses should be debited or credited, and give the reason for your answer. a. Purchased land for cash. (Cash) b. Sold an...
Study smarter with the SolutionInn App