数据科学家赚多少?数据全分析与可视化 ⛵

news2024/9/21 17:54:56

💡 作者:韩信子@ShowMeAI
📘 数据分析实战系列:https://www.showmeai.tech/tutorials/40
📘 AI 岗位&攻略系列:https://www.showmeai.tech/tutorials/47
📘 本文地址:https://www.showmeai.tech/article-detail/402
📢 声明:版权所有,转载请联系平台与作者并注明出处
📢 收藏ShowMeAI查看更多精彩内容

💡 引言

数据科学在互联网、医疗、电信、零售、体育、航空、艺术等各个领域仍然越来越受欢迎。在 📘Glassdoor的美国最佳职位列表中,数据科学职位排名第三,2022 年有近 10,071 个职位空缺。

除了数据独特的魅力,数据科学相关岗位的薪资也备受关注,在本篇内容中,ShowMeAI会基于数据对下述问题进行分析:

  • 数据科学中薪水最高的工作是什么?
  • 哪个国家的薪水最高,机会最多?
  • 典型的薪资范围是多少?
  • 工作水平对数据科学家有多重要?
  • 数据科学,全职vs自由职业者
  • 数据科学领域薪水最高的工作是什么?
  • 数据科学领域平均薪水最高的工作是什么?
  • 数据科学专业的最低和最高工资
  • 招聘数据科学专业人员的公司规模如何?
  • 工资是不是跟公司规模有关?
  • WFH(远程办公)和 WFO 的比例是多少?
  • 数据科学工作的薪水每年如何增长?
  • 如果有人正在寻找与数据科学相关的工作,你会建议他在网上搜索什么?
  • 如果你有几年初级员工的经验,你应该考虑跳槽到什么规模的公司?

💡 数据说明

我们本次用到的数据集是 🏆数据科学工作薪水数据集,大家可以通过 ShowMeAI 的百度网盘地址下载。

🏆 实战数据集下载(百度网盘):公众号『ShowMeAI研究中心』回复『实战』,或者点击 这里 获取本文 [37]基于pandasql和plotly的数据科学家薪资分析与可视化 『ds_salaries数据集

ShowMeAI官方GitHub:https://github.com/ShowMeAI-Hub

数据集包含 11 列,对应的名称和含义如下:

参数含义
work_year支付工资的年份
experience_level : 发薪时的经验等级
employment_type就业类型
job_title岗位名称
salary支付的总工资总额
salary_currency支付的薪水的货币
salary_in_usd支付的标准化工资(美元)
employee_residence员工的主要居住国家
remote_ratio远程完成的工作总量
company_location雇主主要办公室所在的国家/地区
company_size根据员工人数计算的公司规模

本篇分析使用到Pandas和SQL,欢迎大家阅读ShowMeAI的数据分析教程和对应的工具速查表文章,系统学习和动手实践:

📘图解数据分析:从入门到精通系列教程

📘编程语言速查表 | SQL 速查表

📘数据科学工具库速查表 | Pandas 速查表

📘数据科学工具库速查表 | Matplotlib 速查表

💡 导入工具库

我们先导入需要使用的工具库,我们使用pandas读取数据,使用 Plotly 和 matplotlib 进行可视化。并且我们在本篇中会使用 SQL 进行数据分析,我们这里使用到了 📘pandasql 工具库。

# For loading data
import pandas as pd
import numpy as np

# For SQL queries
import pandasql as ps

# For ploting graph / Visualization
import plotly.graph_objects as go
import plotly.express as px
from plotly.offline import iplot
import plotly.figure_factory as ff

import plotly.io as pio
import seaborn as sns
import matplotlib.pyplot as plt

# To show graph below the code or on same notebook
from plotly.offline import init_notebook_mode
init_notebook_mode(connected=True)

# To convert country code to country name
import country_converter as coco

import warnings
warnings.filterwarnings('ignore')

💡 加载数据集

我们下载的数据集是 CSV 格式的,所以我们可以使用 read_csv 方法来读取我们的数据集。

# Loading data
salaries = pd.read_csv('ds_salaries.csv')

要查看前五个记录,我们可以使用 salaries.head() 方法。

借助 pandasql完成同样的任务是这样的:

# Function query to execute SQL queries
def query(query):
 return ps.sqldf(query)

# Showing Top 5 rows of data
query("""
        SELECT * 
        FROM salaries 
        LIMIT 5
""")

输出:

💡 数据预处理

我们数据集中的第1列“Unnamed: 0”是没有用的,在分析之前我们把它剔除:

salaries = salaries.drop('Unnamed: 0', axis = 1)

我们查看一下数据集中缺失值情况:

salaries.isna().sum()

输出:

work_year             0
experience_level      0
employment_type       0
job_title             0
salary                0
salary_currency       0
salary_in_usd         0
employee_residence    0
remote_ratio          0
company_location      0
company_size          0
dtype: int64

