INTRODUCTION
INTRODUCTION
Hardware used:
While developing the software, the used hardware’s are:
PC with Intel Core i3 processor having 6.00 GB RAM and
other required devices.
Software used:
⮚ Microsoft Windows® 10 as Operating System.
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
df1=pd.read_csv("C:\\Users\\abc\\Desktop\\GDP at
current prices in ₹ billions.csv")
prop_cycle =plt.rcParams['axes.prop_cycle']
colors = prop_cycle.by_key()['color']
cho='y'
print("GDP of India State Wise (Chart)")
print("-----------------------------")
while(cho=='y' or cho=='Y'):
print("Menu")
print("Particular State -1")
print("Particular Year-2")
print("Selected State&Years-3")
ch=int(input("Enter choice :"))
if ch==1:
for i in range(len(df1['State'])):
print(i," ->",df1['State'][i])
state=int(input("Enter number(0 to 34)"))
print("Details of State: ",df1['State'][state])
print(df1[df1['State']==df1['State'][state]])
yr=df1.columns.values.tolist()
yr=yr[1:]
population=df1[df1['State']==
df1['State'][state]].values.tolist()
print(yr)
print(population[0])
print("Line chart-L")
print("Bar chart-B")
ch=input("Choice :")
if ch=='L':
plt.figure(figsize=(15,6))
plt.grid(True)
plt.xticks(
rotation=90,
horizontalalignment='right',
fontweight='light',
fontsize='medium')
plt.plot(yr,population[0][1:],
linestyle='dashed', linewidth = 3,
marker='o', markerfacecolor='blue',
markersize=12)
elif ch=='B':
plt.figure(figsize=(15,6))
plt.bar(yr,population[0][1:],
color=colors[0:len(population[0][1:])])
plt.xlabel("Year")
plt.ylabel("GDP of India State Wise")
plt.title(df1['State'][state])
plt.show()
elif ch==2:
year=input("Enter year (2012 to 2022):")
yr=df1[year]
print("All states-1")
print("Select state-2")
c=int(input("choice:"))
if c==1:
plt.figure(figsize=(15,6))
st=df1['State']
plt.xticks(
rotation=90,
horizontalalignment='right',
fontweight='light',
fontsize='medium')
print(yr)
plt.bar(st,yr,color=colors[0:len(st)])
plt.xlabel("State")
plt.ylabel("GDP of India State Wise")
plt.title(year)
plt.show()
elif c==2:
plt.figure(figsize=(15,6))
print(df1['State'])
op='y'
l=[]
while op=='y' or op=='Y':
s=int(input("Enter States(0 to 34): "))
l.append(s)
op=input("Continue (y/n):")
st=df1['State'][l]
print(st)
yr=df1[year][l]
print(yr)
plt.xlabel("State")
plt.ylabel("GDP of India State Wise")
plt.title(year)
plt.bar(st,yr,color=colors[0:len(st)])
plt.show()
elif ch==3:
plt.figure(figsize=(15,6))
yr=df1.columns.values.tolist()
yr=yr[1:]
print(df1['State'])
op='y'
l=[]
while op=='y' or op=='Y':
s=int(input("Enter State(0 to 34): "))
l.append(s)
op=input("Continue (y/n):")
print(df1['State'][l])
l1=[]
op='y'
while op=='y' or op=='Y':
s1=input("Enter Year(2012 to 2022):")
l1.append(s1)
op=input("Continue (y/n):")
x=np.arange(len(l))
w=0
for s1 in l1:
a=df1[s1][l].values.tolist()
print(x)
print(a)
plt.bar(x+w,a)
w=w+0.5
print(l)
plt.xticks(np.arange(len(l)),df1['State'][l])
plt.xlabel('State',fontsize=20)
plt.show()
else:
print("Invalid choice")
cho=input("Continue:y/n")
CSV Files Used:
[1 rows x 12 columns]
['2012', '2013', '2014', '2015', '2016', '2017', '2018',
'2019', '2020', '2021', '2022']
['Uttar Pradesh', '8,224', '9,404', '10,118', '11,378',
'12,887', '14,399', '15,822', '17,001', '16,449', '19,756',
'22,580']
Line chart-L
Bar chart-B
Choice :B
Continue:y/nY
Menu
Particular State -1
Particular Year-2
Selected State&Years-3
Enter choice :1
0 -> Andaman and Nicobar Islands
1 -> Andhra Pradesh
2 -> Arunachal Pradesh
3 -> Assam
4 -> Bihar
5 -> Chandigarh
6 -> Chhattisgarh
7 -> Delhi
8 -> Goa
9 -> Gujarat
10 -> Haryana
11 -> Himachal Pradesh
12 -> Jammu and Kashmir
13 -> Jharkhand
14 -> Karnataka
15 -> Kerala
16 -> Madhya Pradesh
17 -> Maharashtra
18 -> Manipur
19 -> Meghalaya
20 -> Mizoram
21 -> Nagaland
22 -> Odisha
23 -> Puducherry
24 -> Punjab
25 -> Rajasthan
26 -> Sikkim
27 -> Tamil Nadu
28 -> Telangana
29 -> Tripura
30 -> Uttar Pradesh
31 -> Uttarakhand
32 -> West Bengal
Enter number(0 to 34)16
Details of State: Madhya Pradesh
State 2012 2013 2014 ... 2019 2020
2021 2022
16 Madhya Pradesh 3,809 4,395 4,799 ... 9,279
9,466 10,930 12,465
[1 rows x 12 columns]
['2012', '2013', '2014', '2015', '2016', '2017', '2018',
'2019', '2020', '2021', '2022']
['Madhya Pradesh', '3,809', '4,395', '4,799', '5,411',
'6,498', '7,263', '8,298', '9,279', '9,466', '10,930',
'12,465']
Line chart-L
Bar chart-B
Choice :L
Continue:y/nY
Menu
Particular State -1
Particular Year-2
Selected State&Years-3
Enter choice :2
Enter year (2012 to 2022):2019
All states-1
Select state-2
choice:2
0 Andaman and Nicobar Islands
1 Andhra Pradesh
2 Arunachal Pradesh
3 Assam
4 Bihar
5 Chandigarh
6 Chhattisgarh
7 Delhi
8 Goa
9 Gujarat
10 Haryana
11 Himachal Pradesh
12 Jammu and Kashmir
13 Jharkhand
14 Karnataka
15 Kerala
16 Madhya Pradesh
17 Maharashtra
18 Manipur
19 Meghalaya
20 Mizoram
21 Nagaland
22 Odisha
23 Puducherry
24 Punjab
25 Rajasthan
26 Sikkim
27 Tamil Nadu
28 Telangana
29 Tripura
30 Uttar Pradesh
31 Uttarakhand
32 West Bengal
Name: State, dtype: object
Enter States(0 to 34): 5
Continue (y/n):Y
Enter States(0 to 34): 27
Continue (y/n):N
5 Chandigarh
27 Tamil Nadu
Name: State, dtype: object
5 434
27 17,431
Name: 2019, dtype: object
Continue:y/nY
Menu
Particular State -1
Particular Year-2
Selected State&Years-3
Enter choice :1
0 -> Andaman and Nicobar Islands
1 -> Andhra Pradesh
2 -> Arunachal Pradesh
3 -> Assam
4 -> Bihar
5 -> Chandigarh
6 -> Chhattisgarh
7 -> Delhi
8 -> Goa
9 -> Gujarat
10 -> Haryana
11 -> Himachal Pradesh
12 -> Jammu and Kashmir
13 -> Jharkhand
14 -> Karnataka
15 -> Kerala
16 -> Madhya Pradesh
17 -> Maharashtra
18 -> Manipur
19 -> Meghalaya
20 -> Mizoram
21 -> Nagaland
22 -> Odisha
23 -> Puducherry
24 -> Punjab
25 -> Rajasthan
26 -> Sikkim
27 -> Tamil Nadu
28 -> Telangana
29 -> Tripura
30 -> Uttar Pradesh
31 -> Uttarakhand
32 -> West Bengal
Enter number(0 to 34)14
Details of State: Karnataka
State 2012 2013 2014 ... 2019 2020
2021 2022
14 Karnataka 6,954 8,167 9,139 ... 16,158 16,415
19,781 22,700
[1 rows x 12 columns]
['2012', '2013', '2014', '2015', '2016', '2017', '2018',
'2019', '2020', '2021', '2022']
['Karnataka', '6,954', '8,167', '9,139', '10,452', '12,076',
'13,332', '14,794', '16,158', '16,415', '19,781', '22,700']
Line chart-L
Bar chart-B
Choice :B
Continue:y/nY
Menu
Particular State -1
Particular Year-2
Selected State&Years-3
Enter choice :2
Enter year (2012 to 2022):2015
All states-1
Select state-2
choice:1
0 60
1 6,042
2 185
3 2,280
4 3,716
5 293
6 2,252
7 5,508
8 551
9 10,290
10 4,955
11 1,142
12 1,172
13 2,066
14 10,452
15 5,620
16 5,411
17 19,662
18 195
19 251
20 151
21 195
22 3,285
23 266
24 3,901
25 6,815
26 180
27 11,765
28 5,779
29 359
30 11,378
31 1,772
32 7,973
Name: 2015, dtype: object
Continue:y/nN
Bibliography
In order to work on this project titled – State wise
GDP Contribution in India (in ₹ billions), the
following books and websites are referred by me
during the various phases of development of the
project.