Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 5

import pandas as pd

import numpy as np
import matplotlib.pyplot as plt
#__________________________________________________________________________________
__________________
print('press 1 to show all the records ')

print('press 2 to show records of a particular train')

print('press 3 to print a particular record ')

print('press 4 to show line chart')

print('press 5 to show bargraph')

print('press 6 to print histograms ')


#__________________________________________________________________________________
___________________

df=pd.read_csv('reserve.csv')

def opt_1():
print()
print(df)

def opt_2():
print()
print('1-----for duronto express')
print('2----for adi-puri express')
print('3------for tezas express')
print('4-----for maharaja express')
print('5-----for shatabdi express')

ch=int(input('enter the choice '))


if ch==1:
print()
print(df['duronto exp'])
elif ch==2:
print()
print(df['adi-puri exp'])
elif ch==3:
print()
print(df['tezas exp'])
elif ch==4:
print(df['maharaja exp'])
elif ch==5:
print()
print(df['shatabdi exp'])

def opt_3():
print()
print('printing the monthly data of RESERVATION')
print('press 1 for data of january')
print('press 2 for data of february')
print('press 3 for data of march')
print('press 4 for data of april')
print('press 5 for data of may')
print('press 6 for data of june')
print('press 7 for data of july')
print('press 8 for data of august')
print('press 9 for data of september')
print('press 10 for data of october')
print('press 11 for data of november')
print('press 12 for data of december')
ch=int(input('enter the choice-'))

if ch==1:
print(df.loc['jan'])
elif ch==2:
print(df.loc['feb'])
elif ch==3:
print(df.loc['mar'])
elif ch==4:
print(df.loc['apr'])
elif ch==5:
print(df.loc['may'])
elif ch==6:
print(df.loc['june'])
elif ch==7:
print(df.loc['july'])
elif ch==8:
print(df.loc['aug'])
elif ch==9:
print(df.loc['sept'])
elif ch==10:
print(df.loc['oct'])
elif ch==11:
print(df.loc['nov'])
elif ch==12:
print(df.loc['dec'])
else:
print('enter the valid CHOICE')

def opt_4():
print()
month=df['month']
a=df['duronto exp']
b=df['adi-puri exp']
c=df['tezas exp']
d=df['maharaja exp']
e=df['shatabdi exp']

print('press 1 to make line graph of reservations in buronto express')


print('press 2 to make line graph of reservations in adipuri express')
print('press 3 to make line graph of reservations in tezas express')
print('press 4 to make line graph of reservations in maharaja express')
print('press 5 to make line graph of reservations in shatabdi express')
ch=int(input('enter your choice-'))

if ch==1:
print()
plt.plot(month,a,color='green')
# plt.xlabel(duronto)
# plt.ylabel(month)
# plt.title(duronto)
plt.show()
elif ch==2:
print()
plt.plot(month,b,color='black')
plt.show()
elif ch==3:
print()
plt.plot(month,c,color='brown')
plt.show()
elif ch==4:
print()
plt.plot(month,d,color='red')
plt.show()
elif ch==5:
print()
plt.plot(month,e,color='blue')
plt.show()
else:
print('invalid choice ')

def opt_5():
print()
month=df['month']
a=df['duronto exp']
b=df['adi-puri exp']
c=df['tezas exp']
d=df['maharaja exp']
e=df['shatabdi exp']

print('press 1 to make bar graph of reservations in buronto express')


print('press 2 to make bar graph of reservations in adipuri express')
print('press 3 to make bar graph of reservations in tezas express')
print('press 4 to make bar graph of reservations in maharaja express')
print('press 5 to make bar graph of reservations in shatabdi express')
ch=int(input('enter your choice-'))

if ch==1:
print()
plt.bar(month,a,color='green')
plt.show()
elif ch==2:
print()
plt.bar(month,b,color='black')
plt.show()
elif ch==3:
print()
plt.bar(month,c,color='brown')
plt.show()
elif ch==4:
print()
plt.bar(month,d,color='red')
plt.show()
elif ch==5:
print()
plt.bar(month,e,color='blue')
plt.show()
else:
print('invalid choice')

def opt_6():
print()
month=df['month']
a=df['duronto exp']
b=df['adi-puri exp']
c=df['tezas exp']
d=df['maharaja exp']
e=df['shatabdi exp']

print('press 1 to make hist graph of reservations in buronto express')


print('press 2 to make hist graph of reservations in adi puri express')
print('press 3 to make hist graph of reservations in tezas express')
print('press 4 to make hist graph of reservations in maharaja express')
print('press 5 to make hist graph of reservations in shatabdi express')
ch=int(input('enter your choice-'))

if ch==1:
print()
plt.hist(a,color='green')
plt.show()
elif ch==2:
print()
plt.hist(b,color='black')
plt.show()
elif ch==3:
print()
plt.hist(c,color='brown')
plt.show()
elif ch==4:
print()
plt.hist(d,color='red')
plt.show()
elif ch==5:
print()
plt.hist(e,color='blue')
plt.show()
else:
print('invalid choice ')

ch=int(input('enter choice'))
if ch==1:
print()
print(opt_1())
elif ch==2:
print()
print(opt_2())
elif ch==3:
print()
print(opt_3())
elif ch==4:
print()
print(opt_4())
elif ch==5:
print()
print(opt_5())
elif ch==6:
print()
print(opt_6())
else:
print('invalid choice ')

You might also like