我们的数据集中没有任何缺失值,因此不用做缺失值处理,employee_residencecompany_location 使用的是短国家代码。我们映射替换为国家的全名以便于理解:

# Converting countries code to country names
salaries["employee_residence"] = coco.convert(names=salaries["employee_residence"], to="name")
salaries["company_location"] = coco.convert(names=salaries["company_location"], to="name")

这个数据集中的experience_level代表不同的经验水平,使用的是如下缩写:

  • CN: Entry Level (入门级)
  • ML:Mid level (中级)
  • SE:Senior Level (高级)
  • EX:Expert Level (资深专家级)

为了更容易理解,我们也把这些缩写替换为全称。

# Replacing values in column - experience_level :
salaries['experience_level'] = query("""SELECT 
                                          REPLACE(
                                            REPLACE(
                                              REPLACE(
                                                REPLACE(
                                                  experience_level, 'MI', 'Mid level'), 
                                                                    'SE', 'Senior Level'), 
                                                                    'EN', 'Entry Level'), 
                                                                    'EX', 'Expert Level') 
                                        FROM 
                                          salaries""")

同样的方法,我们对工作形式也做全称替换

  • FT: Full Time (全职)
  • PT: Part Time (兼职)
  • CT:Contract (合同制)
  • FL:Freelance (自由职业)
# Replacing values in column - experience_level :
salaries['employment_type'] = query("""SELECT 
                                          REPLACE(
                                            REPLACE(
                                              REPLACE(
                                                REPLACE(
                                                  employment_type, 'PT', 'Part Time'), 
                                                                    'FT', 'Full Time'), 
                                                                    'FL', 'Freelance'), 
                                                                    'CT', 'Contract') 
                                        FROM 
                                          salaries""")

数据集中公司规模字段处理如下:

  • S:Small (小型)
  • M:Medium (中型)
  • L:Large (大型)
# Replacing values in column - company_size :
salaries['company_size'] = query("""SELECT 
                                       REPLACE(
                                         REPLACE(
                                           REPLACE(
                                             company_size, 'M', 'Medium'), 
                                                           'L', 'Large'), 
                                                           'S', 'Small') 
                                    FROM 
                                       salaries""")

我们对远程比率字段也做一些处理,以便更好理解

# Replacing values in column - remote_ratio :
salaries['remote_ratio'] = query("""SELECT 
                                        REPLACE(
                                          REPLACE(
                                            REPLACE(
                                              remote_ratio, '100', 'Fully Remote'), 
                                                            '50', 'Partially Remote'), 
                                                            '0', 'Non Remote Work') 
                                    FROM 
                                      salaries""")

这是预处理后的最终输出。

💡 数据分析&可视化

💦 数据科学中薪水最高的工作是什么?

top10_jobs = query("""
                    SELECT job_title,
                    Count(*) AS job_count
                    FROM salaries
                    GROUP BY job_title
                    ORDER BY job_count DESC
                    LIMIT 10
""")

我们绘制条形图以便更直观理解:

data = go.Bar(x = top10_jobs['job_title'], y = top10_jobs['job_count'],
             text = top10_jobs['job_count'], textposition = 'inside',
             textfont = dict(size = 12,
                            color = 'white'),
             marker = dict(color = px.colors.qualitative.Alphabet,
                          opacity = 0.9,
                          line_color = 'black',
                          line_width = 1))


layout = go.Layout(title = {'text': "<b>Top 10 Data Science Jobs</b>", 
                            'x':0.5, 'xanchor': 'center'},
                   xaxis = dict(title = '<b>Job Title</b>', tickmode = 'array'),
                   yaxis = dict(title = '<b>Total</b>'),
                   width = 900,
                   height = 600)


fig = go.Figure(data = data, layout = layout)
fig.update_layout(plot_bgcolor = '#f1e7d2',
                 paper_bgcolor = '#f1e7d2')
fig.show()

💦 数据科学职位的市场分布

fig = px.pie(top10_jobs, values='job_count', 
              names='job_title', 
              color_discrete_sequence = px.colors.qualitative.Alphabet)


fig.update_layout(title = {'text': "<b>Distribution of job positions</b>", 
                            'x':0.5, 'xanchor': 'center'},
                   width = 900,
                   height = 600)

fig.update_layout(plot_bgcolor = '#f1e7d2',
                 paper_bgcolor = '#f1e7d2')
fig.show()

💦 拥有最多数据科学工作的国家

top10_com_loc = query("""
                    SELECT company_location AS company,
                    Count(*) AS job_count
                    FROM salaries
                    GROUP BY company
                    ORDER BY job_count DESC
                    LIMIT 10
""")


data = go.Bar(x = top10_com_loc['company'], y = top10_com_loc['job_count'],
             textfont = dict(size = 12,
                            color = 'white'),
             marker = dict(color = px.colors.qualitative.Alphabet,
                          opacity = 0.9,
                          line_color = 'black',
                          line_width = 1))


