Project Crops Production Analysis Python Xii Ip
Project Crops Production Analysis Python Xii Ip
Project Report on
is hereby submitted to
AISSCE (2024-25)
Supervised by: Submitted by:
1|Page
TABLE OF CONTENT
1. ACKNOWLEDGEMENT
2. CERTIFICATE
3. ABOUT PROJECT
6. SCREEN SHOTS
7. CODING
8. Bibliography
2|Page
ACKNOWLEDGEMENT
Making a project is a bear of understanding not only for the developer but for those
around him. Our words cannot do justice to the effect of these people have had on
us, either through technical assistance or moral support. Still, words are all we have
Great acknowledgement is extended to all the people who made this project
possible with their enthusiastic support and encouragement.
First of all we extend out heartiest thanks to our project guide and teacher Mr.
Pardeep Wadhawan, PGT Computer Science, PM SHRI Kendriya Vidyalaya BSF
Jalalabad for giving his precious support and timely guidance to compile and
successfully accomplish this project to our best efforts.
We would like to thanks all the members of the computer Department of PM SHRI
Kendriya Vidyalaya BSF Jalalabad who helped us in bringing out this piece of hard
work and sincere dedication.
We would like to thank our friends for their suggestions, which helped us to make
this project much better than what we could have done alone. And finally thanks to
our parents for their time immemorial support and everlasting encouragement to
make things better and simpler for out better future.
3|Page
CERTIFICATE
requirement for award of the certificate of AISSCE is an authentic work carried out
by us under the supervision and timely guidance of Mr. Pardeep Kumar Wadhawan,
(Signature)
Mr. Pardeep K Wadhawan
PGT Computer Science
PM SHRI Kendriya Vidyalaya BSF Jalalabad.
4|Page
CROPS PRODUCTION ANALYSIS SYSTEM
This project gives following facilities:
5|Page
NAME OF MODULE / LIBRARY IMPORTED :
1. Pandas 2. Matplotlib.pyplot 3. CSV
NAME OF LIBRARY FUNCTIONS USED WITH THEIR PURPOSE:
Function Purpose
open () To open CSV file in writing/reading /
appending mode
writer() To create CSV file writer object
writerow() To write a record in CSV File
close() To close a CSV file
read_csv() To read data from CSV file and store it in
pandas Dataframe
to_csv() To write data in CSV from pands Dataframe
bar() To generate bar-graph()
xlabel() To give label at X-Axis of a graph/ chart.
ylabel() To give label at Y-Axis of a graph/ chart.
Function Purpose
title() To give Title to a graph/ chart.
xticks() To specify ticks at X-axis of agraph/chart
6|Page
yticks() To specify ticks at Y-axis of a graph/ chart
legend() To specify legends about a graph / chart.
show() To display graph/chart on screen.
Series() To create pandas Series.
DataFrame() To create pandas dataframe.
7|Page
NAME OF USER DEFINED FUNCTIONS USED WITH THEIR PURPOSE:
Function Purpose
mainmenu() To display menu options and call other
8|Page
SCREEN
SHOTS
9|Page
SCREEN SHOTS
10 | P a g e
11 | P a g e
12 | P a g e
CODING
13 | P a g e
#**********IMPORTING Library/Module**********
import pandas as pd
import matplotlib.pyplot as plt
import csv
file_csv=open('E:\\production.csv','a',newline='')
data=[year,wheat,rice]
csvobj=csv.writer(file_csv)
csvobj.writerow(data)
file_csv.close()
14 | P a g e
#*********DISPLAY CROPS DATA********************
def showcropsdata():
df=pd.read_csv('E:\\production.csv', index_col=None,header=None,names=['year','wheat','rice'])
data=pd.read_csv('E:\\production.csv', index_col=None,header=None,names=['year','wheat','rice'])
year=pd.Series(data['year'])
wt=pd.Series(data['wheat'])
plt.xticks(year)
plt.bar(year,wt,color='r')
plt.xlabel('year')
plt.show()
15 | P a g e
#*****DISPLAY RICE BAR GRAPH BASED ON DATA*****
def showricebargraph():
data=pd.read_csv('E:\\production.csv', index_col=None,header=None,names=['year','wheat','rice'])
year=pd.Series(data['year'])
rice=pd.Series(data['rice'])
plt.xticks(year)
plt.bar(year,rice,color='g')
plt.xlabel('year')
plt.show()
16 | P a g e
#***DISPLAY COMPARISON OF WHEAT AND RICE THROUGH BAR GRAPH***
def showcomparebargraph():
data=pd.read_csv('E:\\production.csv', index_col=None,header=None,names=['year','wheat','rice'])
year=pd.Series(data['year'])
rice=pd.Series(data['rice'])
wt=pd.Series(data['wheat'])
plt.xticks(year)
plt.bar(year,wt,label='Wheat',color='r',width=0.35)
plt.bar(year+0.35,rice,label='rice',color='g',width=0.35)
plt.xlabel('Year')
plt.legend()
plt.show()
17 | P a g e
#*****DISPLAY WELCOME SCREEN*****
def welcome():
print("="*80)
print("="*80)
18 | P a g e
#*****DISPLAY MAIN MENU*****
def mainmenu():
ch='1'
while ch!='6':
print('\t\t\t\t\t***Main Menu***')
print('\t\t\t6.Exit')
if ch=='1':
addcropsdata()
elif ch=='2':
19 | P a g e
showwheatbargraph()
elif ch=='3':
showricebargraph()
elif ch=='4':
show comparebargraph()
elif ch=='5':
showcropsdata()
elif ch=='6':
print('thank you')
break
else:
#***main-coding**
20 | P a g e
Bibliography
1.Informatics Practices by Dhanpat Rai & Co.
4.Python Documentation
21 | P a g e