Employee Management Project
Employee Management Project
Employee Management Project
1 Certificate 2
2 Acknowledgment 3
3 Introduction 4
4 Hardware and software requirements 5
5 Python & Header files introduction 6
6 CSV file introduction 7
9 Source code 16
10 Output screen 21
11 Bibliography 29
CERTIFICATE
With the right EMS tool, the HR department can implement processes and help
companies achieve their business objectives. By helping managers keep track of
admin activities, the tool can help improve employee engagement and increase
productivity. These tools also help a company with vacations and absence
management and timekeeping. It can even help HR managers and organisational
leaders track performance reviews of employees.
Python
Python is interpreted, high-level, general-purpose programming
language. Created by Guido van Rossum and first released in 1991, Python's
design philosophy emphasizes code readability with its notable use
of significant whitespace. Its language constructs and object-oriented approach
aim to help programmers write clear, logical code for small and large-scale
projects.
Python is dynamically typed and garbage-collected. It supports
multiple programming paradigms, including procedural, object-oriented,
and functional programming. Python is often described as a "batteries included"
language due to its comprehensive standard library.
Python was conceived in the late 1980s as a successor to the ABC
language. Python 2.0, released in 2000, introduced features like list
comprehensions and a garbage collection system capable of
collecting reference cycles. Python 3.0, released in 2008, was a major revision
of the language that is not completely backward-compatible, and much
Python 2 code does not run unmodified on Python 3.
The Python 2 language, i.e. Python 2.7.x, was officially discontinued on
January 1, 2020 (first planned for 2015) after which security patches and other
improvements will not be released for it. With Python 2's end-of-life, only
Python 3.5.x and later are supported.
Hardware & Software Requirement
Hardware Requirement
PC/Laptop/MacBook with
Intel core/i3/i5/i7 or any equivalent
With at least 2 GB RAM
10 MB free space on Hard Disk
LCD/LED
and/or
MS- EXCEL
OR
OPEN OFFICE CALC
CSV FILE
Python is one of the important fields for data scientists and many programmers to
handle a variety of data. CSV (Comma-Separated Values) is one of the prevalent and
accessible file formats for storing and exchanging tabular data.
CSV (Comma Separated Values) is a simple file format used to store tabular data,
such as a spreadsheet or database. A CSV file stores tabular data (numbers and text)
in plain text. Each line of the file is a data record. Each record consists of one or more
fields, separated by commas. The use of the comma as a field separator is the source
of the name for this file format. For working CSV files in Python, there is an inbuilt
module called CSV.
EMPLOYEE.CSV
EMPNO NAME GENDER BASIC DA HRA CCA PF TOTAL NET
1 JOHN M 5000 2500 1500 500 600 10100 9500
print(tabulate(df,showindex=False,headers=['EMPNO','NAME','GENDER','BASIC','DA','
HRA','CCA','PF','TOTAL','NET'],tablefmt='pretty'))
elif choice == 2:
print("\nEmployees Data Name - Wise :\n\n")
df=pd.read_csv('D:\\Deepak\\2023-24\\XII IP\\Projects
IP\\aastha_employees.csv',usecols =
['NAME','GENDER','BASIC','DA','HRA','CCA','PF','TOTAL','NET'])
df = df.sort_values(by='NAME')
print(tabulate(df,showindex=False,headers=['NAME','GENDER','BASIC','DA','HRA','CC
A','PF','TOTAL','NET'],tablefmt='pretty'))
elif choice == 3:
print("\nFirst N Rows \n\n")
df=pd.read_csv('D:\\Deepak\\2023-24\\XII IP\\Projects
IP\\aastha_employees.csv')
df = df.sort_values(by='EMPNO')
nth = int(input("How many rows to display? : "))
print(tabulate(df.head(nth),showindex=False,headers=['EMPNO','NAME','GENDER','BAS
IC','DA','HRA','CCA','PF','TOTAL','NET'],tablefmt='pretty'))
elif choice == 4:
print("\nLast N Rows \n\n")
df=pd.read_csv('D:\\Deepak\\2023-24\\XII IP\\Projects
IP\\aastha_employees.csv')
df = df.sort_values(by='EMPNO')
nth = int(input("How many rows to display? : "))
print(tabulate(df.tail(nth),showindex=False,headers=['EMPNO','NAME','GENDER','BASI
C','DA','HRA','CCA','PF','TOTAL','NET'],tablefmt='pretty'))
elif choice == 5:
print("\nDisplay employee with highest Salary :\n\n")
df=pd.read_csv('D:\\Deepak\\2023-24\\XII IP\\Projects
IP\\aastha_employees.csv')
df = df.sort_values(by='NET')
print(tabulate(df.tail(1),showindex=False,headers=['EMPNO','NAME','GENDER','BASIC',
'DA','HRA','CCA','PF','TOTAL','NET'],tablefmt='pretty'))
elif choice==6:
print("\nDisplay employee with highest Salary :\n\n")
df=pd.read_csv('D:\\Deepak\\2023-24\\XII IP\\Projects
IP\\aastha_employees.csv')
df = df.sort_values(by='NET')
print(tabulate(df.head(1),showindex=False,headers=['EMPNO','NAME','GENDER','BASI
C','DA','HRA','CCA','PF','TOTAL','NET'],tablefmt='pretty'))
elif choice==7:
print('Exit to main menu............')
break
else:
print('Invalid Choice, Retry 1/2/3/4/5/6/7')
elif choice==2:
while True:
print('Data Visualization')
print('\n\t1. Plot Line Chart (Name and Basic Salary)')
print('\n\t2. Plot Bar Chart Vertical(Name and Basic Salary)')
print('\n\t3. Plot Bar Horizontal Chart (Name and Basic Salary)')
print('\n\t4. Plot Histogram (Basic Salary)')
print('\n\t5. Exit\n')
choic=int(input('Select your Choice [1-4] : '))
if choic==1:
print('Line Chart')
df=pd.read_csv('D:\\Deepak\\2023-24\\XII IP\\Projects
IP\\aastha_employees.csv')
df['NAME'] =
['JOHN','MOHAN','SOHAN','RADHA','GEETA','SIMRAN','PRIYA','SIMMI','PREM','AS
HWIN']
NAME=df["NAME"]
BASIC=df["BASIC"]
plt.ylabel("Basic Salary ----------->")
plt.xlabel("Name -------->")
plt.title("*** Name and Basic Salary ***")
plt.plot(NAME,BASIC, color='r')
plt.grid()
plt.savefig('emp_line.pdf')
plt.show()
elif choic==2:
print('Bar Chart')
df=pd.read_csv('D:\\Deepak\\2023-24\\XII IP\\Projects
IP\\aastha_employees.csv')
df['NAME'] =
['JOHN','MOHAN','SOHAN','RADHA','GEETA','SIMRAN','PRIYA','SIMMI','PREM','AS
HWIN']
NAME=df["NAME"]
BASIC=df["BASIC"]
plt.ylabel("BASIC")
plt.title("*** Name and Basic Salary ***")
plt.bar(NAME,BASIC, color='r')
plt.grid()
plt.savefig('emp_bar.pdf')
plt.show()
elif choic==3:
print('Bar Chart')
df=pd.read_csv('D:\\Deepak\\2023-24\\XII IP\\Projects
IP\\aastha_employees.csv')
df['NAME'] =
['JOHN','MOHAN','SOHAN','RADHA','GEETA','SIMRAN','PRIYA','SIMMI','PREM','AS
HWIN']
NAME=df["NAME"]
BASIC=df["BASIC"]
plt.xlabel("Basic Salary")
plt.title("Name and Basic Salary")
plt.barh(NAME,BASIC, color='r')
plt.grid()
plt.savefig('emp_barh.pdf')
plt.show()
elif choic==4:
print('Histogram')
df=pd.read_csv('D:\\Deepak\\2023-24\\XII IP\\Projects
IP\\aastha_employees.csv')
df['NAME'] = ['JOHN', 'MOHAN','SOHAN','RADHA','GEETA',
'SIMRAN','PRIYA','SIMMI','PREM','ASHWIN']
NAME=df["NAME"]
BASIC=df["BASIC"]
plt.title("Name and Basic Salary")
plt.hist(BASIC, color='r')
plt.grid()
plt.savefig('emp_hist.pdf')
plt.show()
elif choic==5:
print('Exit to main menu........')
break
else:
print('Invalid choice')
elif choice==3:
while True:
print('Data Operations')
print('\n\t1. Add a row to Dataframe')
print('\n\t2. Remove a row to Dataframe')
print('\n\t3. Add a Column to Dataframe')
print('\n\t4. Remove a Column to Dataframe')
print('\n\t5. Exit\n')
choic=int(input('Select your Choice [1-5] : '))
if choic==1:
df=pd.read_csv('D:\\Deepak\\2023-24\\XII IP\\Projects
IP\\aastha_employees.csv')
EMPNO = int(input('Employee No : '))
NAME= input('Employee Name : ')
GENDER = input('Gender [M/F/T] : ')
BASIC= int(input('Basic Salary : '))
DA=.50*BASIC
HRA=.30*BASIC
CCA=.10*BASIC
PF=.12*BASIC
TOTAL=BASIC + DA + CCA + PF
NET = TOTAL - PF
cr=df['EMPNO'].count()
df1=pd.DataFrame({"EMPNO":EMPNO,"NAME":NAME,"GENDER":GENDER,
"BASIC":BASIC,"DA":DA,"HRA":HRA, "CCA":CCA,"PF":PF,"TOTAL":TOTAL,
"NET":NET}, index=[cr])
df=df.append(df1)
print(tabulate(df,showindex=False,headers=['EMPNO','NAME','GENDER','BASIC','DA','
HRA','CCA','PF','TOTAL','NET'],tablefmt='pretty'))
print('Record added Successfully..............')
elif choic==2:
df=pd.read_csv('D:\\Deepak\\2023-24\\XII IP\\Projects
IP\\aastha_employees.csv')
print(tabulate(df,showindex=False,headers=['EMPNO','NAME','GENDER','BASIC','DA','
HRA','CCA','PF','TOTAL','NET'],tablefmt='pretty'))
r=int(input("Enter the Employee Number to be removed : "))
df= df.drop(r-1)
print(tabulate(df,showindex=False,headers=['EMPNO','NAME','GENDER','BASIC','DA','
HRA','CCA','PF','TOTAL','NET'],tablefmt='pretty'))
print('Record deleted Successfully..............')
elif choic==3:
print('Add a Column')
df=pd.read_csv('D:\\Deepak\\2023-24\\XII IP\\Projects
IP\\aastha_employees.csv')
print("Add Column DEPARTMENT : ")
df['DEPARTMENT']=['HR','SALES','FINANCE','HR','SALES','FINANCE','HR','SALES','
FINANCE','SALES']
print(tabulate(df,headers=['EMPNO','NAME','GENDER','BASIC','DA','HRA','CCA','PF','T
OTAL','NET','DEPARTMENT'],tablefmt='pretty'))
print('Column added Successfully..............')
elif choic==4:
print('Remove a Column')
df=pd.read_csv('D:\\Deepak\\2023-24\\XII IP\\Projects
IP\\aastha_employees.csv')
C=input("Enter the Column Name to remove : ")
C=C.upper()
df=df.drop(C,axis=1)
print(tabulate(df,tablefmt='pretty'))
print('Column removed Successfully..............')
elif choic==5:
print('Exit to main menu........')
break
else:
print('Invalid choice')
elif choice==4:
print('Exit from menu........')
break
else:
print('Invalid choice')
OUTPUT
SCREENS
Enter User Name : deepak
Enter Password : sharma
Welcome to EMPLOYEES MANAGEMENT SYSTEM
*** Employees Data Analysis Project ***
1. Data Analysis
2. Data Visualization
3. Data Operations
4. Exit
Select your Choice [1-4] : 1
*** EMPLOYEES MANAGEMENT SYSTEM ***
**************************************************
1. Show Employees Data
2. Show Data Name-Wise
3. Show first nth records
4. Show last nth records
5. Display employee with highest Salary
6. Display employee with lowest Salary
7. For Exit the program
Enter Your Choice [1-7] : 1
Employees Data :
*** EMPLOYEES MANAGEMENT SYSTEM ***
**************************************************
1. Show Employees Data
2. Show Data Name-Wise
3. Show first nth records
4. Show last nth records
5. Display employee with highest Salary
6. Display employee with lowest Salary
7. For Exit the program
Enter Your Choice [1-8] : 2
Employees Data Name - Wise :
*** EMPLOYEES MANAGEMENT SYSTEM ***
**************************************************
1. Show Employees Data
2. Show Data Name-Wise
3. Show first nth records
4. Show last nth records
5. Display employee with highest Salary
6. Display employee with lowest Salary
7. For Exit the program
Enter Your Choice [1-8] : 3
First N Rows
How many rows to display? : 4
+-------+-------+--------+-------+------+------+-----+-----+-------+------+
| EMPNO | NAME | GENDER | BASIC | DA | HRA | CCA | PF | TOTAL | NET |
+-------+-------+--------+-------+------+------+-----+-----+-------+------+
| 1 | JOHN | M | 5000 | 2500 | 1500 | 500 | 600 | 10100 | 9500 |
| 2 | MOHAN | M | 3000 | 1500 | 900 | 300 | 360 | 6060 | 5700 |
| 3 | SOHAN | M | 2000 | 1000 | 600 | 200 | 240 | 4040 | 3800 |
| 4 | RADHA | F | 5000 | 2500 | 1500 | 500 | 600 | 10100 | 9500 |
+-------+-------+--------+-------+------+------+-----+-----+-------+------+
*** EMPLOYEES MANAGEMENT SYSTEM ***
**************************************************
1. Show Employees Data
2. Show Data Name-Wise
3. Show first nth records
4. Show last nth records
5. Display employee with highest Salary
6. Display employee with lowest Salary
7. For Exit the program
Enter Your Choice [1-8] : 4
Last N Rows
How many rows to display? : 3
+-------+--------+--------+-------+------+------+-----+-----+-------+-------+
| EMPNO | NAME | GENDER | BASIC | DA | HRA | CCA | PF | TOTAL | NET |
+-------+--------+--------+-------+------+------+-----+-----+-------+-------+
| 8 | SIMMI | F | 8000 | 4000 | 2400 | 800 | 960 | 16160 | 15200 |
| 9 | PREM | M | 5000 | 2500 | 1500 | 500 | 600 | 10100 | 9500 |
| 10 | ASHWIN | M | 6000 | 3000 | 1800 | 600 | 720 | 12120 | 11400 |
+-------+--------+--------+-------+------+------+-----+-----+-------+-------+
*** EMPLOYEES MANAGEMENT SYSTEM ***
**************************************************
1. Show Employees Data
2. Show Data Name-Wise
3. Show first nth records
4. Show last nth records
5. Display employee with highest Salary
6. Display employee with lowest Salary
7. For Exit the program
Enter Your Choice [1-8] : 5
Display employee with highest Salary :
+-------+-------+--------+-------+------+------+-----+-----+-------+-------+
| EMPNO | NAME | GENDER | BASIC | DA | HRA | CCA | PF | TOTAL | NET |
+-------+-------+--------+-------+------+------+-----+-----+-------+-------+
| 8 | SIMMI | F | 8000 | 4000 | 2400 | 800 | 960 | 16160 | 15200 |
+-------+-------+--------+-------+------+------+-----+-----+-------+-------+
*** EMPLOYEES MANAGEMENT SYSTEM ***
**************************************************
1. Show Employees Data
2. Show Data Name-Wise
3. Show first nth records
4. Show last nth records
5. Display employee with highest Salary
6. Display employee with lowest Salary
7. For Exit the program
Enter Your Choice [1-8] : 6
Display employee with lowest Salary :
+-------+-------+--------+-------+------+-----+-----+-----+-------+------+
| EMPNO | NAME | GENDER | BASIC | DA | HRA | CCA | PF | TOTAL | NET |
+-------+-------+--------+-------+------+-----+-----+-----+-------+------+
| 3 | SOHAN | M | 2000 | 1000 | 600 | 200 | 240 | 4040 | 3800 |
+-------+-------+--------+-------+------+-----+-----+-----+-------+------+
*** EMPLOYEES MANAGEMENT SYSTEM ***
**************************************************
1. Show Employees Data
2. Show Data Name-Wise
3. Show first nth records
4. Show last nth records
5. Display employee with highest Salary
6. Display employee with lowest Salary
7. For Exit the program
Enter Your Choice [1-8] : 7
Exit to Main Menu……….
*** Employees Data Analysis Project ***
1. Data Analysis
2. Data Visualization
3. Data Operations
4. Exit
Select your Choice [1-4] : 2
Data Visualization
1. Plot Line Chart (Name and Basic Salary)
2. Plot Bar Chart Vertical (Name and Basic Salary)
3. Plot Bar Horizontal Chart (Name and Basic Salary)
4. Plot Histogram (Basic Salary)
5. Exit
Select your Choice [1-4] : 1
Line Chart
Data Visualization
1. Plot Line Chart (Name and Basic Salary)
2. Plot Bar Chart Vertical(Name and Basic Salary)
3. Plot Bar Horizontal Chart (Name and Basic Salary)
4. Plot Histogram (Basic Salary)
5. Exit
Select your Choice [1-4] : 2
Bar Chart
Data Visualization
1. Plot Line Chart (Name and Basic Salary)
2. Plot Bar Chart Vertical(Name and Basic Salary)
3. Plot Bar Horizontal Chart (Name and Basic Salary)
4. Plot Histogram (Basic Salary)
5. Exit
Select your Choice [1-4] : 3
Bar Chart
Data Visualization
1. Plot Line Chart (Name and Basic Salary)
2. Plot Bar Chart Vertical (Name and Basic Salary)
3. Plot Bar Horizontal Chart (Name and Basic Salary)
4. Plot Histogram (Basic Salary)
5. Exit
Select your Choice [1-4]: 4
Histogram
Welcome to EMPLOYEES MANAGEMENT SYSTEM
*** Employees Data Analysis Project ***
1. Data Analysis
2. Data Visualization
3. Data Operations
4. Exit
Select your Choice [1-4] : 3
Data Operations
1. Add a row to Dataframe
2. Remove a row to Dataframe
3. Add a Column to Dataframe
4. Remove a Column to Dataframe
5. Exit
Select your Choice [1-5] : 1
Employee No : 101
Employee Name : Rajesh
Gender [M/F/T] : M
Basic Salary : 60000
+---+-------+--------+--------+-------+------+------+-----+-----+-------+-------+------------+
| 0 | 1 | JOHN | M | 5000 | 2500 | 1500 | 500 | 600 | 10100 | 9500 | HR |
| 1 | 2 | MOHAN | M | 3000 | 1500 | 900 | 300 | 360 | 6060 | 5700 | SALES |
| 2 | 3 | SOHAN | M | 2000 | 1000 | 600 | 200 | 240 | 4040 | 3800 | FINANCE |
| 3 | 4 | RADHA | F | 5000 | 2500 | 1500 | 500 | 600 | 10100 | 9500 | HR |
| 4 | 5 | GEETA | F | 6000 | 3000 | 1800 | 600 | 720 | 12120 | 11400 | SALES |
| 5 | 6 | SIMRAN | F | 2500 | 1250 | 750 | 250 | 300 | 5050 | 4750 | FINANCE |
| 6 | 7 | PRIYA | F | 3500 | 1750 | 1050 | 350 | 420 | 7070 | 6650 | HR |
| 7 | 8 | SIMMI | F | 8000 | 4000 | 2400 | 800 | 960 | 16160 | 15200 | SALES |
| 8 | 9 | PREM | M | 5000 | 2500 | 1500 | 500 | 600 | 10100 | 9500 | FINANCE |
| 9 | 10 | ASHWIN | M | 6000 | 3000 | 1800 | 600 | 720 | 12120 | 11400 | SALES |
+---+-------+--------+--------+-------+------+------+-----+-----+-------+-------+------------+
Column added Successfully..............
Data Operations
1. Add a row to Dataframe
2. Remove a row to Dataframe
3. Add a Column to Dataframe
4. Remove a Column to Dataframe
5. Exit
Select your Choice [1-5] : 4
Remove a Column
Enter the Column Name to remove : GENDER
+---+----+--------+------+------+------+-----+-----+-------+-------+
| 0 | 1 | JOHN | 5000 | 2500 | 1500 | 500 | 600 | 10100 | 9500 |
| 1 | 2 | MOHAN | 3000 | 1500 | 900 | 300 | 360 | 6060 | 5700 |
| 2 | 3 | SOHAN | 2000 | 1000 | 600 | 200 | 240 | 4040 | 3800 |
| 3 | 4 | RADHA | 5000 | 2500 | 1500 | 500 | 600 | 10100 | 9500 |
| 4 | 5 | GEETA | 6000 | 3000 | 1800 | 600 | 720 | 12120 | 11400 |
| 5 | 6 | SIMRAN | 2500 | 1250 | 750 | 250 | 300 | 5050 | 4750 |
| 6 | 7 | PRIYA | 3500 | 1750 | 1050 | 350 | 420 | 7070 | 6650 |
| 7 | 8 | SIMMI | 8000 | 4000 | 2400 | 800 | 960 | 16160 | 15200 |
| 8 | 9 | PREM | 5000 | 2500 | 1500 | 500 | 600 | 10100 | 9500 |
| 9 | 10 | ASHWIN | 6000 | 3000 | 1800 | 600 | 720 | 12120 | 11400 |
+---+----+--------+------+------+------+-----+-----+-------+-------+
Column removed Successfully..............
Data Operations
1. Add a row to Dataframe
2. Remove a row to Dataframe
3. Add a Column to Dataframe
4. Remove a Column to Dataframe
5. Exit
Select your Choice [1-5] : 5
Exit to main menu........
*** Employees Data Analysis Project ***
1. Data Analysis
2. Data Visualization
3. Data Operations
4. Exit
Select your Choice [1-4] : 4
Exit from menu........
BIBLIOGRAPHY
We took the information for our project report from the following
sources:
Reference books:
1. Informatics Practices by Sumita Arora.
2. Complete reference with Python
3. Data Analysis-Python
4. NCERT Text Book
Websites:
https://www.python.org.in
https://www.google.com
https://www.cbseacademic.nic.in
https://www.Kaggle.com