layout = go.Layout(title = {'text': "<b>Top 10 Data Science Countries</b>", 
                            'x':0.5, 'xanchor': 'center'},
                   xaxis = dict(title = '<b>Countries</b>', tickmode = 'array'),
                   yaxis = dict(title = '<b>Total</b>'),
                   width = 900,
                   height = 600)


fig = go.Figure(data = data, layout = layout)
fig.update_layout(plot_bgcolor = '#f1e7d2',
                 paper_bgcolor = '#f1e7d2')
fig.show()

从上图中,我们可以看出美国在数据科学方面的工作机会最多。现在我们来看看世界各地的薪水。大家可以继续运行代码,查看可视化结果。

df = salaries
df["company_country"] = coco.convert(names = salaries["company_location"], to = 'name_short')

temp_df = df.groupby('company_country')['salary_in_usd'].sum().reset_index()
temp_df['salary_scale'] = np.log10(df['salary_in_usd'])


fig = px.choropleth(temp_df, locationmode = 'country names', locations = "company_country",
                   color = "salary_scale", hover_name = "company_country",
                   hover_data = temp_df[['salary_in_usd']], 
                    color_continuous_scale = 'Jet',
                   )


fig.update_layout(title={'text':'<b>Salaries across the World</b>', 
                         'xanchor': 'center','x':0.5})
fig.update_layout(plot_bgcolor = '#f1e7d2',
                 paper_bgcolor = '#f1e7d2')
fig.show()

💦 平均工资(基于货币计算)

df = salaries[['salary_currency','salary_in_usd']].groupby(['salary_currency'], as_index = False).mean().set_index('salary_currency').reset_index().sort_values('salary_in_usd', ascending = False)

#Selecting top 14
df = df.iloc[:14]
fig = px.bar(df, x = 'salary_currency',
            y = 'salary_in_usd',
            color = 'salary_currency',
            color_discrete_sequence = px.colors.qualitative.Safe,
            )

fig.update_layout(title={'text':'<b>Average salary as a function of currency</b>', 
                         'xanchor': 'center','x':0.5},
                 xaxis_title = '<b>Currency</b>',
                 yaxis_title = '<b>Mean Salary</b>')
fig.update_layout(plot_bgcolor = '#f1e7d2',
                 paper_bgcolor = '#f1e7d2')
fig.show()

人们以美元赚取的收入最多,其次是瑞士法郎和新加坡元。

df = salaries[['company_country','salary_in_usd']].groupby(['company_country'], as_index = False).mean().set_index('company_country').reset_index().sort_values('salary_in_usd', ascending = False)


#Selecting top 14
df = df.iloc[:14]
fig = px.bar(df, x = 'company_country',
            y = 'salary_in_usd',
            color = 'company_country',
            color_discrete_sequence = px.colors.qualitative.Dark2,
            )


fig.update_layout(title = {'text': "<b>Average salary as a function of company location</b>", 
                            'x':0.5, 'xanchor': 'center'},
                   xaxis = dict(title = '<b>Company Location</b>', tickmode = 'array'),
                   yaxis = dict(title = '<b>Mean Salary</b>'),
                   width = 900,
                   height = 600)


fig.update_layout(plot_bgcolor = '#f1e7d2',
                 paper_bgcolor = '#f1e7d2')
fig.show()

💦 数据科学工作经验水平分布

job_exp = query("""
            SELECT experience_level, Count(*) AS job_count
            FROM salaries
            GROUP BY experience_level
            ORDER BY job_count ASC
""")



data = go.Bar(x = job_exp['job_count'], y = job_exp['experience_level'],
              orientation = 'h', text = job_exp['job_count'],
             marker = dict(color = px.colors.qualitative.Alphabet,
                          opacity = 0.9,
                          line_color = 'white',
                          line_width = 2))


layout = go.Layout(title = {'text': "<b>Jobs on Experience Levels</b>",
                           'x':0.5, 'xanchor':'center'},
                  xaxis = dict(title='<b>Total</b>', tickmode = 'array'),
                  yaxis = dict(title='<b>Experience lvl</b>'),
                  width = 900,
                  height = 600)

fig = go.Figure(data = data, layout = layout)
fig.update_layout(plot_bgcolor = '#f1e7d2', 
                  paper_bgcolor = '#f1e7d2')
fig.show()

从上图可以看出,大多数数据科学都是 高级水平专家级很少。

💦 数据科学工作就业类型分布

job_emp = query("""
SELECT employment_type,
COUNT(*) AS job_count
FROM salaries
GROUP BY employment_type
ORDER BY job_count ASC
""")


data =  go.Bar(x = job_emp['job_count'], y = job_emp['employment_type'], 
               orientation ='h',text = job_emp['job_count'],
               textposition ='outside',
               marker = dict(color = px.colors.qualitative.Alphabet,
                             opacity = 0.9,
                             line_color = 'white',
                             line_width = 2))


