Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I want to get rid of the index column that the Pandas DataFrame prints out in default. Is this possible?

Thank you for your help!

share|improve this question
    
There is no display option I can find that can do this: pandas.pydata.org/pandas-docs/stable/generated/…, you could do print(df.values) but this outputs a numpy array without the column names so not that readable –  EdChum Jul 21 at 8:31

1 Answer 1

up vote 0 down vote accepted

As @EdChum noted, not sure there's any way to do this by default. For display purposes, you could do:

print(df.to_string(index=False))
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.