These questions are based on Human Resources (HR) database given in site https://www.w3resource.com/python-exercises/pandas/index.php. This site includes Pandas exercises, practice facilities and solutions of some exercises. You can look at these exercises before solving the following questions. CSV files in HR database can be found in assignment's attachments (HRDatabase.rar). First, generate a data frame for each of tables in HR Database as follows: import pandas as pd pd.set_option('display.maxTOWS', 500) ") pd.set_option ('display.max_columna', 500) employees = pd. read cav ("EMPLOYEES. departments = pd. read. cav (DEPARTME job history ed.read. cax (FJOB HISTORY cav") jobs = d.gad cav (F"JOBS cav") countries = pd.read. cav ("COUNTRIES.cav") regions = = pd. read cav ("REGIONS.csv" locations = pd. read cav ("LOCATIONS.cav") I a. Write a Pandas program to display all the records of DEPARTMENTS file. b. Find the minimum, maximum and mean salaries of employees in each department (use empt dept). salary min max mean department_name 10150.000000 Accounting Administration Executive Finance Human Resources 8300 12000 4400 4400 17000 24000 6900 12000 6500 6500 4400.000000 19333.333333 8600.000000 6500 000000 (5000, c. Find mean salaries of employees grouped by country_id, city, # in ranges (0, 5000] 10000] (10000, 15000] (15000, 25000]. (First, merge/join locations and empt_dept.) salary salary (0, 5000] (5000, 10000] (10000, 15000] (15000, 25000] country_id city

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Please solve all given question please ( in paython )

These questions are based on Human Resources (HR) database given in site
https://www.w3resource.com/python-exercises/pandas/index.php. This site includes Pandas exercises,
practice facilities and solutions of some exercises. You can look at these exercises before solving the
following questions. CSV files in HR database can be found in assignment's attachments
(HRDatabase.rar). First, generate a data frame for each of tables in HR Database as follows:
import pandas as pd
pd.set_option('display.max xows', 500)
pd.set option ('display. max columns', 500)
employees = pd. read csv (F"EMPLOYEES.csv"
departments = pd. read cav (F"DEPARTMENTS.csv")
job history = pd. read cav (FJOB HISTORY.Cav")
jobs = pd. read. cav (FJOBS cav") countries =
pd. read cav ("COUNTRIES.csv") regions
=
pd. read csv (r"REGIONS.csv")
locations = pd. read cav ("LOCATIONS-csv"
I
a.
Write a Pandas program to display all the records of DEPARTMENTS file.
b. Find the minimum, maximum and mean salaries of employees in each department (use
empt dept).
salary
min
max
mean
department_name
Accounting
Administration
Executive
Finance
Human Resources
8300 12000
4400 4400
17000 24000
6900 12000
6500
10150.000000
4400.000000
19333.333333
8600.000000
6500.000000
6500
(5000,
C. Find mean salaries of employees grouped by country_id, city, # in ranges (0, 5000]
10000] (10000, 15000] (15000, 25000]. (First, merge/join locations and empt dept.)
salary
salary
(0, 5000] (5000, 10000] (10000, 15000] (15000, 25000]
country_id
city
Transcribed Image Text:These questions are based on Human Resources (HR) database given in site https://www.w3resource.com/python-exercises/pandas/index.php. This site includes Pandas exercises, practice facilities and solutions of some exercises. You can look at these exercises before solving the following questions. CSV files in HR database can be found in assignment's attachments (HRDatabase.rar). First, generate a data frame for each of tables in HR Database as follows: import pandas as pd pd.set_option('display.max xows', 500) pd.set option ('display. max columns', 500) employees = pd. read csv (F"EMPLOYEES.csv" departments = pd. read cav (F"DEPARTMENTS.csv") job history = pd. read cav (FJOB HISTORY.Cav") jobs = pd. read. cav (FJOBS cav") countries = pd. read cav ("COUNTRIES.csv") regions = pd. read csv (r"REGIONS.csv") locations = pd. read cav ("LOCATIONS-csv" I a. Write a Pandas program to display all the records of DEPARTMENTS file. b. Find the minimum, maximum and mean salaries of employees in each department (use empt dept). salary min max mean department_name Accounting Administration Executive Finance Human Resources 8300 12000 4400 4400 17000 24000 6900 12000 6500 10150.000000 4400.000000 19333.333333 8600.000000 6500.000000 6500 (5000, C. Find mean salaries of employees grouped by country_id, city, # in ranges (0, 5000] 10000] (10000, 15000] (15000, 25000]. (First, merge/join locations and empt dept.) salary salary (0, 5000] (5000, 10000] (10000, 15000] (15000, 25000] country_id city
salary
(0, 5000] (5000, 10000] (10000, 15000] (15000, 25000]
country_id
city
CA
Toronto
0 6000.000000 13000.000000
0.000000
DE
Munich
0 10000.000000
0.000000
0.000000
London
0 6500.000000
0.000000
0.000000
UK
Oxford
0 8096.153846 11750.000000
0.000000
Seattle
3050 7983.333333 11666.666667 19333.333333
US South San Francisco
3000 7280.000000
0.000000
0.000000
Southlake
4600 7500.000000
0.000000
0.000000
d. Display the number of records in each of data frames (records or file).
e. Display employees who has salary > 10000.
f. In employees data frame, the column commission pct has some none values (NaN). Fill these
none values with 0.
g. Display the first name, last name, salary, and department number for those employees # who
work in departments with ids 30, 50 or 80.
h. Merge/Join data frames employees and departments using their common column
department id. Store the result in a new data frame called emp_dept.
Transcribed Image Text:salary (0, 5000] (5000, 10000] (10000, 15000] (15000, 25000] country_id city CA Toronto 0 6000.000000 13000.000000 0.000000 DE Munich 0 10000.000000 0.000000 0.000000 London 0 6500.000000 0.000000 0.000000 UK Oxford 0 8096.153846 11750.000000 0.000000 Seattle 3050 7983.333333 11666.666667 19333.333333 US South San Francisco 3000 7280.000000 0.000000 0.000000 Southlake 4600 7500.000000 0.000000 0.000000 d. Display the number of records in each of data frames (records or file). e. Display employees who has salary > 10000. f. In employees data frame, the column commission pct has some none values (NaN). Fill these none values with 0. g. Display the first name, last name, salary, and department number for those employees # who work in departments with ids 30, 50 or 80. h. Merge/Join data frames employees and departments using their common column department id. Store the result in a new data frame called emp_dept.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY