Recep Durgut
Recep Durgut

Reputation: 11

Pandas changing the first column

Hello, as you see here i have a csv file. The problem is first column (leftmost) does not begin with 1 but it is like the column "gene". How can i fix it? I want that starts with 1 and go to end of the list.

Upvotes: 0

Views: 136

Answers (1)

Thanabhas
Thanabhas

Reputation: 67

Did you do this?

import pandas as pd

pd.read_csv('your_file.csv', index_col='Gene') 

Just remove index_col and it should, by default, create a new index column.

Upvotes: 1

Related Questions