拉勾网数据分析职位的分析
发布时间
阅读量:
阅读量
import pandas as pd
import numpy as np
from pandas import DataFrame,Series
from matplotlib import pyplot as plt
#添加中文字体
from pylab import mpl
mpl.rcParams['font.sans-serif'] = ['SimHei']
tests = pd.read_excel("/******/copy.xlsx")
#查看数据完整性,只有labels列有缺失值,但是影响并不大
tests.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 449 entries, 0 to 448
Data columns (total 18 columns):
_clueid 449 non-null int64
scale 449 non-null object
salary 449 non-null object
average_salary 449 non-null float64
low 449 non-null int64
top 449 non-null int64
avg_salary 449 non-null float64
experience 449 non-null object
education 449 non-null object
campany 449 non-null object
industry 449 non-null object
scale2 449 non-null object
phase 449 non-null object
temptation 449 non-null object
description 449 non-null object
district 449 non-null object
labels 446 non-null object
city 449 non-null object
dtypes: float64(2), int64(3), object(13)
memory usage: 63.2+ KB
清晰数据:
1、将全部重复的列,和无用的列直接在excel中做删除
2、薪资是一个范围区间,可求出平均值来分析,最低工资:=LEFT(C2,FIND(“k”,C2,1)-1),最高工资:=MID(C2,FIND("-",C2)+1,LEN(C2)-FIND("-",C2)-1)
3、观察公司规模有2列scale和scale2,需要做合并,删减
# 查看城市对数据分析职位的需求
tests.city.value_counts()
#可以将数量少的归为‘其他’类
tests['city']= tests['city'].replace(["郑州","厦门","重庆","苏州","佛山","天津","贵阳","昆明","南京","东莞","福州","常州","珠海",
"乌鲁木齐","石家庄"],"其他")
tests.city.value_counts()
北京 227
上海 48
杭州 48
深圳 39
广州 39
其他 23
长沙 11
成都 8
武汉 6
Name: city, dtype: int64
#查看各个城市对职位的需求;可以看出北京的需求量远远高于其他城市,其次是上海和杭州
tests.city.value_counts().plot(kind='bar')
<matplotlib.axes._subplots.AxesSubplot at 0xedce908>

# 查看数据分析职位对学历的需求;可以看出数据分析职位所需人才大多在本科水平
tests.education.value_counts()
tests.education.value_counts().plot(kind='bar')
<matplotlib.axes._subplots.AxesSubplot at 0xf0454e0>

#工作经验和职位数量的关系;不做可视化,可以看出职位要求工作经验在3-5年的需求对多,其次是1-3年
tests.experience.value_counts()
3-5年 210
1-3年 159
5-10年 46
不限 34
Name: experience, dtype: int64
#查看职位对phase
tests.phase.value_counts()
不需要融资 97
上市公司 88
D轮及以上 81
C轮 75
B轮 49
A轮 43
未融资 11
天使轮 5
Name: phase, dtype: int64
# 平均薪资汇总统计
tests.average_salary.describe()
count 449.000000
mean 18.268374
std 8.234619
min 2.500000
25% 12.500000
50% 17.500000
75% 22.500000
max 75.000000
Name: average_salary, dtype: float64
#做可视化分析,薪资的分布情况
tests.average_salary.hist()
#从图中可以看出薪资大多在10k-20k之间
<matplotlib.axes._subplots.AxesSubplot at 0xf09db38>

#对影响薪资水平的因素进行分析,采用箱线图,不同城市的薪资分布情况
tests.boxplot(column='average_salary',by='city')
<matplotlib.axes._subplots.AxesSubplot at 0xf0ad550>

#不同工作年限的薪资的分布情况
tests.boxplot(column='average_salary',by='experience')
<matplotlib.axes._subplots.AxesSubplot at 0x1012c4a8>

#不同学历的薪资分布情况
tests.boxplot(column='average_salary',by='education')
<matplotlib.axes._subplots.AxesSubplot at 0x1021f438>

#不同城市的平均薪资
pd.DataFrame(tests.groupby('city').average_salary.mean())
| average_salary | |
|---|---|
| city | |
| 上海 | 17.541667 |
| 其他 | 11.782609 |
| 北京 | 20.074890 |
| 广州 | 16.230769 |
| 成都 | 10.250000 |
| 杭州 | 17.947917 |
| 武汉 | 13.500000 |
| 深圳 | 20.205128 |
| 长沙 | 7.909091 |
test_city_mean = pd.DataFrame(tests.groupby('city').average_salary.mean())
test_city_mean.plot(kind='bar')
<matplotlib.axes._subplots.AxesSubplot at 0x1031cfd0>

#不同学历对平均薪资的影响
test_education_mean = pd.DataFrame(tests.groupby('education').average_salary.mean())
test_education_mean.plot(kind='bar')
<matplotlib.axes._subplots.AxesSubplot at 0x103ae0f0>

#不同经验对平均薪资的影响
test_experience_mean = pd.DataFrame(tests.groupby('experience').average_salary.mean())
test_experience_mean.plot(kind='bar')
<matplotlib.axes._subplots.AxesSubplot at 0x10396b70>

#不同城市,不同经验对平均薪资的影响;可以看出,5-10年工作经验的平均薪资最高,其次是3-5年,得出结论,经验越高,工资水平越高。
test_city_experience_mean = pd.DataFrame(tests.groupby(['city','experience']).average_salary.mean()).unstack()
test_city_experience_mean.plot(kind='bar',figsize=(10,8))
<matplotlib.axes._subplots.AxesSubplot at 0x103ae710>

#不同城市,不同学历 对平均薪资的影响;可以看出,北上广深一线城市对于学历的要求大多在硕士和本科
test_city_education_mean = pd.DataFrame(tests.groupby(["city","education"]).average_salary.mean()).unstack()
test_city_education_mean.plot(kind='bar',figsize=(13,6))
<matplotlib.axes._subplots.AxesSubplot at 0x10417198>

test_city = tests[tests.city.isin(['上海','北京'])]
# 多维度分析,同一地区,不同学历对薪资的影响,拿北京和上海比较,可以看出,在相同学历背景下,北京比上海总体薪资水平要高。
fig = plt.figure()
test_city = tests[tests.city.isin(['上海','北京'])]
test_city.boxplot(column='average_salary',by=['education','city'],figsize=(10,6))
plt.show()
<Figure size 432x288 with 0 Axes>

# 再从另一个角度分析,同一地区,不同经验对薪资的影响,同样也是北京和上海;
test_experience = tests[tests.city.isin(["北京","上海"])]
test_experience.boxplot(column='average_salary',by=['experience','city'],figsize=(10,6))
<matplotlib.axes._subplots.AxesSubplot at 0x104bcda0>

#公司规模大小对职位的需求;可以看出,规模越大的公司对于数据分析职位需求越大。
tests.scale.value_counts()
tests.scale.value_counts().plot(kind='bar')
<matplotlib.axes._subplots.AxesSubplot at 0x107dd6a0>

全部评论 (0)
还没有任何评论哟~
