0% found this document useful (0 votes)
19 views

Project Crops Production Analysis Python Xii Ip

Uploaded by

koshalkamboj3222
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Project Crops Production Analysis Python Xii Ip

Uploaded by

koshalkamboj3222
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 21

A

Project Report on

“CROPS PRODUCTION ANALYSIS SYSTEM”

is hereby submitted to

Central Board of Secondary Education


for the partial fulfillment for the award of certificate of

AISSCE (2024-25)
Supervised by: Submitted by:

Mr. Pardeep K Wadhawan Name:


PGT Computer Science Roll No.:

1|Page
TABLE OF CONTENT
1. ACKNOWLEDGEMENT

2. CERTIFICATE

3. ABOUT PROJECT

4. LIBRARY FUNCTIONS USED

5. USER DEFINED FUNCTIONS USED

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

This is to certify that the project work entitled “Crops Production

Analysis System”, which is being submitted by us in partial fulfillment of the

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,

PGT Computer Science, PM SHRI Kendriya Vidyalaya BSF Jalalabad.

(Signature) (Signature) (Signature)


Name: Name: Name:
Roll No: Roll No: Roll No:

(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:

1. ADD CROPS DETIALS

2. DISPLAY CROPS DATA

3. DISPLAY CROP WHEAT GRAPH

4. DISPLAY CROP RICE GRAPH

5. DISPLAY COMPARISON GRAPH

FRONT END: PYTHON

BACK END: CSV file

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

functions based on choice of user.


welcome() To show welcome screen
addcropsdata() To add a crops details
showcropsdata() To show crops details
showwheatbargraph() To show crop wheat bar graph
showricebargraph() To show crop rice bar graph
showcomparegraph() To show comparison of bar graph

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

#*********ADD CROPS DATA********************


def addcropsdata():

file_csv=open('E:\\production.csv','a',newline='')

year=int(input('enter year of production'))

wheat=int(input('production of wheat in tons '))

rice=int(input('production of rice in tons'))

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'])

print('***Year Wise Wheat and Rice Production in Jalalabad***')


print(df)

#*****DISPLAY WHEAT BAR GRAPH BASED ON DATA*****


def showwheatbargraph():

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.ylabel('Wheat production in Tons')

plt.title('Wheat production yearwise in Jalalabad')

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.ylabel('Rice production in Tons')

plt.title('Rice production yearwise in Jalalabad')

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.ylabel('Production Wheat and Rice in Tons')

plt.title('Comparision of Wheat and Rice Yearwise in Jalalabad')

plt.legend()

plt.show()

17 | P a g e
#*****DISPLAY WELCOME SCREEN*****

def welcome():

print("="*80)

print("\t\t\tCROPS PRODUCTION ANALYSIS SYSTEM")

print("\t\t\t\t Designed By:")

print("\t\t\t\tStudents of class XII IP ")

print("\t\t\tPM SHRI KENDRIYA VIDYALAYA BSF JALALABAD")

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\t1. Add Crops Data')

print('\t\t\t2. Show Wheat Production Graph')

print('\t\t\t3. Show Rice Production Bar Graph')

print('\t\t\t4. Show Comparision of Wheat and Rice')

print('\t\t\t5. Show Crops Data')

print('\t\t\t6.Exit')

ch=input('enter your choice 1-6')

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:

print('\t\t\t!!Invalid input!! 1-6 only')

#***main-coding**

welcome() #calling welcome function

mainmenu() #calling mainmenu

20 | P a g e
Bibliography
1.Informatics Practices by Dhanpat Rai & Co.

2.Informatics Practices by Sultan Chand & Co.

3.Student Support Material by KVS

4.Python Documentation

21 | P a g e

You might also like