Q:

Dataframe with row gaps to excel

How can I put this dataframe here into an excel file?
Tracker P10-MOT-1-1-01  -29.99         119
                        -29.990124     176
                        -38.38          17
                        -59.98        1217
                        -59.980247     247
                        0.0            564
                        52.67           11
                        59.98         1253
                        59.980247      271
Tracker P10-MOT-1-1-05  -29.99         100
                        -29.990124     168
                        -59.98        1228
                        -59.980247     243
                        0.0            554
                        52.67           11
                        59.98         1250
                        59.980247      270
Tracker P10-MOT-1-1-08  -29.99         358
                        -29.990124     182
                        -59.98        1193
                        -59.980247     246
                        0.0            568
                        52.67           11
                        59.98         1244
                        59.980247      271
Tracker P10-MOT-1-1-11  -29.99         105
                        -29.990124     172
                        -59.98        1220
                        -59.980247     246
                        0.0            557

I tried .to_clipboard() and the below code but did not succeed.
import xlsxwriter
filename = 'abc.xlsx'
dfs = s.groupby(list(s)).size().loc[lambda x : x>=8]
writer = pd.ExcelWriter(filename,engine='xlsxwriter')
dfs.to_excel(writer, sheet_name="sheet", startrow=0 , startcol=0)
writer.save()

I'd just like to paste it as it is, with 3 columns, but from both methods above I got a completly different thing... Only the first column is correct. Can someone help me?

A:

This worked for me:
with pd.ExcelWriter(filename) as writer:
    df.to_excel(writer, sheet_name='sheet', header=True, index=False)

