<jupyter_start><jupyter_text>2018年中国大学毕业生薪酬排行榜<jupyter_code>"""
2018年中国大学毕业生薪酬排行榜

https://pyecharts.github.io/pyecharts.js-app/#https://raw.githubusercontent.com/pyecharts/pyecharts-app/master/app/charts/map.py
https://nbviewer.jupyter.org/github/pyecharts/pyecharts-users-cases/blob/master/notebook-users-cases/notebook-user-cases.ipynb
"""

import pandas as pd 

# 数据概览
data = pd.read_csv('./salary.csv')
data.head(10)
print(data.info())
print(data.describe(include='all'))<jupyter_output><class 'pandas.core.frame.DataFrame'>
RangeIndex: 200 entries, 0 to 199
Data columns (total 9 columns):
rank          200 non-null int64
university    200 non-null object
category      200 non-null object
province      200 non-null object
985           200 non-null int64
211           200 non-null int64
2017          200 non-null int64
2015          200 non-null int64
2013          200 non-null int64
dtypes: int64(6), object(3)
memory usage: 14.1+ KB
None
              rank university category province         985         211  \
count   200.000000        200      200      200  200.000000  200.000000   
unique         NaN        200       10       26         NaN         NaN   
top            NaN     浙江理工大学       理工       北京         NaN         NaN   
freq           NaN          1       77       45         NaN         NaN   
mean    100.500000        NaN      NaN      NaN    0.165000    0.370000   
std      57.879185        NaN      NaN      NaN    0.372112    0.484016   
min       1.000[...]<jupyter_text>高校薪资排名<jupyter_code># 工作 1 年和 5 年的薪资排行 TOP 10 高校
data1 = data.iloc[:,[1,6]]

data2 = data.sort_values(by='2015',ascending=False).reset_index(drop=True)
data2 = data2.iloc[:,[1,8]]

data3 = pd.concat([data1,data2],axis=1)
data3.head(10)
# 工作 1 年和 5 年的薪资排行 BOT 10 高校
data3.tail(10)<jupyter_output><empty_output><jupyter_text>按区域分<jupyter_code>from pyecharts import Bar,Map,Geo
from pyecharts import Grid,configure 

configure(global_theme='dark')

"""
https://www.jianshu.com/p/e0b2851672cd
"""
# 大学毕业一年薪资分布

data4 = data.groupby(by='province').mean()
# print(data4)
print(data4.sort_values(by='2017',ascending=False)['2017'])

value = list(data4['2017'].values)
attr = list(data4.index)
# print(value,attr)

map = Map('大学毕业一年薪资分布','上北广薪资最高,内蒙河南甘肃垫底',title_color='#fff',
         title_pos='center') #,width=1200,height=600

map.add('',attr,value,
    maptype='china',
    is_random=True,effect_scale=5,
    visual_range=[3000,8000],
    visual_text_color='#fff',
    is_visualmap=True
)
map.render('毕业一年薪资区域分布.png')
map

# 大学毕业 5 年薪资分布

print(data4.sort_values(by='2013',ascending=False)['2013'])

value = list(data4['2013'].values)
attr = list(data4.index)
# print(value,attr)

map = Map('大学毕业五年薪资分布','上北广最高,河南内蒙甘肃垫底',title_color='#fff',
         title_pos='center') #,width=1200,height=600

map.add('',attr,value,
    maptype='china',
    is_random=True,effect_scale=5,
    visual_range=[5000,12000],
    visual_text_color='#fff',
    is_visualmap=True
)
map.render('毕业五年薪资区域分布.png')
map

# 大学毕业 5 年薪资分布
data5 = data.groupby(by='category').mean()
data5.sort_values(by='2017',ascending=False,inplace=True)
# data5 = data5
# print(data5.sort_values(by='2017',ascending=False)['2017'])

value = list(data5['2017'].values.round(0))
attr = list(data5.index)
print(value,attr)

bar = Bar('不同学校类型薪资对比','语言类最高，医药最低',title_color='#fff',
         title_pos='center') #,width=1200,height=600

bar.add('',attr,value,
    is_label_show=True,
#     label_pos='right',
    y_axis_interval=0,
    y_axis_roate=45,
#     is_convert=True,
)
map.render('不同学校类型薪资对比.png')
bar

# 985 211 对比

data5 = data.groupby(by=['985','211']).mean().round(0)
data5.iloc[:,1:5]

value = list(data5['2017'].values.round(0))
value2 = list(data5['2015'].values.round(0))
value3 = list(data5['2013'].values.round(0))
# attr = list(data5.index)
attr = ['双非','211','985']
print(value,attr)

bar = Bar('不同学校类型薪资对比','985高校高于211高于双非',title_color='#fff',
         title_pos='center') #,width=1200,height=600

bar.add('',attr,value,
    is_label_show=True,
    y_axis_interval=0,
    y_axis_roate=45,
    is_legend_show=True,
)


bar.add('',attr,value2,
    is_label_show=True,
    y_axis_interval=0,
    y_axis_roate=45,
    is_legend_show=True,
    legend_pos='right'
)

bar.add('',attr,value3,
    is_label_show=True,
    y_axis_interval=0,
    y_axis_roate=45,
    is_legend_show=True,
    legend_pos='right'
)
bar<jupyter_output>[5576.0, 6689.0, 7905.0] ['双非', '211', '985']
StarcoderdataJupyterStructuredCleanDedup