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

IP PROJECT (23-24) Jerin

The document describes a Python-based program that analyzes and visualizes stationary item data from a CSV file. The program has a menu-driven interface that allows viewing data in different chart types like bar charts, line charts, histograms. It also allows operations like adding, deleting rows and columns, and appending data to the CSV file.

Uploaded by

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

IP PROJECT (23-24) Jerin

The document describes a Python-based program that analyzes and visualizes stationary item data from a CSV file. The program has a menu-driven interface that allows viewing data in different chart types like bar charts, line charts, histograms. It also allows operations like adding, deleting rows and columns, and appending data to the CSV file.

Uploaded by

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

1

ARMY PUBLIC SCHOOL KIRKEE

INFORMATICS PRACTICES
PROJECT

TOPIC:-Stationary Items and its Prices

Name :- Jerin Raem


Class :- XII-A
Roll no. :- 14
2

Acknowledgement
I want to convey my heartfelt gratitude to my Principal
Mrs.Rupan Jaswal ma’am for their support and motivation
during the research and writing of this project. Their expertise
in the subject matter greatly contributed to the depth and
quality of the project.
Also, I would like to express my sincere gratitude to our IP
teacher Sandhya Lad, for his unwavering support and
encouragement throughout this Informatics Practices project. I
am grateful for the opportunity to have worked on this project
under her guidance, and I am confident that my learning and
personal growth have been enriched as a result.

I would also like to thank my friends, for their feedback and


support. Their input was invaluable in helping me to develop
and refine my ideas. Lastly, my family’s support and
encouragement were essential throughout the completion of
this project.

Sincerely,
Jerin Raem
XII- A
3

Table of Contents
S. No.
Topic
Page
01.
ACKNOWLEDGEMENT
2
02.
SYSTEM SPECIFICATIONS
4
03.
SOFTWARE USED
5
04.
ABOUT THE PROJECT
6
05.
Main.py
7-8
06.
CSV FILE
9
07.
Menu.py
10
08.
VISUALIZE
11
4

BAR CHART
12

LINE CHART
13

HORIZONTAL BARGRAPH
14

LINE CHART
15

RETURN TO MAIN MENU


16
09.
READ
17
10.
DELETE ROW
18
11.
DELETE COLUMN
19
12.
ADD COLUMN
20
13.
VIEW COLUMN
21
14.
5

VIEW ROW
22
15.
APPEND
23
16.
BIBLIOGRAPHY
24

System Specifications
Hardware:

Software:
6

Software Used

PYTHON
Python, established in 1991 by Guido van Rossum, stands out as a user-friendly and
adaptable high-level programming language widely embraced by
both novices and seasoned developers. Renowned for its readability
and uncomplicated syntax, Python employs whitespace indentation
for code structure, deviating from conventional symbols like curly
brackets. This unique approach fosters clean and visually accessible
code.
Python accommodates diverse programming paradigms, including
procedural, object-oriented, and functional programming, providing
developers with the flexibility to choose the most suitable method
for their projects. The language boasts an extensive standard library, offering a plethora of
modules and packages that expedite development by providing pre-built solutions for
common tasks. Additionally, Python's collaborative and community-driven nature has
resulted in a vast ecosystem of third-party libraries and frameworks, exemplified by Django
for web development, NumPy for scientific computing, and TensorFlow for machine
learning.
Recognized for cross-platform compatibility, Python ensures seamless execution on various
operating systems without necessitating modifications. Its interpreted nature facilitates swift
development cycles and straightforward debugging. Python's applications span a wide
spectrum, encompassing web development, data science, artificial intelligence, and
automation.
7

Python's recent surge in popularity can be attributed to its pivotal role in emerging
technologies and disciplines, solidifying its standing as the preferred language for a diverse
array of programming tasks.

CSV

CSV, or Comma-Separated Values, is a widely used file format for storing and exchanging
tabular data in a plain text format. The simplicity and universality of CSV
make it a popular choice for data storage and interchange between different
applications. In a CSV file, each line typically represents a row of data, and
individual values within a row are separated by commas.
The structure of a CSV file is straightforward, making it human-readable
and easy to create and modify using a simple text editor. While commas
are the most common delimiter, other characters like tabs or semicolons
can also be used depending on the specific requirements.
CSV files find extensive use in various domains, including data analysis, data import/export,
and spreadsheet applications. They provide a convenient way to represent structured data,
such as database exports or spreadsheet content, without the complexity of proprietary file
formats. Many programming languages, including Python, offer built-in libraries and
modules for efficiently reading and writing data in CSV format, further contributing to its
widespread adoption in software development.

About the project

Selecting stationery as a topic offers a unique and insightful exploration into the
seemingly ordinary yet indispensable tools that surround us in our daily lives.
Stationery encompasses a diverse range of items, from pens and paper to
notebooks, staplers, and more. Exploring this theme allows one to delve into the
historical evolution of writing instruments, the cultural significance of paper,
and the technological advancements that have shaped the stationery industry.

Beyond their utilitarian functions, stationeries also carry emotional and


nostalgic value, acting as vessels that capture memories, ideas, and the essence
of human communication. Therefore, choosing stationery as a subject offers an
enriching journey through history, culture, design, and personal connections.

In the digital age, the tangible nature of stationery offers a refreshing break from
screens, allowing individuals to engage with their thoughts and ideas in a
tangible and personal way. Thus, exploring the world of stationery unveils its
multifaceted role in self-expression, creativity, and effective communication.
8

To validate this, the python-based program aims to analyze and compare data
on various stationary items with their product id’s.

Main.py
CODE:

import pandas as pd
import matplotlib.pyplot as plt
import menu as d

choice=d.main_menu()
aa=pd.read_csv(r"C:\\project\\Stationary.csv")

