使用 Python 进行职业愿望调查分析

2024年12月12日 | 阅读 15 分钟

职业抱负调查可以提供人们的工作目标和愿望的信息。它包含关于价值观、长期目标、理想工作条件和兴趣的问题。如果您想了解如何分析调查获得的信息,那么本教程就是为您准备的。在本教程中,您将学习如何使用 Python 分析职业抱负调查信息。

进行调查和民意测验是获取信息并了解诸如“为什么人们离开我们的网站”或“什么吸引人们对某位候选人感兴趣”等问题答案的最佳方法之一。但分析调查信息可能并不容易!

在本课中,我们将介绍如何使用 Python 分析调查信息。但别担心——即使您以前几乎没有写过代码,也可以做到!我们将循序渐进。

本研究将检查 StackOverflow 2019-2020 年度开发者调查数据,因为它是一个大型且最新的调查数据集,可供公众使用,并且已经过适当的匿名化处理。但是,这些方法几乎可以用于任何调查数据。

如果您想了解如何分析调查获得的信息,那么本教程就是为您准备的。在本教程中,您将学习如何使用 Python 分析职业抱负调查信息。

职业抱负调查分析

职业抱负调查的结果提供了有助于理解个人情况的信息:

  • 持久的目标
  • 理想的工作条件
  • 理想的职位和职责
  • 价值观和兴趣

我在 Kaggle 上找到了一个完美的数据集,它包含基于理解 Z 世代专业目标所需的所有事实的问题。

调查回复以 CSV 文件形式提供

我们需要以 .csv 文件的形式获取调查信息,以便使用代码进行分析。如果您想使用我们正在使用的相同数据集,可以从这里获取最新的 StackOverflow 程序员调查信息,它已经以 CSV 文件的形式(在一个 .zip 文件中)提供。

如果您想开始处理数据,以下是如何以 CSV 格式获取数据:

  • 如果您进行了在线调查,您的调查提供商很可能允许您直接下载 CSV 文件。您可以从 Typeform 和许多其他在线调查程序下载包含您所有调查回复的 CSV 文件,这使得事情非常容易。
  • 如果您使用 Google 表单进行调查,您的调查信息将作为 Google 表格在线提供。要以 CSV 格式下载数据,请转到 Google 表格界面,选择“文件”>“下载”,然后选择“逗号分隔值(.csv,当前工作表)”。
  • 如果您以其他方式获取了数据但以电子表格格式存储,您可以将 Excel 或任何其他电子表格程序中的电子表格保存为 CSV 文件。您应该在 Excel 中选择“文件”>“另存为”。在“保存类型”区域中选择“CSV(逗号分隔)”,然后单击“保存”。其他电子表格程序的操作方法也类似。

在继续之前,您应该通过在电子表格软件中打开 CSV 文件来检查其格式。如果电子表格的组织方式是第一个列是问题,然后每一行是响应者的回复,那么分析将是最简单的。最好先删除顶部的任何不必要的行,以便您的调查问题出现在第一行,每个受访者的回复出现在接下来的行,这样可以使分析过程更简单。

使用 Python 进行职业抱负调查分析源代码及说明

让我们通过导入数据集和所需的 Python 库来开始职业抱负调查的分析。

源代码片段

输出

  Your Current Country. Your Current Zip Code / Pin Code Your Gender  \
0                 India                            73005        Female   
1                 India                            51129       female   
2                 India                            13106      male   
3                 India                            83003        female   
4                 India                            01019      male   
  Which of the following influences your professional objectives the most? ?  \
0 individuals have improved the state of the planet.                              
1 individual who improved the state of the planet                              
2 Online social networking sites like LinkedIn                              
3 Friends and acquaintances that are not relatives                              
4 influential people with successful careers                              
  Would you unquestionably seek a tutorialgraduate degree or further education outside of India? If if you had to finance it yourself.  \
0 Yes, I'll work to earn that and do that.                                                                         
1 No, but I would do it if someone could cover the expense.
2 Yes, I will earn money to accomplish it.                                                                         
3. No, but I would if a person could cover the expense.     
4. No, but I would pay the price if someone could.                                                                         
  How probable is it that you'll be employed by one company for at least three years? ?  \
0  This will be difficult, but if it is the right thing to do, 
1  Will work for at least three years                        
2 It will be challenging, but if done correctly,                         
3  Will work for at least three years                        
  Would you join a company whose mission wasn't clearly clear and tutorialed online?  
0                                                 No                                       
1                                                 No                                       
2                                                Yes                                       
3                                                 No                                       
4                                                 No                                       
How likely is it that you would work for a company whose objectives diverge from what it does in public or even from what it produces?
0 A score won't be effective for them.                                                                      
1 will NOT be employed by them                                                                      

2 Will be employed by them in quantity                                                                    
3 Will NOT be useful to them; the number 
4 WON'T be useful to them                                                                   
   How probable is it that you would work for an organization whose goal is not to have a social impact?  \
0                                                  4                                       
1                                                  1                                       
2                                                  7                                       
3                                                  6                                       
4                                                  5                                       

  What type of work atmosphere do you prefer?  \
0 Fully remote, with no possibility of visiting offices        
1 Fully remote with the ability to roam wherever and whenever.         
2 Hybrid Workplace with fewer than 15 days.         
3 Hybrid Workplace Environment with 15 days or fewer.         
4 Completely remote with flexibility in when and where to travel.         

   Which of these employers are you interested in working for?  \
0 Employer who encourages learning and makes it possible... 
1 Employer who pushes your limitations by making it possible... 
2 Employer who pushes your limits by making it possible... 
3 Employer who pushes your limits by making it possible... 
4 Employer who encourages learning and makes it possible.
    

  Which kind of educational setting are you most likely to work in?  \
0 Programmes for expert or instructor-led learning, trial...                          
1 One Independent Learning Portal, an Expert or an Instructor.                          
2 independent learning portals, trial-and-error, and b.                          
3 Trial Programmes for Instructor or Expert Learning.                          
4 Learn by observing these 4 Independent Learning Portals.                          

  Which of the below careers looks close to your Aspirational job ?  \
1 There are no commercial activities in any organization, and there is one business operation in each organization, respectively.                   
2 Manage and lead full-cycle projects or produce.                   
3. Management of company operations in any organization.                   
4 Education at any of the institutes/online or Of.                   

  What kind of manager would you be if you didn't check your watch?  \
0 Manager who defines expectations and establishes a                      
1 Supervisor who makes sense of what is generally anticipated sets a . . .                      
2 Director who makes sense of what is generally anticipated sets a . . .                      
3 A manager who sets a standard and lays out the expectations                      
4 A manager who specifies what is expected and establishes a

  Which of the following setup you would like to work ?  
0 Work alone, Work with 2 to 3 individuals in my group. . .     
1 Work with 5 to 6 individuals in my group. . . 
2 Work with 2 to 3 individuals in my group, Work with . . .     
3 Work with 2 to 3 individuals in my group. . .
4 Work with 2 to 3 individuals in my group, Work with . . .

调查的问题列在数据集的列名中,而 Z 世代响应者的回答则列在行中。让我们检查一下调查的每个问题。

源代码片段

输出

Index(['Your Current Country.', 'Your Current Zip Code / Pin Code',
       'Your Gender',
       'Which of the following influences your professional objectives the most? ?',
       'Would you unquestionably seek a tutorialgraduate degree or further education outside of India? If if you had to finance it yourself.',
       'How probable is it that you'll be employed by one company for at least three years? ?',
       'Would you join a company whose mission wasn't clearly clear and tutorialed online?.',
       'How probable is it that you would work for an organization whose goals conflict with what it does publicly or even with what it produces? ?',
       'How probable is it that you would work for an organization whose goal is not to have a social impact?',
       'What type of work atmosphere do you prefer?.',
       'Which of these employers are you interested in working for?.',
       'Which kind of educational setting are you most likely to work in?',
       'Which of the below careers looks close to your Aspirational job ?',
       'What kind of manager would you be if you didn't check your watch?',
       'Which of the following setup you would like to work ?'],
      dtype = 'object')

现在让我们逐一检查每个调查问题。让我们先来看看参与工作抱负调查的受访者目前的国家。

源代码片段

输出

Career Aspirations Survey Analysis using Python

因此,提供调查回复的受访者中有 98.3% 是印度人。现在让我们看看影响 Z 世代职业抱负的因素。

源代码片段

输出

Career Aspirations Survey Analysis using Python

