Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
in Python by (19.9k points)

I have this Employee data.frame:

    Names    Designation

0    Raj         CTO

1   Rohit       Developer

2    Sam         CFO

3    Ane         CEO

I would want to print this data.frame without the index values, how can i do it?

1 Answer

0 votes
by (25.1k points)

Pandas does come with a mechanism to do this. In case you wish to perform string manipulations yourself and build the output you can do it. However it is much easier and prefereable to use the inbuilt method.

You can simply use the to_string method with index passed as False.

Here is the code:

print(Employee.to_string(index=False))

You can learn more about pandas in depth by watching this youtube video:

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...