I'm trying to use the 0th column ("Gene.name") as the Index values. Here's the original data below:
I tried to set the index a few different ways. The first was using index_col=0
in the DataFrame
creation. I also tried DF_mutations.index = DF_mutations["Gene.name"]
but they both led to an empty row underneath the header show below:
How can I get rid of this extra row when I'm reassigning the index values?
The empty row in the print you see is because the
index
has a name -Gene.name
(This is not a real row in the DataFrame though) . If you don't want that row , I believe you would need to do away with the name. Example -Demo -