In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to use Python data to analyze the work efficiency and overall satisfaction of employees". The explanation in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian and study and learn "how to use Python data to analyze the work efficiency and overall satisfaction of employees" together.
project background
2018 is known as the winter year of the Internet. Companies, large and small, have embarked on the road of layoffs, and some of the more tragic ones have closed down directly. In the first half of 2019, Oracle laid off a large number of programmers around the age of 35. No one expected that the IT industry would retire so early! And inner OS: My mortgage is still unpaid...
If you were the director of human resources, who would you target? Answer the following questions first.
How many employees are there in each department?
What is the overall employee turnover rate?
What is the average employee salary?
What is the average length of service?
Who are the three longest-serving employees?
How satisfied are employees overall?
Data processing import pandas as pddata = pd.read_excel(r'c:\Users\Administrator\Desktop\League of Legends employee information sheet.xlsx',index_col = u'job number')#Access columns property, view column fields data.columns#Access index property, view row tags data.index#Access values property, view dataset data.values
#Add a bonus column to the metadata set for 20%data[u'bonus']= data[u' salary']*0.2data[u'bonus'].head()# loc method to access the dataset according to the index column idx = ['lol-1','lol-2','lol-3','lol-7'] data.loc[idx]#Add a bonus column to the metadata set, 20%data[u'bonus']= data[u' salary']*0.2data[u'bonus'].head()# loc method accessing dataset idx = ['lol-1','lol-2','lol-3','lol-7'] data.loc[idx] according to index column
At this time, we found in the above results: ice, Galen is a duplicate data bar, in the process of data analysis, we must pay attention to the impact of duplicate data, so we have to carry out de-duplication operation.
#View duplicate data bars (bool result True means duplicate) data.duplicated()#View how many duplicate data bars data.duplicated().sum() #Result: 2 #View duplicate data[data.duplicated()]#Remove duplicate data strips, inplace parameter indicates whether to delete in metadata set, True means yes data.drop_duplicates(inplace=True)#Check again whether to remove all duplicates data.duplicated().sum() #Result: 0, indicating that the data has been analyzed uniquely
1. How many employees are there in each department?
#Frequency statistics data[u'departments'].value_counts()# ascending = True for ascending display data[u' departments'].value_counts(ascending = True)
2. What is the overall employee turnover rate?
#Frequency statistics data[u'status'].value_counts()# normalize = True Get normalized count results data[u' status'].value_counts(normalize = True)#Show overall employee turnover rate = data[u'status'].value_counts(normalize = True)[u' turnover ']rate
3. What is the average employee salary?
As you can see from the results above, the average salary is 16800 yuan. Have you reached it? You are allowed to cry for a while o()o!
4. Who are the three longest-serving employees?
The # describe method is also a common method, and the results are more comprehensive. data[u'seniority'].describe()#Find the three employees who have been waiting the longest by descending sort and slice operation data[u'seniority'].sort_values(ascending = False)[:3]ID = data[u'seniority'].sort_values(ascending = False)[:3].indexdata.loc[ID]
6. How satisfied are employees overall?
data[u'satisfaction'].head()#By looking at the first five lines of satisfaction, it is not intuitive. We can use map to map. First, establish a mapping dictionary JobSatisfaction_cat = { 1:'Very satisfied', 2:'Just so-so', 3:'labor unpleasant'} data[u' satisfaction'].map(JobSatisfaction_cat)#satisfaction mapping metadata data[u'satisfaction']= data[u' satisfaction'].map(JobSatisfaction_cat)data[u'satisfaction'].head()
Next, conduct an overall employee satisfaction analysis. Through calculation, it can be concluded that 70% of employees approve of the company, but 30% of employees are still dissatisfied with the company. HR managers and department heads need to further explore the situation of these 30% employees. Have they left because they are dissatisfied? Or are there hidden dangers? Whether it is in the core position and so on are worth our further exploration.
data.head()#Frequency statistics data[u'satisfaction'].value_counts()#Get standardized counts, considering that percentages are more indicative of satisfaction, so multiply by 100 to show 100*data[u' satisfaction'].value_counts (normalize = True) Thank you for reading, the above is "how to use Python data to analyze the work efficiency and overall satisfaction of employees" content, after the study of this article, I believe that we have a deeper understanding of how to use Python data to analyze the work efficiency and overall satisfaction of employees, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.