layout = go.Layout(title = {'text': "<b>Jobs on Employment Type</b>",
                           'x':0.5, 'xanchor': 'center'},
                   xaxis = dict(title='<b>Total</b>', tickmode = 'array'),
                   yaxis =dict(title='<b>Emp Type lvl</b>'),
                   width = 900,
                   height = 600)


fig = go.Figure(data = data, layout = layout)
fig.update_layout(plot_bgcolor = '#f1e7d2', 
                  paper_bgcolor = '#f1e7d2')
fig.show()

从上图中,我们可以看到大多数数据科学家从事 全职工作而合同工和自由职业者 则较少

💦 数据科学工作数量趋势

job_year = query("""
    SELECT work_year, COUNT(*) AS 'job count'
    FROM salaries
    GROUP BY work_year
    ORDER BY 'job count' DESC
""")


data = go.Scatter(x = job_year['work_year'], y = job_year['job count'],
                  marker = dict(size = 20,
                                line_width = 1.5,
                                line_color = 'white',
                                color = px.colors.qualitative.Alphabet),
                  line = dict(color = '#ED7D31', width = 4), mode = 'lines+markers')


layout  = go.Layout(title = {'text' : "<b><i>Data Science jobs Growth (2020 to 2022)</i></b>",
                             'x' : 0.5, 'xanchor' : 'center'},
                    xaxis = dict(title = '<b>Year</b>'),
                    yaxis = dict(title = '<b>Jobs</b>'),
                    width = 900,
                    height = 600)


fig = go.Figure(data = data, layout = layout)
fig.update_xaxes(tickvals = ['2020','2021','2022'])
fig.update_layout(plot_bgcolor = '#f1e7d2',
                 paper_bgcolor = '#f1e7d2')
fig.show()

💦 数据科学工作薪水分布

salary_usd = query("""
                    SELECT salary_in_usd 
                    FROM salaries
""")


import matplotlib.pyplot as plt

plt.figure(figsize = (20, 8))
sns.set(rc = {'axes.facecolor' : '#f1e7d2',
             'figure.facecolor' : '#f1e7d2'})

p = sns.histplot(salary_usd["salary_in_usd"], 
                kde = True, alpha = 1, fill = True,
                edgecolor = 'black', linewidth = 1)
p.axes.lines[0].set_color("orange")
plt.title("Data Science Salary Distribution \n", fontsize = 25)
plt.xlabel("Salary", fontsize = 18)
plt.ylabel("Count", fontsize = 18)
plt.show()

💦 薪酬最高的 10 大数据科学工作

salary_hi10 = query("""
    SELECT job_title,
    MAX(salary_in_usd) AS salary
    FROM salaries
    GROUP BY salary
    ORDER BY salary DESC
    LIMIT 10
""")

data = go.Bar(x = salary_hi10['salary'],
             y = salary_hi10['job_title'],
             orientation = 'h',
             text = salary_hi10['salary'],
             textposition = 'inside',
             insidetextanchor = 'middle',
              textfont = dict(size = 13,
                             color = 'black'),
              marker = dict(color = px.colors.qualitative.Alphabet,
                           opacity = 0.9,
                           line_color = 'black',
                           line_width = 1))

layout = go.Layout(title = {'text': "<b>Top 10 Highest paid Data Science Jobs</b>",
                           'x':0.5,
                           'xanchor': 'center'},
                   xaxis = dict(title = '<b>salary</b>', tickmode = 'array'),
                   yaxis = dict(title = '<b>Job Title</b>'),
                   width = 900,
                   height = 600)
fig = go.Figure(data = data, layout
                = layout)
fig.update_layout(plot_bgcolor = '#f1e7d2',
                 paper_bgcolor = '#f1e7d2')
fig.show()

首席数据工程师 是数据科学领域的高薪工作。

💦 不同岗位平均薪资与排名

salary_av10 = query("""
    SELECT job_title,
    ROUND(AVG(salary_in_usd)) AS salary
    FROM salaries
    GROUP BY job_title
    ORDER BY salary DESC
    LIMIT 10
""")

data = go.Bar(x = salary_av10['salary'],
             y = salary_av10['job_title'],
             orientation = 'h',
             text = salary_av10['salary'],
             textposition = 'inside',
             insidetextanchor = 'middle',
              textfont = dict(size = 13,
                             color = 'white'),
              marker = dict(color = px.colors.qualitative.Alphabet,
                           opacity = 0.9,
                           line_color = 'white',
                           line_width = 2))

layout = go.Layout(title = {'text': "<b>Top 10 Average paid Data Science Jobs</b>",
                           'x':0.5,
                           'xanchor': 'center'},
                   xaxis = dict(title = '<b>salary</b>', tickmode = 'array'),
                   yaxis = dict(title = '<b>Job Title</b>'),
                   width = 900,
                   height = 600)
fig = go.Figure(data = data, layout = layout)
fig.update_layout(plot_bgcolor = '#f1e7d2',
                 paper_bgcolor = '#f1e7d2')
fig.show()

💦 数据科学薪资趋势

salary_year = query("""
    SELECT ROUND(AVG(salary_in_usd)) AS salary,
    work_year AS year
    FROM salaries
    GROUP BY year
    ORDER BY salary DESC
""")

data = go.Scatter(x = salary_year['year'],
                 y = salary_year['salary'],
                 marker = dict(size = 20,
                 line_width = 1.5,
                 line_color = 'black',
                 color = '#ED7D31'),
                 line = dict(color = 'black', width = 4), mode = 'lines+markers')

layout = go.Layout(title = {'text' : "<b>Data Science Salary Growth (2020 to 2022) </b>",
                            'x' : 0.5,
                            'xanchor' : 'center'},
                   xaxis = dict(title = '<b>Year</b>'),
                   yaxis = dict(title = '<b>Salary</b>'),
                   width = 900,
                   height = 600)


fig = go.Figure(data = data, layout = layout)
fig.update_xaxes(tickvals = ['2020','2021','2022'])
fig.update_layout(plot_bgcolor = '#f1e7d2',
                 paper_bgcolor = '#f1e7d2')
fig.show()

💦 经验水平&薪资

salary_exp = query("""
    SELECT experience_level AS 'Experience Level',
    salary_in_usd AS Salary
    FROM salaries
""")

fig = px.violin(salary_exp, x = 'Experience Level', y = 'Salary', color = 'Experience Level', box = True)

fig.update_layout(title = {'text': "<b>Salary on Experience Level</b>",
                            'xanchor': 'center','x':0.5},
                   xaxis = dict(title = '<b>Experience level</b>'),
                   yaxis = dict(title = '<b>salary</b>', 
                                ticktext = [-300000, 0, 100000, 200000, 300000, 400000, 500000, 600000, 700000]),
                   width = 900,
                   height = 600)

fig.update_layout(paper_bgcolor= '#f1e7d2', 
                  plot_bgcolor = '#f1e7d2', 
                  showlegend = False)
fig.show()

💦 不同经验水平的薪资趋势

tmp_df = salaries.groupby(['work_year', 'experience_level']).median()
tmp_df.reset_index(inplace = True)

fig = px.line(tmp_df, x='work_year', y='salary_in_usd', color='experience_level', symbol="experience_level")

fig.update_layout(title = {'text': "<b>Median Salary Trend By Experience Level</b>", 
                            'x':0.5, 'xanchor': 'center'},
                  xaxis = dict(title = '<b>Working Year</b>', tickvals = [2020, 2021, 2022], tickmode = 'array'),
                  yaxis = dict(title = '<b>Salary</b>'),
                  width = 900,
                  height = 600)

fig.update_layout(plot_bgcolor = '#f1e7d2',
                 paper_bgcolor = '#f1e7d2')
fig.show()

观察 1. 在COVID-19大流行期间(2020 年至 2021 年),专家级员工薪资非常高,但是呈现部分下降趋势。 2. 2021年以后专家级和高级职称人员工资有所上涨。

💦 年份&薪资分布

year_gp = salaries.groupby('work_year')
hist_data = [year_gp.get_group(2020)['salary_in_usd'],
             year_gp.get_group(2021)['salary_in_usd'],
            year_gp.get_group(2022)['salary_in_usd']]
group_labels = ['2020', '2021', '2022']

fig = ff.create_distplot(hist_data, group_labels, show_hist = False)


fig.update_layout(title = {'text': "<b>Salary Distribution By Working Year</b>", 
                            'x':0.5, 'xanchor': 'center'},
                  xaxis = dict(title = '<b>Salary</b>'),
                  yaxis = dict(title = '<b>Kernel Density</b>'),
                  width = 900,
                  height = 600)

fig.update_layout(plot_bgcolor = '#f1e7d2',
                 paper_bgcolor = '#f1e7d2')
fig.show()

💦 就业类型&薪资

salary_emp = query("""
    SELECT employment_type AS 'Employment Type',
    salary_in_usd AS Salary
    FROM salaries
""")

fig = px.box(salary_emp,x='Employment Type',y='Salary',
       color = 'Employment Type')


fig.update_layout(title = {'text': "<b>Salary by Employment Type</b>", 
                            'x':0.5, 'xanchor': 'center'},
                  xaxis = dict(title = '<b>Employment Type</b>'),
                  yaxis = dict(title = '<b>Salary</b>'),
                  width = 900,
                  height = 600)

fig.update_layout(plot_bgcolor = '#f1e7d2',
                 paper_bgcolor = '#f1e7d2')
fig.show()

💦 公司规模分布

comp_size = query("""
                SELECT company_size,
                COUNT(*) AS count
                FROM salaries
                GROUP BY company_size
""")


import plotly.graph_objects as go
data = go.Pie(labels = comp_size['company_size'], 
              values = comp_size['count'].values,
              hoverinfo = 'label',
              hole = 0.5,
              textfont_size = 16,
              textposition = 'auto')
