In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "how to use Python to see the number of people taking the postgraduate entrance examination". The content in the article is simple and clear, and it is easy to learn and understand. please follow the editor's train of thought to study and learn "how to use Python to see the number of people taking the postgraduate entrance examination".
In order to see the growth trend of the number of postgraduate entrance exams in recent years, I use python to draw the following line chart.
As can be seen from the picture, the number of applicants for the postgraduate entrance examination has increased greatly since 2015. The number of people taking the postgraduate entrance examination this year is expected to be between 320 and 3.5 million.
As shown in the figure above, the enrollment ratio was 2.78 in 2017 and 3.12 in 2018. With the increase in the number of applicants, the number of admissions is also on the rise.
Implementation code
It mainly uses pandas to read data and matplotlib to draw line chart. Some small pits encoded in Chinese are encountered, and the code is as follows.
Import pandas as pdimport matplotlib.pyplot as plt# first, read data df = pd.read_csv ("kaoyan.csv", encoding='gb2312') # print (df) # second Drawing line chart plt.rcParams ['font.sans-serif'] = [' SimHei'] # can explain problems that cannot be displayed in Chinese # 1) create canvas plt.figure (figsize= (10L5), dpi=80) # 2) draw images plt.style.use ('ggplot') # matplotlib officially provides five different graphic styles # bmh, ggplot, dark_background, fivethirtyeight and grayscaleplt.plot (df ["year"], df ["number of applicants"] / 10000, label= "number of applicants") plt.plot (df ["year"] [:-1], df ["number of enrollment"] [:-1] / 10000 Label= "number of applicants") plt.title ("enrollment and admission of postgraduate entrance exams in recent years") plt.xlabel ("year") plt.ylabel ("number of candidates (ten thousand)") # set digital label for a, b in zip (df ["year"], df ["number of applicants"] / 10000): plt.text (a, b, b, ha='center', va='bottom', fontsize=10) for a B in zip (df ["year"] [:-1], df ["number of students"] [:-1] / 10000): plt.text (a, b, b, ha='center', va='bottom', fontsize=10) plt.legend () plt.grid (True) # Save image plt.savefig ("zhexian.jpg") # 3) display image plt.show () Thank you for reading The above is the content of "how to use Python to see the number of postgraduate entrance exams". After the study of this article, I believe you have a deeper understanding of how to use Python to see the number of postgraduate entrance examinations. the specific use also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.