0% found this document useful (0 votes)
5 views45 pages

IP Py Project

The document outlines a project titled 'Election Seats Management System' developed by Aryan Pandey for his Informatics Practices class at Police Modern School. The system aims to manage election seat allocation, track votes, and generate reports using Python and CSV data. It includes features for data visualization and future enhancements such as improved security and additional modules.

Uploaded by

mayankrajput0088
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views45 pages

IP Py Project

The document outlines a project titled 'Election Seats Management System' developed by Aryan Pandey for his Informatics Practices class at Police Modern School. The system aims to manage election seat allocation, track votes, and generate reports using Python and CSV data. It includes features for data visualization and future enhancements such as improved security and additional modules.

Uploaded by

mayankrajput0088
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

POLICE MODERN SCHOOL

41 B.N P.A.C VAISHALI


GHAZIABAD JANUARY 2025

ELECTION SEATS MANAGEMENT SYSTEM

CBSE- CENTRAL BOARD OF


SECONDARYEDUCATION
2024-2025: SCIENCE - XIIA

In

INFORMATICS PRACTICES

By:- Aryan Pandey – XII A

Under the Guidance of :


Mrs. NISHA VERMA PGT (I.P)
CERTIFICATE

This is to Certified that the Project


“Election Seats Management System”
is a
bonafide work done by Mr. Aryan Pandey
Of class XII – Scince 2024-2025 in
partial fulfillment of CBSE’s Examination
and has beem carried out under my direct
supervision and guidance. This report or
a similar report on this topic has not
been submitted for any other
examination and does not form a part of
any other course undergone by this
candidate

Signature of student Signature of teacher


Aryan Pandey Mrs. Nisha Verma

Signature of Principal Signature of Examiner


Mrs. Prachi Jain
Acknowledgment
I express my heartfelt gratitude to my
Informatics Practices Teacher Mrs. Nisha
Verma and our principal, Mrs.
Prachi Jain for their invaluable guidance in
completing my Informatics Practices project.

I am also thankful to my parents and friends for


their constant encouragement and cooperation
throughout this project.
“Election Seats Management System”

Aryan Pandey

XII A
Contents
S no Title sign
1. Introduction of the
Project.
2. CSV File (Data)

3. Python Coding.

4. Output of the Project.

5. Future Scope
6. System Requirements of
the Project.

7. References.
Introduction of
the project
The Election Seats Management System is a project developed to
manage and streamline the process of election seat allocation in
various constituencies. The system is designed to simplify the
handling of election results, including the assignment of seats to
candidates based on votes received.

1. AIM: (i) Recording the number of votes received by


each party in each constituency.
(ii) Ensuring accuracy in seat allocation through
systematic logic.
2. Vote Tracking: The system tracks votes for each
candidate and calculates their total in real-time.
3. Data Visualization: The platform includes tools for
visualizing data through charts, graphs, and maps, making
it easier to identify patterns and trends over time.
4. User-Friendly Management: allowing them to enter
data related to candidates, votes, and constituencies. It
also allows for the retrieval of election results after
processing the input data.
5. Efficient Reporting: The system can generate detailed
reports on election results, including a list of winners and
their respective vote counts.

Overall, the Election Seats Management System is a valuable


resource for anyone looking to understand or analyze Election
Parties on a state- by-state basis.
CSV FILE (DATA)

NOTE: This data is Fully Hypothetical.


PYTHON CODE :
# print("||=======================================================||")
print("|| POLICE MODERN SCHOOL ||")
print("|| 41 B.N P.A.C VAISHALI ||")
print("|| ||")
print("|| ELECTION SEATS MANAGEMENT SYSTEM ||")
print("||==========================================================||")

# IMPORTING MATPLOTLIB, PANDAS, NUMPY


import matplotlib.pyplot as plt
import pandas as pd
import numpy as np

# CREATING MAIN MAINU


