Employee Data Analysis System ( Ip Class 12 ) ( 2024-25 )
Employee Data Analysis System ( Ip Class 12 ) ( 2024-25 )
FEATURES OF PANDAS
Pandas, a widely adopted library within the scientific Python
ecosystem for conducting data analysis, excels in various data
processing tasks and encompasses the following notable
characteristics:
It possesses the ability to effortlessly read from and write to diverse data formats,
accommodating different data types such as integers, floats, and doubles.
Pandas excels in the selection of subsets from extensive datasets and offers
seamless integration of multiple datasets.
The library supports the reshaping of data into various forms, allowing users
to tailor datasets to their specific analytical requirements.
CSV FILE
CSV (Comma Separated Values) serves as a straightforward
file format for storing tabular data, resembling a
spreadsheet or database. This plain text format organizes
data records into lines, with each record containing one or
more fields separated by commas, giving rise to the name
"CSV."
CSV, being a text file, can be crafted and modified using any text
editor. Commonly, a CSV file is generated by exporting data from a
spreadsheet or database. CSV files adhere to a standard structure
where columns are separated by a delimiter (comma, semicolon,
space, or tab), and each new line signifies a new row.
The read_csv function from the Pandas package allows the import of
tabular data from CSV files into a Pandas DataFrame by specifying
the file name as a parameter.
MATPLOTLIB
Matplotlib, an open-source 2D plotting library, is a go-to tool
for visualizing figures in Python. Renowned for its ease of use
and versatility, Matplotlib supports static, animated, and
interactive 2D plots or figures. It grants users control over
every aspect of a figure, allowing for interactive and non-
interactive plotting and offering various output formats.
Types of Visualization:
Matplotlib offers a range of visualizations, including Line
Plots, Scatter Plots, Histograms, Box Plots, Bar Charts, and
Pie Charts.
Matplotlib Figure Components:
Figure: The outermost canvas containing one or more axes
(plots/subplots).
Bar Plot/Chart:
Representing categorical data with rectangular bars, Bar Charts
are useful for comparing numeric values across different
categories. Matplotlib's bar() function facilitates the creation of
Bar Charts with configurable characteristics like bar width and
color.
OBJECTIVE OF PROJECT
User-Friendly Interface:
Design an intuitive and user-friendly interface for ease of use. Ensure
that employees, managers, and administrators can navigate the
system effortlessly
CSV FILE
SOURCE CODE
#HERE WE HAVE THE USER DEFINED FUNCYIONS
#THAT HAVE BEEN CREATED TO AID OUT PROJECT ,
import pandas as pd
import matplotlib.pyplot as plt ch='Y'
while ch=='Y':
elif choice==2:
print(df)
elif choice==3:
print(df[df['gender']=='F']['name'])
elif choice==4:
e=int(input('enter emp no to search'))
inx=df[df.empno==e].index.values #to get index value
if len(inx)==0:
print("record not found")
else:
print(df[df.empno==e])
elif choice==5:
e=int(input('Enter emp no\t'))
n=input('Enter name\t')
d=input('Enter dept\t')
s=int(input("Enter salary\t"))
g=input("Enter gender\t")
df=df.append({'empno':e,'name':n,'dept':d,'gender':g,'salary'
:s},ignore_index=True)
print('record added')
elif choice==6:
e=int(input('enter emp no to delete'))
inx=df[df.empno==e].index.values
if len(inx)==0:
print("record not found")
else:
print(df[df.empno==e])
df=df[df['empno']!=e]
print('record deleted')
df.index=range(len(df)) #rearange index no
elif choice==7:
e==int(input('enter emp no to modify'))
inx=df[df.empno==e].index.values #to get index value
if len(inx)==0:
print('record not found')
else:
print(df[df.empno==e])
n=input('enter new name')
d=input('enter new dept')
s=int(input('enter new salary'))
g=input('enter new gender')
df.loc[inx,"name"]=n
df.loc[inx,"dept"]=d
df.loc[inx,"salary"]=s
df.loc[inx,"gender"]=g
print("record updated")
elif choice==8:
plt.ylabel('Salary')
plt.xlabel('Empno')
plt.plot(df['empno'],df['salary'])
plt.title('Salary Chart')
plt.show( )
elif choice==9:
plt.bar(df['name'],df['salary'])
plt.title('Salary Graph')
plt.xlabel('Names')
plt.ylabel('Salary')
plt.show( )
elif choice==10:
df.to_csv('emp.csv',index=False)
print('file saved')
ch=input('Do u want to continue').upper( )
OUTPUT SCREEN
CHOICE 1
CHOICE 2
CHOICE 3
CHOICE 4
CHOICE 5
CHOICE 6
CHOICE 7
CHOICE 8
CHOICE 9
CHOICE 9
BIBLOGRAPHY
https://ncert.nic.in/textbook.php?leip1=0-7
https://www.geeksforgeeks.org/bar-plot-in-matplotlib/