Professional Documents
Culture Documents
EmployeeMgmt XII IP ProjectReprot 2022 23
EmployeeMgmt XII IP ProjectReprot 2022 23
PALLAVUR
PROJECT REPORT ON
EMPLOYEMENT MANAGEMENT SYSTEM
AS PART OF INFORMATICS PRACTICES [065]
CLASS XII
This is to certify that the Informatics Practices Project work title “EMPLOYEE
MANAGEMENT SYSTEM” is a bonafide work done by Sreya. K of class XII
of Chinmaya Vidyalaya Pallavur under the guidance and supervision of Mrs
K.Usha Baburaj during the academic year 2022-23.
Signature of Signature of
INTERNAL EXAMINER EXTERNAL EXAMINER
Signature of Principal
ACKNOWLEDGEMENT
3. Implementation
4. Output screenshots
5. Limitations
CSV:
A CSV file (Comma Separated Values file) is a type of plain text file that uses
specific structuring to arrange tabular data. Because it's a plain text file, it can
contain only actual text data—in other words, printable ASCII or Unicode
characters. The structure of a CSV file is given away by its name
MATPLOTLIB
Matplotlib is a comprehensive library for creating static, animated, and
interactive visualizations in Python. Matplotlib makes easy things easy and hard
things possible.
Create publication quality plots.
Make interactive figures that can zoom, pan, update.
SOURCE CODE:
import pandas as pd
import matplotlib.pyplot as plt
def main_menu():
print("\n------- Employee Management System -------\n")
print("1. Create/Import New Dataframe")
print("2. Employee Data Analysis")
print("3. Import Data Visualisation")
print("4. Export Dataframe to csv file")
def create_dataframe_menu():
print("\n------- Create Dataframe -------\n")
print("1. Create Dataframe")
print("2. Import Dataframe from csv file")
print("3. Add/Modify Custom Index")
print("4. Add/Modify Custom Column Head")
print("5. Return to main menu")
def analysis_menu():
print("\n------- Data Analysis using Python -------\n")
print("1. Display All records")
print("2. Print All records in order of Name")
print("3. Display employees with maximum Salary")
print("4. Display employees with minimum Salary")
print("5. Display employees who have less basic salary")
print("6. Print distinct designation")
print("7. Add a row to Dataframe")
print("8. Delete a row from Dataframe")
print("9. Return to main menu")
def visualisation_menu():
print("\n------- Visualisation using Matplotlib -------\n")
print("1. Plot line graph (Employees wise Salary)")
print("2. Plot Bar graph (Employees, Salary)")
print("3. Return to main menu")
cols =
['Empcode','name','dob','Designation','Basicsalary','allowances','deductions','NetSalary']
df = pd.DataFrame([],columns = cols)
while True:
main_menu()
ch = int(input("Select Option: "))
if ch == 1:
create_dataframe_menu()
ch = int(input("Select Option: "))
if ch == 1:
data = []
while True:
ch = input("Add Row [y/n]")
if ch.lower() == 'y':
ecode = int(input("Employee Code: "))
name = input("Employee Name: ")
dob = input("DOB in dd-mm-yyyy format: ")
desg=input("Designation:")
basicsal = int(input("Basic salary: "))
allow = float(input("Allowances: "))
deduction = float(input("Deductions: "))
netsal = (basicsal+allow)-deduction
data.append([ecode, name, dob,desg, basicsal,allow,deduction,netsal])
else:
break
df = pd.DataFrame(data, columns = cols)
elif ch == 2:
file = input("File name: ")
df = pd.read_csv(file)
elif ch == 3:
index_list = input("Index List: ").split(",")
df.index = index_list
elif ch == 4:
column_list= input("Column List: ").split(",")
df.columns = column_list
print(df)
elif ch == 2:
while True:
analysis_menu()
ch = int(input("Select Option: "))
if ch == 1:
print(df)
elif ch == 2:
print(df.sort_values(by='name'))
elif ch == 3:
print(df[df['Basicsalary'] == df['Basicsalary'].max()])
elif ch == 4:
print(df[df.Basicsalary == df["Basicsalary"].min()])
elif ch == 5:
print(df[df['Basicsalary']<= 1000])
elif ch == 6:
print(df['designation'].unique())
elif ch == 7:
while True:
ch = input("Add Row [y/n]")
if ch.lower() == 'y':
ecode = int(input("Employee Code: "))
name = input("Employee Name: ")
dob = input("DOB in dd-mm-yyyy format: ")
desg=input("Designation:")
basicsal = int(input("Basic salary: "))
allow = float(input("Allowances: "))
deduction = float(input("Deductions: "))
netsal = (basicsal+allow)-deduction
df = df.append({"Empcode": ecode, "name":name,
"dob": dob, "Designation": desig, "Basicsalary": basicsal,
"sllowances": allow, "deductions": deduction,
"NetSalary": netsal}, ignore_index=True)
else:
break
elif ch == 8:
print("1. Delete Row by Index")
print("2. Delete Row by Empcode.")
ch = int(input("Select Option: "))
if ch == 1:
idx = int(input("Index to delete: "))
df = df.drop(index = idx)
elif ch == 2:
admn = int(input("Empno to delete: "))
df = df.drop(df[df["admn"] == admn].index)
else:
print("Wrong Option Selected! ")
elif ch == 9:
print("Returning to main menu")
break
else:
print("Returning to main menu")
break
elif ch == 3:
while True:
visualisation_menu()
ch = int(input("Select Option: "))
if ch == 1:
plt.plot(df['name'], df['Basicsalary'], label='Basic Salary', color = "blue",
marker="*")
plt.plot(df['name'], df['allowances'], label='Allowance', color = "green",
marker="*")
plt.plot(df['name'], df['deductions'], label='Deduction', color = "purple",
marker="*")
plt.xlabel("Employee", fontsize=12)
plt.ylabel("Net Salary", fontsize=12)
plt.title("Desigation Wise Salary of Employee", fontsize=16)
plt.legend()
plt.show()
elif ch == 2:
x_values = df["name"]
y_values = df['Netsalary']
plt.bar(x_values, y_values, color = 'orange')
plt.xlabel("Employee", fontsize=12)
plt.ylabel("NetSalary", fontsize=12)
plt.title("Employee - Pay Slip Visualisation", fontsize=14)
plt.show()
elif ch == 4:
x_values = df["name"]
y_values = df["Designation"]
plt.barh(x_values, y_values, color = 'magenta')
plt.xlabel("Employees", fontsize=12)
plt.ylabel("Designation", fontsize=12)
plt.title("Employees - Designation Visualisation", fontsize=16)
plt.show()
elif ch == 3:
print("Returning to main menu")
break
else:
print("Wrong Option Selected! ")
elif ch == 4:
print("Bye ...")
exit()
else:
1. Create dataframe
2. Data Analysis
a) Display all records
3. Data Visualisation
a) Plot line graph (employees wise salary)