fig = go.Figure(data = data)


fig.update_layout(title = {'text': "<b>Company Size</b>", 
                            'x':0.5, 'xanchor': 'center'},
                  xaxis = dict(title = '<b></b>'),
                  yaxis = dict(title = '<b></b>'),
                  width = 900,
                  height = 600)

fig.update_layout(plot_bgcolor = '#f1e7d2',
                 paper_bgcolor = '#f1e7d2')
fig.show()

💦 不同公司规模的经验水平比例

df = salaries.groupby(['company_size', 'experience_level']).size()
comp_s = np.round(df['Small'].values / df['Small'].values.sum(),2)
comp_m = np.round(df['Medium'].values / df['Medium'].values.sum(),2)
comp_l = np.round(df['Large'].values / df['Large'].values.sum(),2)

fig = go.Figure()
categories = ['Entry Level', 'Expert Level','Mid level','Senior Level']

fig.add_trace(go.Scatterpolar(
    r = comp_s,
    theta = categories,
    fill = 'toself',
    name = 'Company Size S'))

fig.add_trace(go.Scatterpolar(
    r = comp_m,
    theta = categories,
    fill = 'toself',
    name = 'Company Size M'))

fig.add_trace(go.Scatterpolar(
    r = comp_l,
    theta = categories,
    fill = 'toself',
    name = 'Company Size L'))

fig.update_layout(
    polar = dict(
    radialaxis = dict(range = [0, 0.6])),
    showlegend = True,
)


fig.update_layout(title = {'text': "<b>Proportion of Experience Level In Different Company Sizes</b>", 
                            'x':0.5, 'xanchor': 'center'},
                  xaxis = dict(title = '<b></b>'),
                  yaxis = dict(title = '<b></b>'),
                  width = 900,
                  height = 600)

fig.update_layout(plot_bgcolor = '#f1e7d2',
                 paper_bgcolor = '#f1e7d2')
fig.show()

💦 不同公司规模&工作薪资

salary_size = query("""
    SELECT company_size AS 'Company size',
    salary_in_usd AS Salary
    FROM salaries
""")

fig = px.box(salary_size, x='Company size', y = 'Salary',
             color = 'Company size')



fig.update_layout(title = {'text': "<b>Salary by Company size</b>", 
                            'x':0.5, 'xanchor': 'center'},
                  xaxis = dict(title = '<b>Company size</b>'),
                  yaxis = dict(title = '<b>Salary</b>'),
                  width = 900,
                  height = 600)

fig.update_layout(plot_bgcolor = '#f1e7d2',
                 paper_bgcolor = '#f1e7d2')
fig.show()

💦 WFH(远程办公)和 WFO 的比例

rem_type = query("""
    SELECT remote_ratio,
    COUNT(*) AS total
    FROM salaries
    GROUP BY remote_ratio
""")


data = go.Pie(labels = rem_type['remote_ratio'], values = rem_type['total'].values,
             hoverinfo = 'label',
             hole = 0.4,
             textfont_size = 18,
             textposition = 'auto')

fig = go.Figure(data = data)

fig.update_layout(title = {'text': "<b>Remote Ratio</b>", 
                            'x':0.5, 'xanchor': 'center'},
                  width = 900,
                  height = 600)

fig.update_layout(plot_bgcolor = '#f1e7d2',
                 paper_bgcolor = '#f1e7d2')
fig.show()

💦 薪水受Remote Type影响程度

salary_remote = query("""
    SELECT remote_ratio AS 'Remote type',
    salary_in_usd AS Salary
    From salaries
""")

fig = px.box(salary_remote, x = 'Remote type', y = 'Salary', color = 'Remote type')



fig.update_layout(title = {'text': "<b>Salary by Remote Type</b>", 
                            'x':0.5, 'xanchor': 'center'},
                  xaxis = dict(title = '<b>Remote type</b>'),
                  yaxis = dict(title = '<b>Salary</b>'),
                  width = 900,
                  height = 600)

fig.update_layout(plot_bgcolor = '#f1e7d2',
                 paper_bgcolor = '#f1e7d2')
fig.show()

💦 不同经验水平&远程比率

exp_remote = salaries.groupby(['experience_level', 'remote_ratio']).count()
exp_remote.reset_index(inplace = True)

fig = px.histogram(exp_remote, x = 'experience_level',
                  y = 'work_year', color = 'remote_ratio',
                  barmode = 'group',
                  text_auto = True)


fig.update_layout(title = {'text': "<b>Respondent Count In Different Experience Level Based on Remote Ratio</b>", 
                            'x':0.5, 'xanchor': 'center'},
                  xaxis = dict(title = '<b>Experience Level</b>'),
                  yaxis = dict(title = '<b>Number of Respondents</b>'),
                  width = 900,
                  height = 600)

fig.update_layout(plot_bgcolor = '#f1e7d2',
                 paper_bgcolor = '#f1e7d2')
fig.show()