def main_menu() :
print("||**********************************************************||")
print("||==========================================================||")
print("||----- Read and Edit Data From File In Different Way ----- ||")
print("||==========================================================||")
print("1. Read complete CSV file")
print("2. Reading complete file without index ")
print("||==========================================================||")
print("||----Apply Data Manipulation in the records of CSV file----||")
print("||==========================================================||")
print("3. Search Specific Data")
print("4. Insert the new Row")
print("5. Update the specific columns")
print("6. Delete Data")
print("7. Sorting data as per your choice")
print("8. Read the specific columns")
print("9. Read Top and Bottom record from file as per requirement")
print("10. Make the copy of CSV file")
print("||==========================================================||")
print("||----------------Data Visualization------------------------||")
print("||==========================================================||")
print("11. Line Chart")
print("12. Bar Plot")
print("***********************************************************")

main_menu()
# PROGRAM NUMBER 01 = Read complete CSV file

def ReadCSV() :
print("Reading data form CSV file")
df=pd.read_csv(r"C:\Users\Acer\Desktop\sonit\Election.csv")
df=df.dropna()
print (df)

# PROGRAM NUMBER 02 = Reading complete file without index

def no_index():
print("Reading data from CSV file without index value")
df=pd.read_csv(r"C:\Users\Acer\Desktop\sonit\Election.csv",index_col=0)
print(df)

# PROGRAM NUMBER 03 = Searching the data of CSV.

def search_row ():


x = input("enter the state name ")
df = pd.read_csv(r"C:\Users\Acer\Desktop\sonit\Election.csv")
z = df.loc[df["state"] == x]
print(z)

# PROGRAM NUMBER 04 = Insert the data of CSV.

def insert_row ():


a = input("enter the state name")
b = int(input("enter the BJP seats"))
c = int(input("enter the INC seats"))
d = int(input("enter the OTHERS seats"))
df = pd.read_csv(r"C:\Users\Acer\Desktop\sonit\Election.csv")
new= {"state":a, "BJP":b, "INC":c, "OTHERS":d}
df.loc[len(df.index)] = new
df.to_csv(r"C:\Users\Acer\Desktop\sonit\Election.csv", index=False)
print(df)
# PROGRAM NUMBER 05 = Updating the data of CSV.

def update_col():
df = pd.read_csv(r"C:\Users\Acer\Desktop\sonit\Election.csv")
print(" Enter 1 to update BJP seats")
print(" Enter 2 to update INC seats")
print(" Enter 3 to update OTHERS seats")
op = int(input("enter your choice:"))
x = int(input("enter state no"))
y = int(input("enter the value"))

if op==1:
df.loc[(x - 1), 'BJP'] = y
df.to_csv(r"C:\Users\Acer\Desktop\sonit\Election.csv", index=False)
print(df)

elif op ==2:
df.loc[(x - 1), 'INC'] = y
df.to_csv(r"C:\Users\Acer\Desktop\sonit\Election.csv", index=False)
print(df)

elif op ==3:
df.loc[(x - 1), 'OTHERS'] = y
df.to_csv(r"C:\Users\Acer\Desktop\sonit\Election.csv", index=False)
print(df)

else:
print("enter valid input")

# PROGRAM NUMBER 06 = Deleting the data of CSV.

def Delete_row ():


x = input("enter the state name")
df = pd.read_csv(r"C:\Users\Acer\Desktop\sonit\Election.csv")
df = df.drop(df.loc[df['State'] == x].index)
df.to_csv(r"C:\Users\Acer\Desktop\sonit\Election.csv", index=False)
print (df)
# PROGRAM NUMBER 07 = Sorting data as per your Choice.

def data_Sorting():
df=pd.read_csv(r"C:\Users\Acer\Desktop\sonit\Election.csv")

print("Enter 1 , to arrange the record as per the State name")


print("Enter 2 , to arrange the record as per the BJP seats")
print("Enter 3 , to arrange the record as per the INC seats")
print("Enter 4 , to arrange the record as per the OTHERS seats")

op = int(input("Enter your choice:"))


if op==1:
df.sort_values(["state"],inplace=True)
print(df)

elif op==2:
df.sort_values(["BJP"],inplace=True)
print(df)

elif op==3:
df.sort_values(["INC"],inplace=True)
print(df)

elif op==4:
df.sort_values(["OTHERS"],inplace=True)
print(df)

else:
print("Enter Valid input")

# PROGRAM NUMBER 08 = Reading specific column from CSV file

def specific_col():
print("Reading specific column from CSV file")
print("Enter 1 to show BJP seats")
print("Enter 2 to show INC seats")
print("Enter 3 to show OTHERS seats")

op = int(input("Enter your choice:"))

if op==1:
df=pd.read_csv(r"C:\Users\Acer\Desktop\sonit\Election.csv",usecols=['state','BJ
P'],index_col=0)
print(df)

elif op==2:
df=pd.read_csv(r"C:\Users\Acer\Desktop\sonit\Election.csv",usecols=['state','IN
C'],index_col=0)
print(df)

elif op==3:
df=pd.read_csv(r"C:\Users\Acer\Desktop\sonit\Election.csv",usecols=['state','O
THERS'],index_col=0)
print(df)

else:
print("Enter valid input")

# PROGRAM NUMBER 09 = Read Top and Bottom record from file as per requirment

def top_bottom_selected_records():
df=pd.read_csv(r"C:\Users\Acer\Desktop\sonit\Election.csv", index_col=0)
top=int( input("How many records to display from top: "))
print("First", top, "records")
print(df. head (top))
bottom=int(input ("How many records to display from bottom: "))
print("Last", bottom, "records")
print(df. tail (bottom))

# PROGRAM NUMBER 10 = Make the copy of CSV file


def duplicate():
print("Duplicate the file with new file")
df=pd.read_csv(r"C:/Users/Acer/Desktop/sonit/Election.csv")
df.to_csv(r"C:/Users/Acer/Desktop/sonit/office.csv")
db=pd.read_csv(r"C:/Users/Acer/Desktop/sonit/office.csv")
print("New file name is office")
print("Data from new file")
print(db)
# PROGRAM NUMBER 11 = Line Chart

def line_plot():
df=pd.read_csv(r"C:\Users\Acer\Desktop\sonit\Election.csv")
df = df.astype({"state": str})
st=df['state']
p1=df['BJP']
p2=df['INC']
p3=df['OTHERS']
plt.xlabel("State")
plt.xticks(rotation='vertical')

print("Select Specific line chart as given below:")


print("Enter 1 , to print the graph for State vs BJP")
print("Enter 2 , to print the graph for State VS INC ")
print("Enter 3 , to print the graph for State VS OTHERS ")
print("Enter 4 , to print the graph of all")
op = int(input("Enter your choice:"))

if op == 1:
plt.ylabel("BJP")
plt.title("State wise BJP seats")
plt.plot(st,p1)
plt.show()

elif op==2:
plt.ylabel("INC")
plt.title("State wise INC seats")
plt.plot(st,p2)
plt.show()

elif op==3 :
plt.ylabel("OTHERS")
plt.title("Statewise other seats")
plt.plot(st,p3)
plt.show()

elif op==4 :
plt.ylabel("Number of seats")
plt.plot(st,p1,label="State wise BJP seats")
plt.plot(st,p2,label="State wise INC seats")
plt.plot(st,p3,label="State wise OTHER seats")
plt.legend()
plt.show()
else:
print("ENTER VALID INPUT")

# PROGRAM NUMBER 12 = Bar Chart

def bar_plot():
df=pd.read_csv(r"C:\Users\Acer\Desktop\sonit\Election.csv")

df = df.astype({"state": str})
st=df["state"]
p1=df['BJP']
p2=df['INC']
p3=df['OTHERS']
plt.xlabel("State")
plt.xticks(rotation='vertical')

print("select specific bar chart as given below:")


print("Enter 1 , to print the graph State VS BJP")
print("Enter 2 , to print the graph State VS INC")
print("Enter 3 , to print the graph State VS OTHERS")
print("Enter 4 , to print all data in the form of stock bar chart ")
print("Enter 5 , to print all data in the form of multi bar chart")

op = int(input("Enter your choice:"))

if op==1 :
plt.ylabel("BJP")
plt.title("State wise BJP seats")
plt.bar(st,p1)
plt.show()

elif op==2:
plt.ylabel("INC")
plt.title("State wise INC seats")
plt.bar(st,p2)
plt.show()

elif op==3:
plt.ylabel("OTHERS")
plt.title("State wise OTHERS seats")
plt.bar(st,p3)
plt.show()

elif op==4:
plt.ylabel("Number of seats")
plt.bar(st,p1,width=0.2,label="State wise BJP seats")
plt.bar(st,p2,width=0.2,label="State wise INC seats")
plt.bar(st,p3,width=0.2,label="State wise OTHERS seats")
plt.legend()
plt.show()

elif op==5:
mcu=np.arange(len(st))
width=0.25
plt.bar(mcu,p1,width,label="State wise BJP seats")
plt.bar(mcu+0.25,p2,width,label="State wise INC seats")
plt.bar(mcu+0.5,p3,width,label="State wise OTHERS seats")
plt.legend()
plt.show()

else:
print("Enter Valid input")

opt = int(input("Enter your choice:"))


if opt==1:
ReadCSV()
elif opt==2:
no_index()
elif opt==3:
search_row()
elif opt==4:
insert_row()
elif opt==5:
update_col()
elif opt==6:
Delete_row ()
elif opt==7:
data_Sorting()
elif opt==8:
specific_col()
elif opt==9:
top_bottom_selected_records()
elif opt==10:
duplicate()
elif opt ==11:
line_plot()
elif opt == 12:
bar_plot()

else:
print("Enter Valide input")
OUTPUT OF THE PROJECT

MAIN INTERFACE
Read complete CSV file
Reading complete file without index
Search Specific Data
Insert the new Row
Update the specific columns

Update BJP seats state wise


Update INC seats state wise
Update OTHERS seats state wise
Delete Data
Sorting data as per your Choice

Record as per the State name


Record as per the BJP seats
Record as per the INC seats
Record as per the OTHERS seats
Read the specific columns

BJP seats
Read the specific columns

INC seats
Read the specific columns

OTHERS seats
Read Top and Bottom record from file as per
requirement
Make the copy of CSV file
Line Chart

Graph for State Vs BJP


Graph for State Vs INC
Graph for State Vs OTHERS
Graph for all
Bar Plot

Graph for State Vs BJP


Graph for State Vs INC
Graph for State Vs OTHERS
All data in the form of stock bar chart
All data in the form of multi bar chart
FUTURE SCOPE
• In future our system can include more detailed information, good
backup and restore facility.

• System is so much flexible so in future it can easily add new modules


can be added easily.

• With future technology the precision and accuracy of the data will
get more enhanced & We can easily access the data with without
much difficulties.

• For the security purpose password and login system will be added in
it in future.
System Requirements of
theProject

Recommended System Requirements Processors:


 Processors: Intel® Core™ i3 processor 4300M at
2.60GHz
 Disk space: 2 to 4 GB
 Operating systems: WindowsÆ 10, MACOS,
andUBUNTU.
 Python Versions: 3.X.X or Higher.

Minimum System Requirements


 Processors: Intel Atom® processor or Intel® Core™
i3processor
 Disk space: 1 GB.
 Operating systems: Windows 7 or later, MACOS,
andUBUNTU.
 Python Versions: 2.7.X, 3.6.X
REFERENCES
1.Google

2.Python.org

3.Code academy
4. Google python class
5.Learnpython.org

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy