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.
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.
To validate this, the python-based program aims to analyze and compare data
on various stationary items with their product id’s.
[Link]
CODE:
import pandas as pd
import [Link] as plt
import menu as d
choice=d.main_menu()
aa=pd.read_csv(r"C:\\project\\[Link]")
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:
[Link](kind="bar",x='product',y='price',width=0.75)
[Link]='product'
[Link]='price'
[Link]("Stationary items")
[Link]()
elif c==2:
[Link](x='product',y='price')
[Link]='product'
[Link]='price'
[Link]("Stationary items")
[Link]()
elif c==3:
[Link](kind="barh",x='product_id',width=0.75,color='g')
[Link]='product'
[Link]='price'
[Link]("Stationary items")
[Link]()
elif c==4:
[Link](kind="hist",x='product',bins=15,histtype="step")
[Link]='product'
[Link]='price'
[Link]("Stationary items")
[Link](loc=2)
[Link]()
elif c==5:
choice=d.main_menu()
else:
print("wrong choice")
break
elif choice=="read":
#df=pd.read_csv("C:\\project\\[Link]")
print(aa)
break
elif choice=="deleteR":
data=pd.read_csv("C:\\project\\[Link]",index_col="product_id")
print(data)
nm=int(input("\nEnter product_id to delete:"))
[Link]([nm],inplace=True)
print("\n",data)
break
elif choice=="deleteC":
data=pd.read_csv("C:\\project\\[Link]",index_col="product_id")
[Link](["product"],axis=1,inplace=True)
print(data)
break
elif choice=="addC":
aa["Quantity"]=[Link]([10,12,21,22,15,18])
print(aa)
break
elif choice=="viewC":
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([Link][nrow])
break
elif choice=="append":
df=open("C:\\project\\[Link]","a")
[Link]("1007,notebook,500\n")
[Link]()
print(aa)
break
else:
break
CSV FILE
[Link]
CODE:
def main_menu():
print("visualize --to visualize data in csv:")
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()
aa=pd.read_csv(r"C:\\project\\[Link]")
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:
[Link](kind="bar",x='product',y='price',width=0.75)
[Link]='product'
[Link]='price'
[Link]("Stationary items")
[Link]()
OUTPUT
2. Line-Chart
CODE:
elif c==2:
[Link](x='product',y='price')
[Link]='product'
[Link]='price'
[Link]("Stationary items")
[Link]()
OUTPUT
3. Horizontal Bar-Graph
CODE:
elif c==3:
[Link](kind="barh",x='product_id',width=0.75,color='g')
[Link]='product'
[Link]='price'
[Link]("Stationary items")
[Link]()
OUTPUT
4. Histogram
CODE:
elif c==4:
[Link](kind="hist",x='product',bins=15,histtype="step")
[Link]='product'
[Link]='price'
[Link]("Stationary items")
[Link](loc=2)
[Link]()
OUTPUT
5. Return To Main Menu
CODE:
elif c == 5:
choice=d.main_menu()
OUTPUT:
READ
CODE:
elif choice == "read":
print(aa)
break
OUTPUT:
DELETE ROW
CODE:
elif choice=="delete a row":
data=pd.read_csv("C:\\project\\[Link]",index_col="product_id")
print(data)
nm=int(input("\nEnter product_id to delete:"))
[Link]([nm],inplace=True)
print("\n",data)
break
OUTPUT:
CODE:
elif choice=="delete a column":
data=pd.read_csv("C:\\project\\[Link]",index_col="product_id")
[Link](["product"],axis=1,inplace=True)
print(data)
break
OUTPUT:
New
column
is added
ADD COLUMN
CODE:
elif choice=="addC":
aa["Quantity"]=[Link]([10,12,21,22,15,18])
print(aa)
break
OUTPUT:
VIEW COLUMN
CODE:
elif choice=="viewC":
col=["product_id","product","price"]
ncol=input("Enter name of column to view:")
print(aa[ncol])
OUTPUT:
VIEW ROW
CODE:
elif choice=="viewR":
nrow=int(input("enter row no. to view:"))
print([Link][nrow])
break
OUTPUT:
APPEND
CODE:
elif choice=="append":
df=open("C:\\project\\[Link]","a")
[Link]("1007,notebook,500\n")
[Link]()
print(aa)
break
OUTPUT:
BIBLOGRAPHY
1. [Link]
2. [Link]
3. Informatics practices textbook of class 12 by Sumita Arora
New
entry/value
is added