Question

Attrition BusinessT DailyRate Departme DistanceF Education Education Employee Employee Environm Gender HourlyRat Joblnvolv JoUsing python code answer the following :

#Q5: What is the Employee ID of highest MonthlyIncome paid employee?

#Q6: What is the average(mean) DailyRate group by Age for all Employees whose age is greater than 58. (hint: use groupby function)

#Q7: How many unique EducationField are there?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#CODE

Question 5

import pandas as pd
import numpy as np
df=pd.read_csv('WA_Fn-UseC_-HR-Employee-Attrition.csv')

df.head()

df.iloc[df['MonthlyIncome'].argmax()]['EmployeeNumber']#argmax() returns the index of maximum element

#Another way to find both gives the result Employee ID:259
df[df['MonthlyIncome']==df['MonthlyIncome'].max()]['EmployeeNumber']

Question 6

ageGreater58=df[df['Age']>58]#Get all rows with age > 58
ageGreater58.groupby('Age')['DailyRate'].mean()#Use groupby and get mean

Question 7

df['EducationField'].unique()

print("The unique education fields: ",len(df['EducationField'].unique()))

jupyter Untitled Last Checkpoint: 03/20/2019 (autosaved) Logout View Help Trusted Python 3 O File a Edit 7 Insert + 3.78 2.49

jupyter Untitled Last Checkpoint. 03/20/2019 (autosaved) Logout File Trusted Python 3 argmax is deprecated, use idxmax ins

Add a comment
Know the answer?
Add Answer to:
Using python code answer the following : #Q5: What is the Employee ID of highest MonthlyIncome...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • II. Using the spreadsheet provided, please answer each question. You must show work for the problems...

    II. Using the spreadsheet provided, please answer each question. You must show work for the problems where this is indicated. Round all answers to the nearest hundredth where necessary. 5. Name two categories that have qualitative data. 6. Name two categories that have quantitative data that is discrete, 7. Name two categories that have quantitative data that is continuous. 8. Build a frequency chart for the category “Major". 9. Build a relative frequency chart for the category “Number of Siblings"....

  • Solve the following questions

    Pelican stores, a division of national clothing, is a chain of women's apparel stores, operating throughout the country. The chain recently ran a promotion in which discount coupons were sent to customers of other national clothing stores. Data collected for a sample of in-store credit card transactions at pelican stores during one day while the promotion was running. the proprietary card method of payment refers to charges made on a national clothing charge card. customers who have made a purchase...

  • Homework Case 1 Statistics - Please explain and show how to create graphs and charts. Pelican Stores a division of National Clothing, is a chain of women's apparel store operating throughout the c...

    Homework Case 1 Statistics - Please explain and show how to create graphs and charts. Pelican Stores a division of National Clothing, is a chain of women's apparel store operating throughout the country.The chain recently ran a promotion in which discount coupons were sent to customers of othe National Clothing stores. Data collected for a sample of 100 in-store credit card transactions at Pelican Stores during one day while the promotion was running are contained in the file name Pelican...

  • ________________ ________________ ______________ 11. Using Excel - Scatter diagrams, estimated regression equations, and trendlines Suppose a...

    ________________ ________________ ______________ 11. Using Excel - Scatter diagrams, estimated regression equations, and trendlines Suppose a company records data on sales calls, induding the length of each call and whether a sale was made. The manager is interested in determining whether there is a relationship between the average time spent per call and the number of sales made by each employee, so she obtains the average call length and the total number of sales over a 2-week period for a...

  • As an HR representative at Delta Corporation, create a strategy for recruiting a competent and diverse...

    As an HR representative at Delta Corporation, create a strategy for recruiting a competent and diverse workforce for your company. Scenario: Delta Corporation - Delta started in 1998 and is a small family-owned firm in the microcomputer business. The company grew rapidly because of its disk, optical, backup drive, and innovative approaches to computer hardware problems. Managers and workers have all put in long hours, often sacrificing their personal time to get the company off the ground as many are...

  • After creating the table and inserting the information below, please Write SQL commands that find the...

    After creating the table and inserting the information below, please Write SQL commands that find the following: a. Count the total number of records in the table.b. How many unique JOBROLE are there in the dataset. Order them by alphabetical order from A to Z. c. Find EMPLOYEENUMBER, EDUCATIONFIELD, JOBROLE for all the employees whose AGE is greater than 50 and ATTRITION is YES CREATE TABLE EMPLOYEEATTRITION ( AGE INT, ATTRITION VARCAHR2(20), BUSINESSTRAVEL VARCAHR2(20), DAILYRATE INT, DEPARTMENT VARCAHR2(20), DISTANCEFROMHOME VARCAHR2(20),...

  • After creating the table below and inserting the values please write sql commands d. Count the...

    After creating the table below and inserting the values please write sql commands d. Count the different MARITALSTATUS when ATTRITION is YES in the dataset. Arrange the count in descending order (Hint: Use GROUP BY statement) e. For each JOBROLE when the ATTRITION is No, find the average MONTHLYINCOME for only those employees having DAILYRATE greater than or equal to 110 (Hint: Use GROUP BY and HAVING statements together) CREATE TABLE EMPLOYEEATTRITION ( AGE INT, ATTRITION VARCAHR2(20), BUSINESSTRAVEL VARCAHR2(20), DAILYRATE...

  • Question 1 BWS Corporation pays the premiums on an $80,000 group-term life insurance policy on the...

    Question 1 BWS Corporation pays the premiums on an $80,000 group-term life insurance policy on the life of its 45-year-old vice-president, Warren. The annual cost per $1,000 of coverage for a person aged 45 to 49 is $1.80. If Warren has paid $25 toward the cost of the insurance, what is the cost of hte policy includible in Warren's gross income? 1) $278.00 2) $144.00 3) $54.00 4) $29.00 5) $0 Question 2 During 2019, Edward East had wages of...

  • Nursing care plan for the following case studies using the rubric 1. Joan Smith, 55 years...

    Nursing care plan for the following case studies using the rubric 1. Joan Smith, 55 years of age, is a female patient who presents to the intensive care unit with the diagnosis of intracranial hemorrhage. The patient stopped taking her antihypertensives suddenly because of the cost of the medications and she recently lost her job to outsourcing. The patient is slightly drowsy and complains of a headache and blurred vision. The patient’s blood pressure is 220/130 mm Hg upon presentation....

  • Rule of Nines Math Activity Answer the following math problems using the "Rule of Nines" found...

    Rule of Nines Math Activity Answer the following math problems using the "Rule of Nines" found on page 11- 13 of the text. Show all work What percentage of the body is burned if a 16 year old male burned his back, the back of his left leg, and his entire right arm? 1. Ianiga 2. Suzie, an active 6 year old, was burned while playing around a fireplace. (econ Her Nightgown caught on fire and she burned both legs,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT