Informatics Practices/ Information Practices Project (IP Project Class 12)
92,446 views
33 slides
Mar 28, 2021
Slide 1 of 33
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
About This Presentation
Project for Informatics Practices for students of Class 12.
on Car sales analysis - By Kush Shah.
Link to google drive for downloading CSV containing the data of car sales.
Python pandas and matplotlib used. Please install other required libraries and modules using pip.
No connected MySQL.
Disclaim...
Project for Informatics Practices for students of Class 12.
on Car sales analysis - By Kush Shah.
Link to google drive for downloading CSV containing the data of car sales.
Python pandas and matplotlib used. Please install other required libraries and modules using pip.
No connected MySQL.
Disclaimer:
The data in the csv is dummy data and the project is made completely for spectulative and educational purpose.
INFORMATICS
PRACTICES
PROJECT FILE
CAR SALES ANALYSIS
INDEX
•
ACKNOWLEDGEMENT
•
CODE
•
OUTPUTS
•
BIBLIOGRAPHY
ACKNOWLEDGEMENT
I would like to express my special thanks and gratitude to our
principal Mrs. Jayshree Balasaria as well as my subject teacher
Mrs. Hiral Dabhi who gave me the golden opportunity to do
this wonderful project because of which I came to know
about many new things.
Secondly, I would also like to thank my parents and friends
who have helped me a lot in !inishing the project in limited
time.
##Project Name: Car Model Sales Analysis
##Made By: Kush Shah, 12 Agni/ ZSE-G
import pandas as pd
import numpy as np
import time
import matplotlib.pyplot as plt
df = pd.DataFrame()
def introduction():
def read_csv_file():
df = pd.read_csv("/Users/admin/Desktop/Kush/Study/IP/PROJECT/CAR.csv")
print(df)
##Name of function: clear()
##Purpose: Clear Output Screen
def clear():
for x in range(3):
print()
def data_analysis_menu():
df = pd.read_csv("/Users/admin/Desktop/Kush/Study/IP/PROJECT/CAR.csv")
while True:
clear()
print('\n\nData Analysis MENU ')
print('_'*50)
print('1. Show Columns\n')
print('2. Show Top Rows\n')
print('3. Show Bottom Rows\n')
print('4. Show Specific Column\n')
print('5. Add a New Record\n')
print('6. Delete a Column\n')
print('7. Data Summary\n')
print('8. Exit (Move to main menu)\n')
ch = int(input('Enter your choice:'))
if ch == 1:
print (df.columns)
wait = input()
if ch == 2:
n = int(input('Enter Total rows you want to show :'))
print(df.head(n))
wait = input()
if ch == 3:
n = int(input('Enter Total rows you want to show :'))
print(df.tail(n))
wait = input()
if ch == 4:
print(df.columns)
col_name = input('Enter Column Name that You want to print : ')
print(df[col_name])
wait = input()
if ch==5:
a = input('Enter New Model Name :')
b = input(' Enter Sales in 2015 :')
c= int(input('Enter Sales in 2016 :'))
d = int(input('Enter Sales in 2017 :'))
e = int(input('Enter Sales in 2018 :'))
f = int(input('Enter Sales in 2019 :'))
g= int(input('Enter Sales in 2020 :'))
new_data= pd.Series([b,c,d,e,f,g])
df= pd.read_csv("/Users/admin/Desktop/Kush/Study/IP/PROJECT/CAR.csv", index_col=None)
z=len(df.axes[1])
df.insert(z, a, new_data)
df.to_csv("/Users/admin/Desktop/Kush/Study/IP/PROJECT/CAR.csv", index=False)
print(df)
wait=input()
if ch==6:
col_name =input('Enter column Name to delete :')
del df[col_name]
df.to_csv("/Users/admin/Desktop/Kush/Study/IP/PROJECT/CAR.csv", index= False)
print(df)
print('\n\n\n Press any key to continue....')
wait=input()
if ch==7:
print(df.describe())
print("\n\n\nPress any key to continue....")
wait=input()
if ch ==8:
main_menu()
break
# name of function : graph
# purpose : To generate a Graph menu
def graph():
df = pd.read_csv("/Users/admin/Desktop/Kush/Study/IP/PROJECT/CAR.csv")
while True:
clear()
print('\nGRAPH MENU ')
print('_'*50)
print('1. Car Wise Line Graph\n')
print('2. Car Wise Bar Graph\n')
print('3. Exit (Move to main menu)\n')
ch = int(input('Enter your choice:'))
if ch == 1:
clear()
print('\nSELECT MANUFACTURER')
print('_'*50)
print('1. Honda\n')
print('2. Hyundai\n')
print('3. Maruti Suzuki\n')
print('4. Tata\n')
print('5. Nissan\n')
print('6. Audi\n')
if ch3==1:
g = df.groupby('i10')
x = df['MODEL']
y = df['i10']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch3==2:
g = df.groupby('i20')
x = df['MODEL']
y = df['i20']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch3==3:
g = df.groupby('CRETA')
x = df['MODEL']
y = df['CRETA']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch3==4:
g = df.groupby('VENUE')
x = df['MODEL']
y = df['VENUE']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch3==5:
g = df.groupby('VERNA')
x = df['MODEL']
y = df['VERNA']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch3==6:
g = df.groupby('SANTRO')
x = df['MODEL']
y = df['SANTRO']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch3==7:
g = df.groupby('ELANTRA')
x = df['MODEL']
y = df['ELANTRA']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch3==8:
g = df.groupby('XCENT')
x = df['MODEL']
y = df['XCENT']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch3==9:
g = df.groupby('SONATA')
x = df['MODEL']
y = df['SONATA']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch3==10:
g = df.groupby('PALISADE')
x = df['MODEL']
y = df['PALISADE']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch3==11:
g = df.groupby('KONA')
x = df['MODEL']
y = df['KONA']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch1==3:
clear()
print('\nSELECT CAR')
print('_'*50)
print('1. Baleno\n')
print('2. Swift\n')
print('3. DZire\n')
print('4. Alto\n')
print('5. Ciaz\n')
print('6. Eeco\n')
print('7. Ignis\n')
print('8. Celerio X\n')
print('9 S-Cross\n')
print('10. XL6\n')
ch4 = int(input('Enter your choice:'))
if ch4==1:
g = df.groupby('BALENO')
x = df['MODEL']
y = df['BALENO']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch4==2:
g = df.groupby('SWIFT')
x = df['MODEL']
y = df['SWIFT']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch4==3:
g = df.groupby('DZIRE')
x = df['MODEL']
y = df['DZIRE']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch4==4:
g = df.groupby('ALTO')
x = df['MODEL']
y = df['ALTO']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch4==5:
g = df.groupby('CIAZ')
x = df['MODEL']
y = df['CIAZ']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch4==6:
g = df.groupby('EECO')
x = df['MODEL']
y = df['EECO']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch4==7:
g = df.groupby('IGNIS')
x = df['MODEL']
y = df['IGNIS']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch4==8:
g = df.groupby('CELERIO X')
x = df['MODEL']
y = df['CELERIO X']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch4==9:
g = df.groupby('S-CROSS')
x = df['MODEL']
y = df['S-CROSS']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch4==10:
g = df.groupby('XL6')
x = df['MODEL']
y = df['XL6']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch1==4:
clear()
print('\nSELECT CAR')
print('_'*50)
print('1. Tiago\n')
print('2. Nexon\n')
print('3. Tigor\n')
print('4. Harrier\n')
print('5. Altroz\n')
print('6. Nano\n')
print('7. Safari\n')
print('8. HBX\n')
ch5 = int(input('Enter your choice:'))
if ch5==1:
g = df.groupby('TIAGO')
x = df['MODEL']
y = df['TIAGO']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch5==2:
g = df.groupby('NEXON')
x = df['MODEL']
y = df['NEXON']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch5==3:
g = df.groupby('TIGOR')
x = df['MODEL']
y = df['TIGOR']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch5==4:
g = df.groupby('HARRIER')
x = df['MODEL']
y = df['HARRIER']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch5==5:
g = df.groupby('ALTROZ')
x = df['MODEL']
y = df['ALTROZ']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch5==6:
g = df.groupby('NANO')
x = df['MODEL']
y = df['NANO']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch5==7:
g = df.groupby('SAFARI')
x = df['MODEL']
y = df['SAFARI']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch5==8:
g = df.groupby('HBX')
x = df['MODEL']
y = df['HBX']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch1==5:
clear()
print('\nSELECT CAR')
print('_'*50)
print('1. Sunny\n')
print('2. Magnite\n')
print('3. Kicks\n')
print('4. GT-R\n')
print('5. Terra\n')
ch6 = int(input('Enter your choice:'))
if ch6==1:
g = df.groupby('SUNNY')
x = df['MODEL']
y = df['SUNNY']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch6==2:
g = df.groupby('MAGNITE')
x = df['MODEL']
y = df['MAGNITE']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch6==3:
g = df.groupby('KICKS')
x = df['MODEL']
y = df['KICKS']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch6==4:
g = df.groupby('GT-R')
x = df['MODEL']
y = df['GT-R']
plt.xticks(rotation='vertical')
plt.xlabel('COMPANY')
plt.ylabel('Total Sales')
plt.title('Company wise sales count')
plt.grid(True)
plt.plot(x, y)
plt.show()
if ch6==5:
g = df.groupby('TERRA')
data_analysis_menu()
wait = input()
if choice == 3:
graph()
wait = input()
if choice == 4:
print ("Project Made by- Kush Shah")
break
clear()
# call your main menu
main_menu()
OUTPUTS
MAIN MENU
1. READ CSV FILE
2. DATA ANALYSIS MENU
2,1- SHOW COLUMNS
2,2- SHOW TOP ROWS
2,3- SHOW BOTTOM ROWS
2,4- SHOW PARTICULAR COLUMN (SAY, AMAZE)
2,5- ADD A NEW RECORD
2,6- DELETE A COLUMN
2,7- DATA SUMMARY
3. GRAPH MENU
THE GRAPHS OF SALES OF VARIOUS CARS IS SHOWN
WHEN THE USER SELECTS THEM. FIRST THE USER
SELECTS THE MANUFACTURER FROM THE GIVEN SIX
OPTIONS. ONCE THE MANUFACTURER IS SELECTED, THE
USER IS SUPPOSED TO SELECT THE NAME OF THE CAR
MODEL FROM THE GIVEN LIST.
SINCE THERE ARE A LOT OF CAR MODELS IN THE CSV, I
HAVE NOT PRINTED ALL THE CHARTS BUT TWO OR
THREE CHARTS OF EACH TYPE RANDOMLY SELECTED.
STILL ALL THE CAR MODELS ARE CHECKED AND ALL OF
THOSE ARE WORKING JUST PERFECTLY.
LINE GRAPHS OF CARS- (SELECTED RANDOMLY)
HONDA- AMAZE NISSAN- KICKS
TATA- TIGOR MARUTI SUZUKI- CELERIO X
BAR GRAPHS OF CARS- (SELECTED RANDOMLY)
AUDI- A8 NISSAN- TERRA
TATA- NANO HONDA- CITY