以上饼图的观察结果

  1. 父母影响 33.6% 的 Z 世代。
  2. 改变世界的人们具有 24.3% 的影响力。
  3. 虽然不是家人,但他们圈子里的 16.6% 的人对他们有影响。
  4. 高薪职业的影响者对 15.7% 的人有影响。

现在让我们看看有多少人计划用他们的钱在印度以外的地方寻求进一步的教育。

源代码片段

输出

Career Aspirations Survey Analysis using Python

以上饼图的观察结果

  1. 8% 的人认为用自己的钱支付在印度以外的地方接受高等教育
  2. 7% 的印度人不愿意去国外接受高等教育
  3. 只有 25.5% 的负担得起学费的学生可以在印度以外的地方接受高等教育。

现在让我们看看 Z 世代在同一家公司工作至少三年的可能性。

源代码片段

输出

Career Aspirations Survey Analysis using Python

以上饼图的观察结果

  1. 1% 的人觉得这很难,但前提是公司很强大。
  2. 6% 的人在至少三年内继续工作没有问题。
  3. 只有 7.23% 的受访者表示他们不会尽可能长时间地工作。

现在让我们看看一家目标不明确的公司是否可行。

源代码片段

输出

Career Aspirations Survey Analysis using Python

以上饼图的观察结果: 66.8% 拒绝;2. 33.2% 没有异议;现在让我们看看 Z 世代是否会加入目标与其实际行动相冲突的公司。

源代码片段

输出

Career Aspirations Survey Analysis using Python

以上饼图的观察结果

  1. 2% 的受访者拒绝。2. 32.8% 没有异议。
  2. 在 1 到 10 的量表上,Z 世代为目标是产生最小社会影响的组织工作的可能性有多大?

源代码片段

输出

Career Aspirations Survey Analysis using Python

以上饼图的观察结果

大多数人不喜欢为目标是产生最小社会影响的组织工作。现在让我们来看看 Z 世代理想的工作环境。

源代码片段

输出

Career Aspirations Survey Analysis using Python

以上饼图的观察结果

  1. 5% 的 Z 世代受访者希望能够自由旅行和远程工作。
  2. 24.3% 的 Z 世代希望混合工作环境,每月在办公室的时间少于 15 天。
  3. 21.3% 的 Z 世代对他们的工作日感到满意。

现在让我们看看 Z 世代希望合作的公司类型。

源代码片段

输出

Career Aspirations Survey Analysis using Python

以上饼图的观察结果

  1. 1% 的 Z 世代偏好能够鼓励学习环境、挑战自身极限并最终获得回报的工作。
  2. 9% 的人希望在重视学习氛围的公司工作。
  3. 3% 的人希望在一家促进充实工作场所的公司工作。

现在让我们看看 Z 世代可能在哪种教育环境中工作。

源代码片段

输出

Career Aspirations Survey Analysis using Python

以上饼图的观察结果

  1. 25.1% 的受访者希望通过自定进度学习门户和教师指导的课程。
  2. 1% 的人偏好公司内部的侧边项目,其中包括向讲师或专家进行试错学习。
  3. 4% 的人希望参加有讲师或专家的课程,并希望通过观察他人来学习。
  4. 2% 的人希望参加自定进度学习门户,并喜欢通过观察他人来学习。

现在让我们看看 Z 世代正在寻找什么样的管理者。

源代码片段

输出

Career Aspirations Survey Analysis using Python

使用 Python 进行 Netflix 数据分析的汇总代码

输出

Career Aspirations Survey Analysis using Python

大多数 Z 世代偏好能够沟通目标、设定目标并支持他们成就的管理者。

所以,这就是您将如何使用 Python 来分析从调查中收集到的信息。

总结

所以,这就是如何使用 Python 分析职业抱负调查。职业抱负调查收集了人们在职业方面的目标和愿望。它包含关于价值观、长期目标、理想工作条件和兴趣的问题。我希望您喜欢阅读这篇关于使用 Python 分析职业抱负调查的教程。本课程讨论了一些使用 Python 分析调查信息的基本技术。尽管内容很长,但您会发现我们实际上只使用了少量代码。如果您掌握了窍门,进行此类研究会非常快!

显然,我们才刚刚开始。对于如此庞大的数据集,还有很多事情可以做。如果您正在寻找挑战,这里有一些问题您可以尝试回答。

以上答案显示了参与调查的所有开发者最常用的语言;但是,同一项调查中的另一个问题区分了信息分析师、信息科学家等其他职业。