💡 分析结论

  • 数据科学领域Top3多的职位是数据科学家数据工程师数据分析师

  • 数据科学工作越来越受欢迎。员工比例从2020年的11.9%增加到2022年的52.4%

  • 美国是数据科学公司最多的国家。

  • 工资分布的IQR在62.7k和150k之间。

  • 在数据科学员工中,大多数是高级水平,而专家级则更少。

  • 大多数数据科学员工都是全职工作,很少有合同工自由职业者

  • 首席数据工程师是薪酬最高的数据科学工作。

  • 数据科学的最低工资(入门级经验)为4000美元,具有专家级经验的数据科学的最高工资为60万美元。

  • 公司构成:53.7%中型公司,32.6%大型公司,13.7%小型数据科学公司。

  • 工资也受公司规模影响,规模大的公司支付更高的薪水。

  • 62.8%的数据科学是完全远程工作,20.9%是非远程工作,16.3%部分远程工作。

  • 数据科学薪水随时间和经验积累而增长

参考资料

  • 📘 Glassdoor
  • 📘 pandasql
  • 📘 数据科学工作薪水数据集(Kaggle)
  • 📘 图解数据分析:从入门到精通系列教程:https://www.showmeai.tech/tutorials/33
  • 📘 编程语言速查表 | SQL 速查表:https://www.showmeai.tech/article-detail/99
  • 📘 数据科学工具库速查表 | Pandas 速查表:https://www.showmeai.tech/article-detail/101
  • 📘 数据科学工具库速查表 | Matplotlib 速查表:https://www.showmeai.tech/article-detail/103

推荐阅读

  • 🌍 数据分析实战系列 :https://www.showmeai.tech/tutorials/40
  • 🌍 机器学习数据分析实战系列:https://www.showmeai.tech/tutorials/41
  • 🌍 深度学习数据分析实战系列:https://www.showmeai.tech/tutorials/42
  • 🌍 TensorFlow数据分析实战系列:https://www.showmeai.tech/tutorials/43
  • 🌍 PyTorch数据分析实战系列:https://www.showmeai.tech/tutorials/44
  • 🌍 NLP实战数据分析实战系列:https://www.showmeai.tech/tutorials/45
  • 🌍 CV实战数据分析实战系列:https://www.showmeai.tech/tutorials/46
  • 🌍 AI 面试题库系列:https://www.showmeai.tech/tutorials/48

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/60221.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

[附源码]计算机毕业设计JAVA一点到家小区微帮服务系统

[附源码]计算机毕业设计JAVA一点到家小区微帮服务系统 项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM…

Linux简单命令

Linux简单命令 现在写几个使用Linux时最常使用的简单命令 1.将一个文件复制到另一个文件夹内&#xff0c;比如将backboneA复制到backboneB路径下&#xff1a; cp -r /文件夹路径backboneA/* /文件夹路径backboneB/2.查看当前目录下有多少个文件及文件夹&#xff0c;需在终端输…

C++闲谈04——设计模式

C闲谈04——设计模式 单例模式 饿汉式单例模式 #include<iostream> #include<mutex>using namespace std; mutex mtx;class SingleTon{ public:static SingleTon* GetInstance() {if (instance nullptr) {lock_guard<mutex> lk(mtx); // 不是尖括号inst…

修复 爱普生 EPSON L4156 打印机 无法打印,开关 WIFI 墨水 三个灯同时闪烁的问题

L4151 L4153 L4156 L4158 L4163 L4165 L4166 L4168 L4169 喷墨一体机清零图解 清零前请取消打印任务&#xff0c;打印机用 USB 线接电脑并开启 工具下载地址 EPSON打印机清零软件1.双击[Resetter.exe]启动软件,点击[Select],选择 Port 打 印机型号&#xff0c;然后点[OK]&#…

第8章 注意力机制与外部记忆

系列文章目录 第1章 绪论 第2章 机器学习概述 第3章 线性模型 第4章 前馈神经网络 第5章 卷积神经网络 第6章 循环神经网络 第7章 网络优化与正则化 第8章 注意力机制与外部记忆 第9章 无监督学习 第10章 模型独立的学习方式 第11章 概率图模型 第12章 深度信念网络 第13章 深…

Linux UART编程 驱动蓝牙芯片

在熟悉了UART概念后&#xff0c;我们要学以致用&#xff0c;在Linux用起来来驱动起来蓝牙芯片&#xff01; 我们直接借用man来看下&#xff0c;命令如下&#xff1a; man termios 1.头文件引用 #include <termios.h> #include <unistd.h> 2.串口打开关闭 open…

Python预测2022世界杯1/8决赛胜负

目录: why to do?how to do?why to do? 简单介绍一下为什么要做这个吧? 首先呢, 最近一直在看基于tensorflow框架实现facenet等一些人脸识别的网络. 再加上昨天(2022年12月3日)是2022年世界杯1/8决赛第一个比赛日. 就在不同平台搜了一下, 看看有没有其他大牛也做了这方面的…

设计模式——策略模式

设计模式中的复用性指的是编译单位&#xff08;二进制层面&#xff09;的复用性&#xff08;编译、测试、部署后是原封不动的&#xff09; 动机&#xff08;Motivation&#xff09; 在软件构建过程中&#xff0c;某些对象使用的算法可能多种多样&#xff0c;经常改变&#xf…

Netty系列(五):源码解读ServerBootstrapAcceptor类职能,探究Netty启动流程

ServerBootstrapAcceptor是Netty服务端用来接收客户端连接的核心类&#xff0c;本文将介绍ServerBootstrapAcceptor的职能。 init方法 在上一篇文章源码解读 backlog 参数作用中我们知道&#xff0c;在Netty服务端启动时&#xff0c;会调用ServerBootstrap.bind()绑定本地端口…

玩转GDAL一文带你深入Windows下FileGDB驱动支持

前言 了解GDAL的朋友一定知道&#xff0c;GDAL3.5以下&#xff08;含&#xff09;默认配置下是只支持gdb文件的读的&#xff0c;是不支持写的。更要命的是&#xff0c;默认的OpenFileGDB在读取时&#xff0c;如果我们在矢量文件中设置了属性表字段的别名&#xff0c;默认驱动是…

Git项目演练

Git项目演练 首先&#xff0c;进入到项目路径 然后&#xff0c;初始化&#xff0c;产生.git库 创建gitignore文件 将不需要的文件放入到,gitignore 将所有的文件添加到追踪的状态 对文件进行一次提交 使用git log查看变动 使用编译器修改代码中的内容 对修改进…

基于javaweb的学籍管理系统计算机毕业论文java毕业设计选题源代码

&#x1f496;&#x1f496;更多项目资源&#xff0c;最下方联系我们✨✨✨✨✨✨ 目录 Java项目介绍 资料获取 Java项目介绍 计算机毕业设计java毕设之基于javaweb的学籍管理系统-IT实战营_哔哩哔哩_bilibili项目资料网址: http://itzygogogo.com软件下载地址:http://itzy…

【能效管理】安科瑞新能源充电桩收费运维管理云平台应用分析

概述 AcrelCloud-9000安科瑞充电桩收费运营云平台系统通过物联网技术对接入系统的汽车充电站、电动自行车充电站以及各个充电桩进行不间断地数据采集和监控&#xff0c;实时监控充电桩运行状态&#xff0c;进行充电服务、支付管理&#xff0c;交易结算&#xff0c;资源管理、电…

ADSP-21569/ADSP-21593的开发入门(上)

作者的话 ADI的SHARC系列DSP&#xff0c;目前已经出到5系列了&#xff0c;最新的一颗叫2159x&#xff0c;按照ADI的说法&#xff0c;这颗DSP的性能是21569的两倍&#xff0c;但又能和21569做P2P的替换&#xff0c;所以下面我们就以21593为例&#xff0c;写一点资料&#xff0c…

头歌计算机组成原理MIPS RAM设计

完整答案点击底部 <?xml version"1.0" encoding"UTF-8" standalone"no"?> <project source"2.15.0.2.exe" version"1.0"> This file is intended to be loaded by Logisim http://logisim.altervista.org &l…

数字化门店| 旧衣回收店系统 | 智慧门店小程序开发教程

随着人们生活质量的提升&#xff0c;无论男女&#xff0c;衣柜鞋柜里摆满了各种衣物&#xff0c;覆盖了多个场景下的衣物非常多&#xff0c;同时如今大多数人已经不再穿补丁衣服&#xff0c;旧或破就会扔掉买新的。为了节省资源及合理二次利用&#xff0c;旧衣回收行业逐渐出现…

用译码器来设计组合逻辑电路

三线到八线&#xff1a;输入端只有三个所以只能是三变量 我们先来看书上的一个例子 设计的过程第一步 将函数表达式整理成最小项和的形式 我们用来举例&#xff0c;不是最小项的形式 三变量函数可以用三变量的最小项来表示 为了看的更清楚&#xff0c;我们写成最小项的编号&…

四、Git本地仓库基本操作——查看提交历史和版本回退前进

1. 查看提交历史 查看git提交历史一般常用两个命令&#xff1a; # 查看历史提交记录 git log # 以列表形式查看指定文件的历史记录 git blame <文件名>git log 该命令会按照我们提交的时间线&#xff0c;然后列出所有的历史提交。 示例&#xff1a; git log 显示的…

[附源码]计算机毕业设计JAVA医疗预约系统

[附源码]计算机毕业设计JAVA医疗预约系统 项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis M…

【Pytorch】广播机制

【参考&#xff1a;The size of tensor a must match the size of tensor b (y) at non-singleton dimension z_点PY的博客-CSDN博客】 报错&#xff1a;The size of tensor a (x) must match the size of tensor b (y) at non-singleton dimension z 其广播机制遵循以下规则…