「數據遊戲」:數據告訴你多讀書到底能不能多賺錢?

北起漠河南至曾母暗沙,東達撫遠西至斯姆哈納。在廣袤的中國土地上,千百年一直流傳着古老的傳說:書中自有黃金屋。前端

今天,我就用數據告訴你,書中到底有沒有黃金屋。git

數據來源

利用 Max 的拉勾爬蟲爬取了拉勾杭州站,要求3~5年工做經驗的1000條招聘數據。github

簡單數據分析

疑問1:不一樣學歷進的公司規模有明顯不一樣嗎?

positionlist_grouped = positionlist.groupby(by = ['companySize','education'],as_index = False).count()

將數據按照公司規模與教育程度分組。後端

plt.rcParams['font.family'] = ['Arial Unicode MS'] 
plt.rcParams['axes.unicode_minus'] = False 
 
sns.set_style('whitegrid',{'font.sans-serif':['Arial Unicode MS','Arial']})


# Draw a nested barplot to show survival for class and sex
g = sns.catplot(x="companySize", y="positionId", hue="education", data=positionlist_grouped,
                height=6, kind="bar", palette="muted")
g.despine(left=True)
g.set_ylabels("count");

繪製分組數據的條形圖。微信

從圖上能夠看到,雖然明確要求碩士的崗位比較少,可是不一樣規模的公司對學習要求的分佈基本一致。異步

不一樣學歷進的公司規模沒有明顯不一樣。學習

疑問2:不一樣學歷進的公司財務情況有明顯不一樣嗎?

作法與疑問1同樣,區別是將數據按照財務情況和學歷進行分組,而後繪製分佈的條形圖。flex

groupbyfe = positionlist.groupby(by = ['financeStage','education'],as_index = False).count()

咱們能夠看到 C 輪的公司開放給大專學歷的崗位相比 B 輪有一個斷崖式的下跌。餅圖會更明顯的反應出這個現象。人工智能

plt.pie('positionId',labels = 'financeStage',data = groupbyfe[groupbyfe['education'] == '大專'],autopct='%1.1f%%')
plt.title('專科');
....
....# 省略了繪製本科的代碼
....# 省略了繪製碩士的代碼

<div style = 'display:flex;justify-content:space-around'>
<img src = 'https://user-gold-cdn.xitu.io...;h=250&f=png&s=21188' style = 'width:30%;height:30%'>
<img src = 'https://user-gold-cdn.xitu.io...;h=250&f=png&s=21948' style = 'width:30%;height:30%'>
<img src = 'https://user-gold-cdn.xitu.io...;h=249&f=png&s=20731' style = 'width:30%;height:30%'>
</div>spa

對比三個餅圖,注意觀察本科和專科,B、C 輪公司的分佈,咱們能夠看到 C 輪的公司提供給專科學歷的人的崗位佔比很是的低。

因此對於疑問2,個人見解是:不一樣學歷進的公司財務情況基本一致,可是 C 輪的公司可能更傾向於招募本科及本科以上學歷的員工。

疑問3:不一樣的崗位對學歷的要求有明顯不一樣嗎?

對於這個問題,我繪製了詞雲。

  1. 首先將數據按照職位類別和學歷進行分組並統計頻數
  2. 僅保留分組數據的職位類別和學歷列
  3. 將新的數據轉置
  4. 將職位類別行設置爲列名
  5. 利用 pandas 的 to_dict 方法生成詞頻數據
  6. 利用 wordcloud 的 generate_from_frequencies 方法繪製詞頻
positionlist_grouped = positionlist.groupby(by = ['secondType','education'],as_index = False).count()
grouped_dz = positionlist_grouped[positionlist_grouped['education'] == '大專'].loc[:,['secondType','positionId']].T.dropna(axis = 1)
grouped_dz.rename(columns=grouped_dz.loc['secondType',:],inplace = True)
grouped_dz.drop(labels = 'secondType',inplace=True)

