kalapangha
kalapangha

Reputation: 21

How to get rid of the index column name in a Pandas dataframe?

The column header used to be on the row index #2. When I converted the row to the header, number 2 is followed.

I haver tried reset_index and index.rename but they don't seem to get rid of number 2. Please help. Thanks!

2 Date Customer Product
3 10-Jan Tony Rubber
4 10-Jan Mary Paper
5 11-Jan Jane TV

Upvotes: 1

Views: 856

Answers (1)

DapperDuck
DapperDuck

Reputation: 2859

You can use rename_axis(). The docs state that you can use the method to rename axis columns or indexes. For your program, use:

df.rename_axis(columns=None)

Upvotes: 2

Related Questions