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.
-
a. Create a simple detection system that can be used to solve the juice bar crises. b. What do you think is the optimal role for detection in this problem? The Veggie-Buffet Restaurant is a downtown...
-
You have just been hired to prepare, if possible, an income statement for the year ended December 31, 2022, for Rogers Window Washing Company. The problem is that Roger kept only the following...
-
Using only the linear part of the moisture absorption curve for a temperature of \(77^{\circ} \mathrm{C}\) in Figure 5.12, and assuming a thickness of \(2.54 \mathrm{~mm}\), estimate the diffusivity...
-
Ampco is a manufacturing company that has a contract to supply a customer with parts from April through September. However, Ampco does not have enough storage space to store the parts during this...
-
HISTORY OF PSYCHOLOGY PART 1 : Phrenology was a wildly popular but untrue scientific theory. Find another popular but untrue scientific theory. Find a URL on the internet exploring at least one more...
-
Suppose this morning SPB Ltd., a solar panel and battery manufacturing company, paid a dividend of $5 per share. At 10 a.m. SPB announced its latest earnings results (which were unexpectedly good)...
-
Price per kg 1. The supply and demand graph below shows the market for coffee in the country of Idealia. Idealia is currently closed to trade, but is considering opening its markets. Domestic market...
-
An independent distributor bought a new vending machine for \(\$ 2,000\). It had a probable scrap value of \(\$ 100\) at the end of its expected 10-year life. The value \(V\) at the end of \(n\)...
-
It is estimated that \(t\) years from now, the population of a certain suburban community will be \[P(t)=20-\frac{6}{t+1}\] thousand people. a. What will the population of the community be 9 years...
-
The velocity \(v\) (in feet per second) of the rock dropped into the well in the B.C. cartoon at the beginning of this section is also related to time \(t\) (in seconds) by the formula \[v=32 t\]...
-
Try creating a text cloud that captures the key threads of a chapter or an article that you are assigned to read for class. What kind of a visual picture emerges? What key terms seem to anchor the...
-
If the planet Mercury is 28 million miles from the sun at perihelion and the eccentricity of its orbit is about \(1 / 5\), how long is the major axis of Mercury's orbit?
-
Consider the following information from Practel Corporation s consolidated financial statements for 2 0 2 0 : Net income $ 2 5 , 0 0 0 , 0 0 0 Net income attributable to Practel 2 4 , 6 0 0 , 0 0 0...
-
Three forces with magnitudes of 70pounds, 40 pounds, and 60 pounds act on an object at angles of 30, 45, and 135, respectively, with the positive x-axis. Find the direction and magnitude of the...
-
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)...
-
A thin stainless steel disk of thickness \(b\) and outer radius \(r_{o}\) has been heat treated to a high, uniform initial temperature of \(T_{i}\). The disk is then placed upon a small stand and...
-
A plane wall of a furnace is fabricated from plain carbon steel \(\left(k=60 \mathrm{~W} / \mathrm{m} \cdot \mathrm{K}, ho=7850 \mathrm{~kg} / \mathrm{m}^{3}, c=430 ight.\) \(\mathrm{J} / \mathrm{kg}...
-
A steel sphere (AISI 1010), \(100 \mathrm{~mm}\) in diameter, is coated with a dielectric material layer of thickness \(2 \mathrm{~mm}\) and thermal conductivity \(0.04 \mathrm{~W} / \mathrm{m} \cdot...
Study smarter with the SolutionInn App