Professional Documents
Culture Documents
Online Outlet Project
Online Outlet Project
INFORMATICS PRACTICES
PUNJAB-143107
(2020-2021)
SUPERVISION CERTIFICATE
This Is To Certify That Work Presented In The Project
Entitled “__________” Submitted For The Partial
Fulfillment Of CBSE INFORMATICS PRACTICES
Exam To The CBSE New Delhi Is A Bona fide Project
Work Carried Out By………….., A Student Of Class 12,
Army Public School, Amritsar, Punjab Under My
Guidance And Supervision.
Main menu
def main_menu():
ch=0
print(" ==============================")
print(" ==============================")
while ch!=9:
print("""
1. Show DataFrame
5. Edit a record
6. Delete a record
7. Line Graph
8. Bar Graph
9. Exit
""")
def showData():
df=pd.read_csv("shoes.csv")
print(df)
df=pd.read_csv("shoes.csv",index_col=0)
print(df)
def data_sorted():
df=pd.read_csv('shoes.csv')
print(df.sort_values(by=['Sales']))
def write_data():
sn=eval(input("Enter Shoe_Name:"))
pr=eval(input("Enter Price:"))
br=eval(input("Enter Brand:"))
sa=eval(input("Enter Sales:"))
st=eval(input("Enter Stock:"))
d={'Shoe_Name':sn,'Price':pr,'Brand':br,'Sales':sa,'Stock':st}
df=pd.DataFrame(d)
df=pd.read_csv("shoes.csv")
df.loc[df[df['Shoe_Name']==di].index.values,col]=val
df.to_csv("shoes.csv",index=False)
df=pd.read_csv("shoes.csv")
df=df[df.Shoe_Name!=di]
df.to_csv('shoes.csv',index=False)
print("Record deleted...")
df=pd.read_csv('shoes.csv')
Shoe_Name=df["Shoe_Name"]
Price=df["Price"]
Sales=df["Sales"]
Stock=df["Stock"]
plt.xlabel("Shoe_Name")
Y=0
while Y!=4:
print(" ==============================")
print(" ==============================")
if Y == 1:
plt.ylabel("Price")
plt.show()
elif Y == 2:
plt.ylabel("Sales")
plt.show()
elif Y == 3:
plt.ylabel("Stock")
plt.show()
elif Y == 4:
main_menu()
else:
main_menu()
VIII. Coding For Bar graph
def bar_chart():
df=pd.read_csv('shoes.csv')
Shoe_Name=df["Shoe_Name"]
Price=df["Price"]
Sales=df["Sales"]
Stock=df["Stock"]
plt.xlabel("Shoe_Name")
print(" ==============================")
print(" ==============================")
Y=0
while Y!=6:
if Y == 1:
plt.ylabel("Price")
plt.show()
elif Y == 2:
plt.ylabel("Sales")
plt.show()
elif Y == 3:
plt.ylabel("Stock")
plt.show()
elif Y == 4:
plt.legend()
plt.show()
elif Y == 5:
D=np.arange(len(Shoe_Name))
width=0.25
plt.bar(D,Price, width, color='b', label = "Shoe_Name wise Price")
plt.legend()
plt.show()
elif Y==6:
main_menu()
else:
main_menu()
IX. CSV File