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>

<p>Add a print statement: <code>print(df.head())</code> . If you are looking for a nicer display you can have a look at <a href="https://docs.python.org/2/library/pprint.html" rel="nofollow"><code>pprint</code></a>.</p>

python pandas head