Professional Documents
Culture Documents
import pandas as pd
def showData():
print(df)
def dataNoIndex():
print(df)
def data_sorted():
print(df.sort_values(by='Year'))
def line_chart():
Chennai=df["Chennai"]
Coimbatore=df["Coimbatore"]
Cuddalore=df["Cuddalore"]
Dharmapuri=df["Dharmapuri"]
Dindigul=df["Dindigul"]
Erode=df["Erode"]
Kancheepuram=df["Kancheepuram"]
Kanniyakumari=df["Kanniyakumari"]
Karur=df["Karur"]
Krishnagiri=df["Krishnagiri"]
Madurai=df["Madurai"]
Nagapattinam=df["Nagapattinam"]
Namakkal=df["Namakkal"]
Perambalur=df["Perambalur"]
Pudukkotai=df["Pudukkotai"]
Ramanathapuram=df["Ramanathapuram"]
Salem=df["Salem"]
Sivagangai=df["Sivagangai"]
Thanjavur=df["Thanjavur"]
TheNilgris=df["The Nilgris"]
Theni=df["Theni"]
Thiruchirappalli=df["Thiruchirappalli"]
Thirunelveli=df["Thirunelveli"]
Thiruvallur=df["Thiruvallur"]
Thiruvannamalai=df["Thiruvannamalai"]
Thiruvarur=df["Thiruvarur"]
Thoothukodi=df["Thoothukodi"]
Vellore=df["Vellore"]
Villupuram=df["Villupuram"]
Virudhunagar=df["Virudhunagar"]
y = df['Year']
plt.ylabel("Years")
Y=0
while Y !=6:
print(" ==============================")
print(" ==============================")
print("4.GDP of Dharmapuri")
print("5.GDP of Dindigul")
print("6.GDP of Erode")
print("7.GDP of Kancheepuram")
print("8.GDP of Kanniyakumari")
print("9.GDP of Karur")
print("11.GDP of Madurai")
print("12.GDP of Nagapattinam")
print("13.GDP of Namakkal")
print("14.GDP of Perambalur")
print("15.GDP of Pudukkotai")
print("16.GDP of Ramanathapuram")
print("17.GDP of Salem")
print("18.GDP of Sivagangai")
print("19.GDP of Thanjavur")
print("21.GDP of Theni")
print("22.GDP of Thiruchirappalli")
print("23.GDP of Thirunelveli")
print("24.GDP of Thiruvallur")
print("25.GDP of Thiruvannamalai")
print("26.GDP of Thiruvarur")
print("27.GDP of Thoothukodi")
print("28.GDP of Vellore")
print("29.GDP of Villupuram")
print("30.GDP of Virudhunagar")
print("31.All data")
plt.xlabel("Chennai")
plt.title("GDP of Chennai")
plt.plot(Chennai,y, color='b')
plt.show()
elif Y == 2:
plt.xlabel("Coimbatore")
plt.title("GDP of Coimbatore")
plt.plot(Coimbatore,y, color='b')
plt.show()
elif Y == 3:
plt.xlabel("Cuddalore")
plt.title("GDP of Cuddalore")
plt.plot(Cuddalore,y, color='b')
plt.show()
elif Y == 4:
plt.xlabel("Dharmapuri")
plt.title("GDP of Dharmapuri")
plt.plot(Dharmapuri,y, color='b')
plt.show()
elif Y == 5:
plt.xlabel("Dindigul")
plt.title("GDP of Dindigul")
plt.plot(Dindigul,y, color='b')
plt.show()
elif Y == 6:
plt.xlabel("Erode")
plt.title("GDP of Erode")
plt.plot(Erode,y, color='b')
plt.show()
elif Y == 7:
plt.xlabel("Kancheepuram")
plt.title("GDP of Kancheepuram")
plt.plot(Kancheepuram,y, color='b')
plt.show()
elif Y == 8:
plt.xlabel("Kanniyakumari")
plt.title("GDP of Kanniyakumari")
plt.plot(Kanniyakumari,y, color='b')
plt.show()
elif Y == 9:
plt.xlabel("Karur")
plt.title("GDP of Karur")
plt.plot(Karur,y, color='b')
plt.show()
elif Y == 10:
plt.xlabel("Krishnagiri")
plt.title("GDP of Krishnagiri")
plt.plot(Krishnagiri,y, color='b')
plt.show()
elif Y == 11:
plt.xlabel("Madurai")
plt.title("GDP of Madurai")
plt.plot(Madurai,y, color='b')
plt.show()
elif Y == 12:
plt.xlabel("Nagapattinam")
plt.title("GDP of Nagapattinam")
plt.plot(Nagapattinam,y, color='b')
plt.show()
elif Y == 13:
plt.xlabel("Namakkal")
plt.title("GDP of Namakkal")
plt.plot(Namakkal,y, color='b')
plt.show()
elif Y == 14:
plt.xlabel("Perambalur")
plt.title("GDP of Perambalur")
plt.plot(Perambalur,y, color='b')
plt.show()
elif Y == 15:
plt.xlabel("Pudukkotai")
plt.title("GDP of Pudukkotai")
plt.plot(Pudukkotai,y, color='b')
plt.show()
elif Y == 16:
plt.xlabel("Ramanathapuram")
plt.title("GDP of Ramanathapuram")
plt.plot(Ramanathapuram,y, color='b')
plt.show()
elif Y == 17:
plt.xlabel("Salem")
plt.title("GDP of Salem")
plt.plot(Salem,y, color='b')
plt.show()
elif Y == 18:
plt.xlabel("Sivagangai")
plt.title("GDP of Sivagangai")
plt.plot(Sivagangai,y, color='b')
plt.show()
elif Y == 19:
plt.xlabel("Thanjavur")
plt.title("GDP of Thanjavur")
plt.plot(Thanjavur,y, color='b')
plt.show()
elif Y == 20:
plt.xlabel("The Nilgris")
plt.plot(TheNilgris,y, color='b')
plt.show()
elif Y == 21:
plt.xlabel("Theni")
plt.title("GDP of Theni")
plt.plot(Theni,y, color='b')
plt.show()
elif Y == 22:
plt.xlabel("Thiruchirappalli")
plt.title("GDP of Thiruchirappalli")
plt.plot(Thiruchirappalli,y, color='b')
plt.show()
elif Y == 23:
plt.xlabel("Thirunelveli")
plt.title("GDP of Thirunelveli")
plt.plot(Thirunelveli,y, color='b')
plt.show()
elif Y == 24:
plt.xlabel("Thiruvallur")
plt.title("GDP of Thiruvallur")
plt.plot(Thiruvallur,y, color='b')
plt.show()
elif Y == 25:
plt.xlabel("Thiruvannamalai")
plt.title("GDP of Thiruvannamalai")
plt.plot(Thiruvannamalai,y, color='b')
plt.show()
elif Y == 26:
plt.xlabel("Thiruvarur")
plt.title("GDP of Thiruvarur")
plt.plot(Thiruvarur,y, color='b')
plt.show()
elif Y == 27:
plt.xlabel("Thoothukodi")
plt.title("GDP of Thoothukodi")
plt.plot(Thoothukodi,y, color='b')
plt.show()
elif Y == 28:
plt.xlabel("Vellore")
plt.title("GDP of Vellore")
plt.plot(Vellore,y, color='b')
plt.show()
elif Y == 29:
plt.xlabel("Villupuram")
plt.title("GDP of Villupuram")
plt.plot(Villupuram,y, color='b')
plt.show()
elif Y == 30:
plt.xlabel("Virudhunagar")
plt.title("GDP of Virudhunagar")
plt.plot(Virudhunagar,y, color='b')
plt.show()
elif Y == 31:
df.plot(subplots = True)
elif Y == 32:
main_menu()
else:
def bar_chart():
Chennai=df["Chennai"]
Coimbatore=df["Coimbatore"]
Cuddalore=df["Cuddalore"]
Dharmapuri=df["Dharmapuri"]
Dindigul=df["Dindigul"]
Erode=df["Erode"]
Kancheepuram=df["Kancheepuram"]
Kanniyakumari=df["Kanniyakumari"]
Karur=df["Karur"]
Krishnagiri=df["Krishnagiri"]
Madurai=df["Madurai"]
Nagapattinam=df["Nagapattinam"]
Namakkal=df["Namakkal"]
Perambalur=df["Perambalur"]
Pudukkotai=df["Pudukkotai"]
Ramanathapuram=df["Ramanathapuram"]
Salem=df["Salem"]
Sivagangai=df["Sivagangai"]
Thanjavur=df["Thanjavur"]
TheNilgris=df["The Nilgris"]
Theni=df["Theni"]
Thiruchirappalli=df["Thiruchirappalli"]
Thirunelveli=df["Thirunelveli"]
Thiruvallur=df["Thiruvallur"]
Thiruvannamalai=df["Thiruvannamalai"]
Thiruvarur=df["Thiruvarur"]
Thoothukodi=df["Thoothukodi"]
Vellore=df["Vellore"]
Villupuram=df["Villupuram"]
Virudhunagar=df["Virudhunagar"]
plt.xlabel("Districts")
Year = df['Year']
plt.xlabel("Years")
Y=0
while Y !=5:
print(" ==============================")
print(" ==============================")
print("3.GDP of Cuddalore")
print("4.GDP of Dharmapuri")
print("5.GDP of Dindigul")
print("6.GDP of Erode")
print("7.GDP of Kancheepuram")
print("8.GDP of Kanniyakumari")
print("9.GDP of Karur")
print("11.GDP of Madurai")
print("12.GDP of Nagapattinam")
print("13.GDP of Namakkal")
print("14.GDP of Perambalur")
print("15.GDP of Pudukkotai")
print("16.GDP of Ramanathapuram")
print("17.GDP of Salem")
print("18.GDP of Sivagangai")
print("19.GDP of Thanjavur")
print("21.GDP of Theni")
print("22.GDP of Thiruchirappalli")
print("23.GDP of Thirunelveli")
print("24.GDP of Thiruvallur")
print("25.GDP of Thiruvannamalai")
print("26.GDP of Thiruvarur")
print("27.GDP of Thoothukodi")
print("28.GDP of Vellore")
print("29.GDP of Villupuram")
print("30.GDP of Virudhunagar")
print("31.All data")
if Y == 1:
plt.ylabel("Chennai")
plt.title("GDP of Chennai")
plt.show()
elif Y == 2:
plt.ylabel("Coimbatore")
plt.title("GDP of Coimbatore")
plt.show()
elif Y == 3:
plt.ylabel("Cuddalore")
plt.title("GDP of Cuddalore")
plt.show()
elif Y == 4:
plt.ylabel("Dharmapuri")
plt.title("GDP of Dharmapuri")
plt.show()
elif Y == 5:
plt.ylabel("Dindigul")
plt.title("GDP of Dindigul")
plt.show()
elif Y == 6:
plt.ylabel("Erode")
plt.title("GDP of Erode")
plt.show()
elif Y == 7:
plt.ylabel("Kancheepuram")
plt.title("GDP of Kancheepuram")
plt.show()
elif Y == 8:
plt.ylabel("Kanniyakumari")
plt.title("GDP of Kanniyakumari")
plt.show()
elif Y == 9:
plt.ylabel("Karur")
plt.title("GDP of Karur")
plt.show()
elif Y == 10:
plt.ylabel("Krishnagiri")
plt.title("GDP of Krishnagiri")
plt.show()
elif Y == 11:
plt.ylabel("Madurai")
plt.title("GDP of Madurai")
plt.show()
elif Y == 12:
plt.ylabel("Nagapattinam")
plt.title("GDP of Nagapattinam")
plt.show()
elif Y == 13:
plt.ylabel("Namakkal")
plt.title("GDP of Namakkal")
plt.show()
elif Y == 14:
plt.ylabel("Perambalur")
plt.title("GDP of Perambalur")
plt.show()
elif Y == 15:
plt.ylabel("Pudukkotai")
plt.title("GDP of Pudukkotai")
plt.show()
elif Y == 16:
plt.ylabel("Ramanathapuram")
plt.title("GDP of Ramanathapuram")
plt.bar(Year,Ramanathapuram, color='b', width = 0.5)
plt.show()
elif Y == 17:
plt.ylabel("Salem")
plt.title("GDP of Salem")
plt.show()
elif Y == 18:
plt.ylabel("Sivagangai")
plt.title("GDP of Sivagangai")
plt.show()
elif Y == 19:
plt.ylabel("Thanjavur")
plt.title("GDP of Thanjavur")
plt.show()
elif Y == 20:
plt.ylabel("The Nilgris")
plt.show()
elif Y == 21:
plt.ylabel("Theni")
plt.title("GDP of Theni")
plt.show()
elif Y == 22:
plt.ylabel("Thiruchirappalli")
plt.title("GDP of Thiruchirappalli")
elif Y == 23:
plt.ylabel("Thirunelveli")
plt.title("GDP of Thirunelveli")
plt.show()
elif Y == 24:
plt.ylabel("Thiruvallur")
plt.title("GDP of Thiruvallur")
plt.show()
elif Y == 25:
plt.ylabel("Thiruvannamalai")
plt.title("GDP of Thiruvannamalai")
plt.show()
elif Y == 26:
plt.ylabel("Thiruvarur")
plt.title("GDP of Thiruvarur")
plt.show()
elif Y == 27:
plt.ylabel("Thoothukodi")
plt.title("GDP of Thoothukodi")
plt.show()
elif Y == 28:
plt.ylabel("Vellore")
plt.title("GDP of Vellore")
plt.show()
elif Y == 29:
plt.ylabel("Villupuram")
plt.title("GDP of Villupuram")
plt.show()
elif Y == 30:
plt.ylabel("Virudhunagar")
plt.title("GDP of Virudhunagar")
plt.show()
elif Y == 31:
df.plot.bar(subplots = True)
elif Y == 32:
main_menu()
else:
def main_menu():
ch=0
print(" ==============================")
print(" ==============================")
while ch!=9:
print("""
1. Show DataFrame
4. Line Graph
5. Bar Graph
6. Exit
""")
ch=int(input("Enter your choice:"))
if ch==1:
showData()
elif ch==2:
dataNoIndex()
elif ch==3:
data_sorted()
elif ch==4:
line_chart()
elif ch==5:
bar_chart()
elif ch==6:
print("Thank you for using our App, Bye Bye, See you again!!")
break
main_menu()