Python and look PubMed three million troops

Despite the internal network to recruit research has been done to improve optimization, or candidates who could not withstand the enthusiasm of registration (website crashes).

Python and look PubMed three million troops

 

In 2017 the number grew to 201 million PubMed,

2018 reached 238 million,

2019 postgraduate enrollment reached 290 million people.

 

Note: Data from "China Education Online"

 

To see the growth trend of recent years, the number of PubMed, I use the following python draw a line chart.

Python and look PubMed three million troops

 

As can be seen from the figure, since 2015, the number of applicants rose PubMed great. This year the number is expected to 320-350 million in PubMed.

Python and look PubMed three million troops

 

As shown above, the message is recorded over 2017 2.78 2018 3.12. With the increase in the number of applicants, the number of admissions are rising Well no!

 

Implementation code

 

Main use of the pandas to read data, matplotlib draw a line chart. Which encountered some Chinese coding pits, the code is as follows.

import pandas as pdimport matplotlib.pyplot as plt# 第一,读取数据df = pd.read_csv("kaoyan.csv", encoding='gb2312')# print(df)# 第二,绘制折线图plt.rcParams['font.sans-serif'] = ['SimHei']# 可以解释中文无法显示的问题# 1)创建画布plt.figure(figsize=(10,5),dpi=80)# 2)绘制图像plt.style.use('ggplot')# matplotlib官方提供了五种不同的图形风格,# 分别是:bmh、ggplot、dark_background、fivethirtyeight和grayscaleplt.plot(df["年份"], df["报名人数"] / 10000, label="报名人数")plt.plot(df["年份"][:-1], df["录取人数"][:-1] / 10000, label="录取人数")plt.title("近年考研人数报名及录取情况")plt.xlabel("年份")plt.ylabel("考生数量(单位:万人)")# 设置数字标签for a, b in zip(df["年份"], df["报名人数"] / 10000):    plt.text(a, b, b, ha='center', va='bottom', fontsize=10)for a, b in zip(df["年份"][:-1], df["录取人数"][:-1] / 10000):    plt.text(a, b, b, ha='center', va='bottom', fontsize=10)plt.legend()plt.grid(True)# 保存图像plt.savefig("zhexian.jpg")# 3)展示图像plt.show()

 

Epilogue

PubMed is one way, perhaps hard, perhaps flat. But traveled this road sure is sunny.

Published 229 original articles · won praise 185 · views 30000 +

Guess you like

Origin blog.csdn.net/qfluohao/article/details/103993674