Reputation: 15
What it looks like: https://i.sstatic.net/Kefkf.jpg.
What I need it to look like: https://i.sstatic.net/yEa9Y.jpg
I imported the file as a tsv and converted it into a csv. After doing so, this is how I imported my data train = pd.read_csv('./gene_train.csv', sep ='\t')
train.shape
Upvotes: 0
Views: 1307
Reputation: 7211
You did not show how your dataframe looks like. But in general, you can get a list of all column names of a dataframe by
colnames = list(train.columns)
and now you said it is shifted by +1 to the right. I assume it means data of column 1 should match colnames[2]
. So you can re-assign the column name by:
train.columns = colnames[1:]
but, in this way, you will miss the "rightmost" or last column and you have to fix that.
Upvotes: 1