You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
748 B
28 lines
748 B
import matplotlib.pyplot as plt
|
|
import pandas as pd
|
|
|
|
data = pd.read_csv("最新数据.csv")
|
|
# 将工作经验这一列数据提取出来
|
|
gzjy = data[["工作经验",'职位名称']]
|
|
# 将工作经验去重后转化为列表变成x轴数据
|
|
x_data = gzjy['工作经验'].drop_duplicates().tolist()
|
|
|
|
# 将工作经验进行分组计数变为y轴数据
|
|
y_data = gzjy.groupby('工作经验').count().reset_index()
|
|
y_data = y_data['职位名称'].tolist()
|
|
y_data.sort(reverse=True)
|
|
|
|
plt.figure()
|
|
plt.rcParams['font.sans-serif'] = ['SimHei']
|
|
|
|
plt.plot(x_data,y_data,'g^--')
|
|
plt.xlabel('年份')
|
|
plt.ylabel('数量')
|
|
for i in range(len(x_data)):
|
|
plt.text(x_data[i],y_data[i],y_data[i])
|
|
|
|
plt.title('求职所需要的工作经验排行')
|
|
|
|
plt.show()
|
|
|