while True:
if choice=="visualize": #menu for choosing type of graph to see
print("\nEnter choice to view type of chart")
print("1 barchart\n2 line chart\n3 horizontal bar chart\n4 histogram\n5 Go back to
main menu")
c=int(input("\nEnter choice : "))

if c==1:
aa.plot(kind="bar",x='product',y='price',width=0.75)
aa.xlabel='product'
aa.ylabel='price'
plt.title("Stationary items")
plt.show()

elif c==2:
9

aa.plot(x='product',y='price')
aa.xlabel='product'
aa.ylabel='price'
plt.title("Stationary items")
plt.show()

elif c==3:
aa.plot(kind="barh",x='product_id',width=0.75,color='g')
aa.xlabel='product'
aa.ylabel='price'
plt.title("Stationary items")
plt.show()

elif c==4:
aa.plot(kind="hist",x='product',bins=15,histtype="step")
aa.xlabel='product'
aa.ylabel='price'
plt.title("Stationary items")
plt.legend(loc=2)
plt.show()

elif c==5:
choice=d.main_menu()

else:
print("wrong choice")
break

elif choice=="read":
#df=pd.read_csv("C:\\project\\Stationary.csv")
print(aa)
break
elif choice=="deleteR":
data=pd.read_csv("C:\\project\\Stationary.csv",index_col="product_id")
print(data)
nm=int(input("\nEnter product_id to delete:"))
data.drop([nm],inplace=True)
print("\n",data)
break
elif choice=="deleteC":
data=pd.read_csv("C:\\project\\Stationary.csv",index_col="product_id")
data.drop(["product"],axis=1,inplace=True)
print(data)
break
elif choice=="addC":
aa["Quantity"]=pd.Series([10,12,21,22,15,18])
print(aa)
break

elif choice=="viewC":
10

col=["product_id","product","price"]
ncol=input("Enter name of column to view:")
print(aa[ncol])
break
elif choice=="viewR":
nrow=int(input("enter row no. to view:"))
print(aa.loc[nrow])
break
elif choice=="append":
df=open("C:\\project\\Stationary.csv","a")
df.write("1007,notebook,500\n")
df.close()
print(aa)
break
else:
break

CSV FILE
11

menu.py
CODE:

def main_menu():
print("visualize --to visualize data in csv:")
12

print("read --to read a csv file")


print("deleteR --to delete a row from csv file")
print("addC --to add column to csv file")
print("deleteC --to delete a column from csv file")
print("viewC --to view a column from csv file")
print("viewR --to view a row from csv file")
print("append --to append a row in csv file")
print()
print()
ch=input("\nEnter your choice to process:")
return(ch)

OUTPUT:

VISUALIZE
CODE:

choice=d.main_menu()
13

aa=pd.read_csv(r"C:\\project\\Stationary.csv")

while True:
if choice=="v": #menu for choosing type of graph to see
print("\nEnter choice to view type of chart")
print("1 barchart\n2 line chart\n3 horizontal bar chart\n4 histogram\n5 Go
back to main menu")
c=int(input("\nEnter choice : "))

OUTPUT:

1. Bar-Chart
CODE:

if c==1:
aa.plot(kind="bar",x='product',y='price',width=0.75)
14

aa.xlabel='product'
aa.ylabel='price'
plt.title("Stationary items")
plt.show()

OUTPUT

2. Line-Chart
CODE:

elif c==2:
aa.plot(x='product',y='price')
aa.xlabel='product'
15

aa.ylabel='price'
plt.title("Stationary items")
plt.show()

OUTPUT

3. Horizontal Bar-Graph

CODE:

elif c==3:
16

aa.plot(kind="barh",x='product_id',width=0.75,color='g')
aa.xlabel='product'
aa.ylabel='price'
plt.title("Stationary items")
plt.show()

OUTPUT

4. Histogram

CODE:

elif c==4:
17

aa.plot(kind="hist",x='product',bins=15,histtype="step")
aa.xlabel='product'
aa.ylabel='price'
plt.title("Stationary items")
plt.legend(loc=2)
plt.show()

OUTPUT

5. Return To Main Menu


CODE:

elif c == 5:
choice=d.main_menu()
18

OUTPUT:

READ

CODE:

elif choice == "read":


19

print(aa)
break

OUTPUT:

DELETE ROW

CODE:

elif choice=="delete a row":


data=pd.read_csv("C:\\project\\Stationary.csv",index_col="product_id")
20

print(data)
nm=int(input("\nEnter product_id to delete:"))
data.drop([nm],inplace=True)
print("\n",data)
break

OUTPUT:
21
22
23

CODE:

elif choice=="delete a column":


data=pd.read_csv("C:\\project\\Stationary.csv",index_col="product_id")
data.drop(["product"],axis=1,inplace=True)
print(data)
break

OUTPUT:
24

New
column
is added

ADD COLUMN

CODE:

elif choice=="addC":
aa["Quantity"]=pd.Series([10,12,21,22,15,18])
print(aa)
break

OUTPUT:
25

VIEW COLUMN

CODE:

elif choice=="viewC":
col=["product_id","product","price"]
ncol=input("Enter name of column to view:")
print(aa[ncol])

OUTPUT:
26

VIEW ROW

CODE:

elif choice=="viewR":
nrow=int(input("enter row no. to view:"))
print(aa.loc[nrow])
break

OUTPUT:
27

APPEND

CODE:

elif choice=="append":
df=open("C:\\project\\Stationary.csv","a")
df.write("1007,notebook,500\n")
df.close()
print(aa)
break
28

OUTPUT:

BIBLOGRAPHY

1. www.pinterest.com

2. www.google.co.in

3. Informatics practices textbook of class 12 by Sumita Arora

New
entry/value
is added

You might also like