pandas python using head() generic function
<p>I am a beginner to python,in our college they assigned a project i.e. to display timetables of our department using pandas python.Iam presenting my program as menu driven program.But the problem is Iam not able to display my timetables in a grid pattern using head() in if else loop..can u let me know where I am i wrong..??
Sample code:</p>

<pre><code>import pandas as pd
import numpy as np

loop=1
while loop==1:
    print('WELCOME TO CBIT')
    print('1.IT 2')
    print('2.EXIT')
    print()
    choice=input('Enter ur choice')
    choice=int(choice)
    if choice==1:
        df=input('tt is')
        df=pd.read_excel('Book1.xlsx')
        df.head()
    elif choice==2:
        loop=0
</code></pre>

<h1>use this code. it will work. before using this code go to command prompt and write execute this command <code>pip install xlrd</code> I am sure it will work.</h1>

<pre><code>import pandas as pd
import numpy as np

loop=1
while loop==1:
    print('WELCOME TO CBIT')
    print('1.IT 2')
    print('2.EXIT')
    choice=int(raw_input('Input:'))
    if choice==1:
        #df=input('tt is')
        df=pd.read_excel('filename.xlsx') #enter file name here
        print(df)
        #df.head()
    elif choice==2:
        loop=0
</code></pre>

python pandas head