Home > other >  Python statistics specified plate at a specified date or number of shares is greater than the specif
Python statistics specified plate at a specified date or number of shares is greater than the specif

Time:10-11

The specific requirements:
1) obtain all industry stock code;
2) get "home appliance industry, chemical industry and environmental protection industry" three industry stock code;
3) to obtain three industry stock on November 8, 2019 K line data;
4) statistics of the three industries in November 8, 2019 to rise the number of not less than 2% of the shares;
5) to draw the histogram statistical results show that 4), horizontal axis as the names of the three industries, the vertical axis harden stock number, respectively for the three industry,

Tip:
1) tushare provides ts. Get_industry_classified () function to obtain industry data
2) obtain industry data, can according to the industry name using Boolean indexing filtering for each industry stock code; The three industry processing respectively;
3) for each stock on November 8, 2019 K line data are got a DataFrame contains only a data, you can use these DataFrame concat function in the vertical direction of the pandas on collection to a DataFrame;
4) using Boolean indexing to whether all the stock in an industry to gain greater than or equal to 0.02 filter, then statistics;
Histogram drawn bar function to produce three Numbers as x range, with three industry or greater than or equal to the number of 0.02 list is composed of y, will tick_label parameter is set to a name list of three industry,
What a great god knows how to sit? The small white a face of meng force,
  • Related