0% found this document useful (0 votes)
0 views57 pages

Chesta-draksha Project File

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 57

Index

1. Introduction to Python and Pandas


2. Introduction to CSV files
3. Project Description
4. CSV Files
5. Source Code
6. Outputs
7. Bibliography

Introduction to Python and Pandas


Python
Python was developed by Guido van Rossumin the late
eighties and early nineties at the National Research Institute
for Mathematics and Computer Science in the Netherlands.

Python is derived from many other languages, including


ABC, Modula-3, C, C++, Algol-68, SmallTalk, and Unix
shell and other scripting languages.

Many of the large organizations that make use of Python


include Google, Yahoo, NASA, NetApp, Cisco, Intel,
McAfee, Dropbox, VISA, Disney, YouTube, etc.

Python Features (Pluses):

1. Easy-to-use: Very simple syntax rules. Very


programmer friendly.

2. Expressive language: Fewer lines of code.

3. Interpreted language: Python uses the interpreter,


which means python converts the program line by line
to machine language and executes it.
4. Its completeness: It includes readymade libraries for
different functions such as emails, web-pages,
databases, GUI development and many more.

5. Portable/ Platform independent

6. Free & Open Source

7. Variety of Usage/ Applications: It isa powerful,


complete and useful language used for:
o Scripting

o Rapid

prototyping o

Web

Applications o

GUI programs o

Game

development

o Database

Applications o
System

administratin

8. Automatic garbage collection: Automatic memory


management system frees the programmer from
bothering about memory management like allocating
and de-allocating memory space.

9. Easy integration: It can be easily integrated with other


programming languages like C, C++, Java, etc.

Python – Some Minuses

1. Not the fastest language

2. Lesser Libraries than C, Java, Perl

3. Not Strong on Type-binding:The Python interpreter is


not very strong about the ‘type-mismatch’ issues. For
example, if we declare a variable as integer but later
store a string value in it, it won’t show an error.

4. Not easily convertible: Because of its lack of syntax,


Python is an easy language to program in. But
converting it to some other language becomes difficult
as most other languages have a structured defined
syntax

Pandas
• Pandas is a software library written for Python

programming language, used for data analysis.


• It is a fast, powerful, flexible and easy to use open
source data analysis and manipulation tool.
• The main author of Pandas is Wes McKinney.

Key features of Pandas


• It can read or write in many different data formats.

• It can calculate in all the possible ways data is


organized i.e. across rows and down columns.
• It can easily select subsets of data from bulky subsets,
combine multiple datasets and also find and fill
missing data.
• It allows to apply operations to independent groups
within the data.
• It supports reshaping of data into different forms.
• It supports advanced time-series functionality.
• It supports visualization by integrating matplotlib and
seaborn libraries.
Introduction to CSV

The acronym CSV is short for Comma Separated Values.


It refers to a tabular data that has been saved as plain text
where data is separated by commas.
Each row of the table is stored in one row.
The field values of a row are stored together with commas
after every field value, except the last value which has end
of line after it.

Advantages of CSV Format


• A simple, compact and ubiquitous format for data
storage.
• A common format for data interchange.
• It can be opened in popular spreadsheet packages like
MS Excel, Calc, etc.
• Nearly all spreadsheets and databases support import/
export to csv format

INTRODUCTION

College Management System deals with the record keeping


system about the students, teachers and the record of their
fees and marks. It makes it easier to manage the records
and keep a track of students and their marks. The user can
also search about the details of a particular student.
This project is made to store details of various students. It
has options to store the data, make changes and remove
data whenever required, and to search/ view the details.
This project has4 csv files.

Thefront end has been developed by using Python and


Pandas.The back end is maintained by using CSV Files.

CSV Files :
Students
Faculty

Result

Fees
Source Code
import numpy as np
import pandas as pd
import
matplotlib.pyplot as
pl

ch=1 while ch!=-1: print()


print('='*60) print('St.
Anselms Commerce
College') print('='*60)
print(' 1. Student') print(' 2.
Faculty') print(' 3. Result')
print(' 4. Fees') print('-1.
Exit') print('='*60)
ch=int(input("Enter your
choice ")) if ch==1:

DF=pd.read_csv("student.csv",index
_col="stid") opt=1 while
opt!=-1:
print()
print('='*60)
print(" STUDENT DETAILS ")
print('='*60) print(" 1.
Add new student
detail") print(" 2.
Remove a student
detail") print(" 3.
Change Semester ")
print(" 4. Display
student detail") print("
5. Search by stid")
print(" 6. Search by
semester") print(" 7.
Sort the data by year -
Ascending") print(" 8.
Sort the data by year -
Descending") print(" 9.
Semesterwise count of
students") print("10. Pie
chart - Students in each
semester") print("-1.
Exit") print()
opt=int(input("enter
your choice")) if
opt==1:
p=int(input("enter
stid")) n=input("enter
student name")
y=int(input("enter year"))
s=input("enter semester")
d=input("enter dob")
f=input("enter Father's Name ")
m=input("enter Mother's Name
") a=input("enter
Address ")
DF.loc[p]=[n,y,s,d,f,m
,a]
DF.to_csv("student.cs
v") print(DF)
print("new student
detail added") elif
opt==2:
s=int(input("enter stid"))
DF.drop(s,inplace=True
)
DF.to_csv("student.csv"
) print(DF)
print("Student detail
removed") elif opt==3:
s=int(input("enter stid"))
print("Current semester
is",DF.loc[s,"semester"])
DF.loc[s,"Semester"]=input("Enter
new semester")
DF.to_csv("student.csv")
print("student semester changed")
elif opt==4: print(DF) elif opt==5:
s=int(input("enter
srno")) print(DF.loc[s]) elif
opt==6:
h=int(input("enter a
semester"))
print(DF[[‘sname’ , ‘year’, ‘semester’, ‘dob’]]
[DF.semester==h]) elif opt==7:
print(DF.sort_values('
year')) elif opt==8:
print(DF.sort_values('year',
ascending=False)) elif opt==9:

DF1=DF.groupby('semeste
r')
print(DF1.semester.count()
) elif opt==-1:

break
else:
print("choose the correct
option") elifch==2:
DF=pd.read_csv("faculty.csv",index_col='

Fcode') opt=1

while opt!=-1:
print()

print('='*60)

print(" FACULTY DETAILS ")


print('='*60)
print("1. Add new faculty detail")

print("2. Remove a faculty detail")

print("3. Change faculty

experience") print("4. Change

faculty salary") print("5. Display all

faculty detail") print("6. Sort the

data by experience - Ascending")

print("7. Sort the data by

experience - Descending") print("8.

Sort the data by salary -

Ascending") print("9. Sort the data


by salary - Descending") print("10.

Search by subject ") print("11. Bar

Chart - Salary of Faculty") print("-

1. exit") print()

opt=int(input("enter

your choice")) if

opt==1:

e=int(input("Enter fcode

")) en=input("Enter

Faculty Name ")

a=input("Enter Address ")

exp=input("enter experience ")

sub=input("enter subject ")

sal=input("enter salary ")

DF.loc[e]=[en,a,exp,sub

,sal]

DF.to_csv("faculty.csv"

) print(DF)
print("New faculty detail

added") elif opt==2:

e=int(input("enter ecode"))
DF.drop(e,inplace=True

DF.to_csv("faculty.csv"

) print(DF)

print("New faculty detail

removed") elif opt==3:

e=int(input("enter ecode"))

print("current experience is",

DF.loc[e,"experience"])

DF.loc[e,"experience"]=input("Enter new experience")

DF.to_csv("faculty.csv")

print(DF[['facultyname','experience','sub

ject','salary']]) elif opt==4:

e=int(input("enter

ecode")) print("current salary

is",DF.loc[e,"salary"])
DF.loc[e,"salary"]=int(input("enter new salary"))

DF.to_csv("faculty.csv")

print(DF[['facultyname','experience','

subject','salary']]) elif opt==5:

print(DF)

elif opt==6:
print(DF[['facultyname','experience','subject','salary']].sort

_values('experience')) elif opt==7:

print(DF[['facultyname','experience','subject','salary']].sort_
values('experience',ascend ing=False)) elif opt==8:
print(DF.sort_values('s

alary')) elif opt==9:

print(DF.sort_values('salary',ascen

ding=False)) elif opt==10:

sub=input("enter

subject name")

print(DF[DF.subject==sub])

elif opt==11:
x=DF.facultyname

y=DF.salary

pl.plot(x,y, color='red', marker='*', markersize=7,

markeredgecolor='k') pl.xlabel('Faculty Name ',

fontsize=12) pl.ylabel('Salary ', fontsize=12)

pl.title('Salary of Faculty

Members ', fontsize=16) pl.show()

elif opt==-1:

break

else:

print("choose the correct option")

elifch==3:

DF=pd.read_csv("result.csv",index_

col="stid") opt=1 while

opt!=-1:

print()

print('='*60)
print(" RESULT DETAILS ")
print('='*60)
print(" 1. Add new student marks")

print(" 2. Change student marks")

print(" 3. Display all marks

Details") print(" 4. Sort the data by

marks_obt - Ascending") print(" 5.

Sort the data by marks_obt -

Descending") print(" 6.

Semesterwise count of student")

print(" 7. Search by semester")

print(" 8. Search by course") print("

9. Bar Chart - marks of student")

print("-1. Exit") print()

opt=int(input("enter

your choice")) if

opt==1:

e=int(input("Enter stid

")) s=input("enter
semester ")

c=input("enter course ")

im=input("enter internal marks ")

em=input("enter external marks ")

DF.loc[e]=[s,c,im,em]

DF.to_csv("result.csv") print(DF)

print("New student result

detail added") elif opt==2:

s=int(input("enter stid "))


print("Current internal marks is",DF.loc[s,"external
marks"])
DF.loc[s,"external

marks"]=int(input("Enter new marks "))

DF.to_csv("result.csv") print(DF)

print("Student marks

changed") elif

opt==3: print(DF)

elif opt==4:
print(DF.sort_values('externa

l marks')) elif opt==5:

print(DF.sort_values('external marks',

ascending=False)) elif opt==6:

h=int(input("enter a semester"))
print(DF[['course','semester']].groupby('se

mester').count()) elif opt==7:

s=int(input('Enter semester

'))

print(DF[DF.semester==s])

elif opt==8:

c=input("enter course ")


print(DF[DF.course

==c]) elif opt==9:

x=DF.index
y=DF['internal marks']

+DF['external marks'] pl.bar(x,y,

color='blue') pl.xlabel('stid ',

fontsize=12) pl.ylabel('Total Marks',


fontsize=12) pl.title('Marks scored by

Students', fontsize=16) pl.show() elif

opt==-1:

break

else:

print("choose the correct option")

elifch==4:

DF=pd.read_csv("fees.csv",index_

col="stid") opt=4 while

opt!=-1:

print()
print("1. Add new student fees

details") print("2. Cancel a stid

") print("3. Display all fees

Details") print("4. Sort the data

by fees - Ascending") print("5.

Sort the data by fees -


Descending") print("6.

Semesterwise count of student

fees") print("7. Search by

semester") print("8. Search by

fee_amount")

print("9. Fee Amount of various

semesters - Histogram") print("-1.

Exit") print()

opt=int(input("enter

your choice")) if

opt==1:

r=int(input('Enter

stid ')) c=input("enter

semester ") rd=input('Enter

fee date ')

fa=input("enter fee amount

") m=input("enter

month ")
DF.loc[r]=[c,rd,fa,m]

DF.to_csv("fees.csv")

print(DF)

print("New student marks

detail added") elif opt==2:

st=int(input("enter stid no. "))


DF.drop(st,inplace=T

rue)

DF.to_csv("fees.csv")

print(DF)

print("Student fees

changed") elif

opt==3: print(DF)

elif opt==4:

print(DF.sort_value

s('amount')) elif

opt==5:

print(DF.sort_values('amount',

ascending=False)) elif opt==6:


DF1=DF.groupby('semeste

r')

print(DF1.semester.count()

) elif opt==7:

c=int(input("Enter

semester "))

print(DF[DF.semester==c])

elif opt==8:

fo=int(input("Enter

amount "))

print(DF[DF.amount

==fo]) elif opt==9:

x=DF.amount

pl.hist(x,bins=5)

pl.title('Fee Amount of various

semesters',fontsize=16) pl.show()

elif opt==-1:
break

else:

print("choose the

correct option") print()

else:

print('Thank you')
Outputs
Bibliography
1. Informatics Practices – Sumita Arora
2. www.python.org
3. www.google.org

You might also like