The empty line in the printout that you see is that index has a name - Gene.name (however, this is not a real line in the DataFrame). If you do not want this line, I believe that you will need to end this name. Example -
df.index.name = None
Demo -
In [6]: df = pd.DataFrame([[1,2,3,4],[1,2,3,4]]).set_index(0) In [7]: df Out[7]: 1 2 3 0 <-------------------------- Name of the index for this DataFrame 1 2 3 4 1 2 3 4 In [10]: df.index.name=None In [11]: df Out[11]: 1 2 3 1 2 3 4 1 2 3 4
source share