from wordcloud import WordCloud
wordcloud = WordCloud(font_path='/Library/Fonts/Songti.ttc',background_color='white').generate_from_frequencies(grouped_dz.to_dict('records')[0])
plt.imshow(wordcloud, interpolation='bilinear')
plt.axis("off")
plt.show()

<div style = 'display:flex;justify-content:space-around;margin-top:4em;'>
<img src = 'https://user-gold-cdn.xitu.io...;h=200&f=png&s=70352' style = 'width:30%;height:30%'>
<img src = 'https://user-gold-cdn.xitu.io...;h=200&f=png&s=71913' style = 'width:30%;height:30%'>
<img src = 'https://user-gold-cdn.xitu.io...;h=200&f=png&s=57746' style = 'width:30%;height:30%'>
</div>

上面三張圖由左至右分別是專科、本科與碩士學歷的職位詞雲。

能夠看到銷售相關的工做要求專科學歷便可,運營、後端開發、移動前端開發、產品經理等崗位對學歷的要求專科、本科勢均力敵。而一些當下火熱的崗位,好比人工智能、硬件開發、數據開發等,大部分公司對學歷的要求是碩士。

疑問4:不一樣學歷的薪資有明顯不一樣嗎?

終於,到了最核心也是你們最關心的部分。

原始數據的薪資是一個區間,將區間拆分爲最低與最高兩個變量。

positionlist['Lsalary']=positionlist['salary'].str.split('-',expand  = True)[0].str[:-1].astype(int)
positionlist['Hsalary']=positionlist['salary'].str.split('-',expand  = True)[1].str[:-1].astype(int)

繪製不一樣學歷的最低薪資與最高薪資分佈直方圖。

x = positionlist[positionlist['education'] == '大專'].loc[:,['Lsalary']]
y = positionlist[positionlist['education'] == '本科'].loc[:,['Lsalary']]
z = positionlist[positionlist['education'] == '碩士'].loc[:,['Lsalary']]
ax = sns.distplot(x)
ax = sns.distplot(y)
ax = sns.distplot(z)
ax.set_xlabel('工資(單位K/月)')
ax.set_title('最低工資分佈');
#*****最高薪資👇***********#
x = positionlist[positionlist['education'] == '大專'].loc[:,['Hsalary']]
y = positionlist[positionlist['education'] == '本科'].loc[:,['Hsalary']]
z = positionlist[positionlist['education'] == '碩士'].loc[:,['Hsalary']]
ax = sns.distplot(x,kde_kws={"label": "大專"})
ax = sns.distplot(y,kde_kws={"label": "本科"})
ax = sns.distplot(z,kde_kws={"label": "碩士"})
ax.set_xlabel('工資(單位K/月)')
ax.set_title('最高工資分佈');

<div style = 'display:flex;justify-content:space-around;margin-top:4em;'>
<img src = 'https://user-gold-cdn.xitu.io...;h=277&f=png&s=21269' style = 'width:50%;height:50%'>
<img src = 'https://user-gold-cdn.xitu.io...;h=277&f=png&s=22709' style = 'width:50%;height:50%'>
</div>

對比以後能夠看到學歷越高,起薪的衆數越高,最高薪的衆數也越高。因此,不得不說學歷的高低與收入的高低在統計分佈上有相關性。

結論

回答最開始的問題,多讀書到底能不能多賺錢?答案從最後一個圖能夠看出來,多讀書的人賺更多錢的機率會更大。另外,有一個數據我沒寫:對學歷要求越高的崗位,對應的公司福利也更好。專科不少崗位朝九晚五算是福利了,而碩士的不少崗位對應的福利是六險一金,年度出國遊,公派進修等等。

數據遊戲

最後,我想打個小廣告:

本期新的數據遊戲是:<span style = 'color:#ee0000'>免費讀書</span>。

異步社區和我合做舉辦的一週免費讀書活動,由我親自挑選了[
精通數據科學:從線性迴歸到深度學習](https://www.epubit.com/book/d...

具體活動細節能夠關注微信公衆號 數據科學與技術(read_csv) 回覆「數據遊戲2期」查看。

相關文章
相關標籤/搜索