0% found this document useful (0 votes)
66 views

Informatics Practices: Data Handling Experiment

The document contains a Python program that takes employee name and salary as input for multiple employees and stores it in a dictionary. It then converts the dictionary into a Pandas series and provides a menu driven interface to calculate total salary, minimum and maximum salary, mean salary and number of employees.

Uploaded by

heizaibrahim
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views

Informatics Practices: Data Handling Experiment

The document contains a Python program that takes employee name and salary as input for multiple employees and stores it in a dictionary. It then converts the dictionary into a Pandas series and provides a menu driven interface to calculate total salary, minimum and maximum salary, mean salary and number of employees.

Uploaded by

heizaibrahim
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

EMP={}

n=int(input("Enter number of employees"))

for x in range (n):

name=input("Enter employee name")

salary=float(input("Enter Salary:"))

EMP[name]=salary

import pandas as pd

org=pd.Series(EMP)

print("The series is")

print(org)

while True:

print("\n 1.Total Salary")

print("2.Maximum and Minimum Salary")

print("3.Mean Salary")

print("4.Count Salary")

print("5.Exit")

ch=int(input("Enter your choice"))

if ch==1:

print("The total salary is")

print(org.sum())

elif ch==2:

print("The minimum salary is")

print(org.min())

print("The maximum salary is")

print(org.max())
elif ch==3:

print("The average salary is")

print(org[org>org.mean()])

elif ch==4:

print("Number of employees")

print(org.count())

elif ch==5:

break

else:

print("Invalid choice, Please reenter your choice")

Enter number of employees 5

Enter employee name Janina

Enter Salary: 50000

Enter employee name Fiona

Enter Salary: 90000

Enter employee name Jose

Enter Salary: 40000

Enter employee name Jaden


Enter Salary:30000

Enter employee name Fara

Enter Salary: 70000

The series is

Janina 50000.0

Fiona 90000.0

Jose 40000.0

Jaden 30000.0

Fara 70000.0

dtype: float64

1.Total Salary

2.Maximum and Minimum Salary

3.Mean Salary

4.Count Salary

5.Exit

Enter your choice 1

The total salary is

280000.0

1.Total Salary
2.Maximum and Minimum Salary

3.Mean Salary

4.Count Salary

5.Exit

Enter your choice 2

The minimum salary is

30000.0

The maximum salary is

90000.0

1.Total Salary

2.Maximum and Minimum Salary

3.Mean Salary

4.Count Salary

5.Exit

Enter your choice 3

The average salary is

Fiona 90000.0

Fara 70000.0

dtype: float64

1.Total Salary

2.Maximum and Minimum Salary


3.Mean Salary

4.Count Salary

5.Exit

Enter your choice 4

Number of employees

1.Total Salary

2.Maximum and Minimum Salary

3.Mean Salary

4.Count Salary

5.Exit

Enter your choice 5

You might also like