Share INFORMATICS PRACTICES KABIR
Share INFORMATICS PRACTICES KABIR
PRACTICES
A PROJECT REPORT
ON
IPL
SUBMITTED BY-
KABIR ANAND
XII-A
2020-21
ROLLNO-
CERTIFICATE
This is to certify that the Project entitled
“INDIAN PREMIER LEAGUE (IPL)” is the
arduous work done by KABIR ANAND Class
XII-A Session 2020-2021 and has been
carried out under my direct supervision
and guidance. He has taken proper care
and shown utmost sincerity in completion
of this project.
I certify that this project is up to my
expectations and as per the guidelines
issued by CBSE.
SIGNATURE OF TEACHER
MONIKA KHANNA
INFORMATICS PRACTICES
ACKNOWLEDGEMENT
I undertook this Project work, as
the part of my XII-Informatics
Practices course.
I had tried to apply my best of
knowledge and experience, gained
during the
study and class work experience.
However, developing software
system is generally a quite
complex and time-consuming
process.
It requires a systematic
study, insight vision and
professional approach during the
design and
development.
Moreover, the developer always
feels the need, the help and good
wishes of the people near you, who
have considerable experience and
idea. 4
I would like to extend my sincere
thanks and gratitude to my teacher
“Mrs.
Monika Khanna”. 5
INTRODUCTION
This software project is developed to
represent the records of the players
who played in the INDIAN PREMIER
LEAGUE(IPL)
The purpose of this software project is
to develop a program which provides
a friendly interface for the user to
explore the records of players who
played in the IPL.
Country and Above 35 have been
represented by bar and line charts.
For creating this program python 3.8.2
have been used.
TheoreticAL
BACKGROUND
What is pandas?
It is a most famous Python package
for data science, which offers
powerful and flexible data structures
that make data analysis and
manipulation easy. Pandas makes
data importing and data analyzing
much easier. Pandas builds on
packages like NumPy and matplotlib
to give us a single & convenient place
for data analysis and
visualization work.
What problem does pandas solve?
It enables us to carry out our entire
data analysis workflow in Python.
Combined with the excellent IPython
Tool kit and other libraries, the
environment for doing data analysis in
Python excels in performance,
productivity, and the ability to
collaborate.
What is pyplot?
Provides the state-machine
interface to the plotting library in
matplotlib. It means that figures
and axes are implicitly and
automatically created to achieve
the desired plot. For example,
calling plot from pyplot will
automatically create the necessary
figure and axes to achieve the
desired plot. Setting a title will then
automatically set that title to the
current axes object. The pyplot
interface is generally preferred for
non-interactive plotting (i.e.,
scripting). 8
WHAT IS MATPLOTLIB?
Is the whole python package /library
used to create 2D graphs and plots by
using python scripts. Pyplot is a
module in matplotlib ,which supports
a very wide variety of graphs and
plots namely- histogram, barcharts,
powerspectra, error charts etc. It is
used along with NumPy to provide an
environment for MatLab.
What is csv file?
csv (comma separated values) is a
simple file format used to store
tabular data,such as a spread sheet 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 9
source of the name for this file format.
Working
For working csv files in python,there is
an in-built module called csv.files of
this format are generally used to
exchange data,usually when there is a
large amount,between different
applications.
BEFORE:
After conversion
To csv format:
Tools
The sofTware’s used:
Microsoft windows 8 as
operating system.
Pandas 3.8.2
Matplotlib for charts(line and bar
charts)
Csv files
Ms word 2013 for documentaton.
11
Menu driven program
Coding
Menu:
import matplotlib.pyplot
as plt
import csv
import pandas as pd
main_menu='''\n\n Main
Menu-------:
0 To display data
1 To analysis data
2 To delete
3 Exit'''
display_menu=''' ----
Display DATA MENU----
1: All Data
2: First Five Records
3: Last Five Record
4: Specific sno Record
5: Unique state
6: Display Selected
Columns
-- Return to Main Menu'''
analysis_menu=''' ----
Analysis DATA MENU----
1: Line Chart
(CAPACITY/No of
studenTS)
2: Bar Chart (Capacity/No
of students)
--- Return to Main Menu
def
display_data():
df=pd.read_csv('C:\\
Users\\Satyam\\Desktop\\
desktop\\
IPLData2.csv',names=['S
1_NO','Player
Name','Age','Batsman(25
-35)','Above
35','Country','INDIA','Aust
ralia','Others','Team','Pla
ying
Role','Batsman','Bowler','
Allrounder','W.keeper','Te
st Runs','Test
Wickets'],skiprows=1)
while(True):
print(display_menu)
ch=int(input("Enter
Choice "))
if ch==1:
print(df)
elif ch==2:
print(df.head(5))
elif ch==3:
print(df.tail(5))
elif ch==4:
n=int(input('\
nEnter S1_NO for search -
> '))
df1=df[df.S1_NO==n]
if df1.empty:
print('\n........No
such S1_NO
Available..........\n')
else:
print(df1)
print()
elif ch==5:
print('\n Country -
> ',df.Country.unique())
Co=input('\nEnter
Country -> ')
df1=df[df.Country==Co]
if df1.empty:
print('\nNo
such Country available ->
',Co)
else:
print(df1)
print()
elif ch==6:
print('\nList of
Columns are')
for x in
df.columns:
print(x,end=',
')
clist=[]
while True:
c=input('\
nEnter column name -> ')
clist.append(c)
ch=input('Want
to give more column
name-> ')
if ch in 'nN':
break
print('Details of
Selected columns data')
print(df[clist])
print()
else:
break
def analysis_data():
df = pd.read_csv('C:\\
Users\\Satyam\\Desktop\\
desktop\\
IPLData2.csv',names=['S
1_NO','Player
Name','Age','Batsman(25
-35)','Above
35','Country','INDIA','Aust
ralia','Others','Team','Pla
ying
Role','Batsman','Bowler','
Allrounder','W.keeper','Te
st Runs','Test
Wickets'],skiprows=1)
while(True):
print(analysis_menu)
ch=int(input("Enter
choice" ))
if ch==1:
df.plot('Country','Above
35',color='b',linestyle='-',
linewidth=2,marker='o',
markersize=8)
plt.ylabel('Country',
fontsize=12)
plt.xlabel('Above
35',fontsize=12)
plt.title('ipl',fontsize=14)
plt.grid(True)
plt.grid(which='major',
linestyle='-',
linewidth='0.5',
color='red')
plt.show()
elif ch==2:
df.plot.bar('Country','Abo
ve
35',color='g',edgecolor='
r')
plt.ylabel('Country',fontsi
ze=12)
plt.xlabel('Above
35',fontsize=12)
plt.title('ipl',fontsize=14)
plt.show()
else:
break
def delete_data():
df = pd.read_csv('C:\\
Users\\Satyam\\Desktop\\
desktop\\
IPLData2.csv',names=['S
1_NO','Player
Name','Age','Batsman(25
-35)','Above
35','Country','INDIA','Aust
ralia','Others','Team','Pla
ying
Role','Batsman','Bowler','
Allrounder','W.keeper','Te
st Runs','Test Wickets'])
print(df)
n=int(input('Enter the
row index number for
deletion -> '))
df.drop(n,inplace=True)
print(df)
print('\n------------
Record deleted from Data
Frame---------------')
THANK YOU