[Python] Multiple header in Pandas DataFrame to_excel

Discussão em 'Python' iniciado por Stack, Julho 30, 2025.

  1. Stack

    Stack Membro Participativo

    I need to export my DataFrame to Excel. Everything is good but I need two "rows" of headers in my output file. That mean I need two columns headers. I don't know how to export it and make double headers in DataFrame. My DataFrame is created with dictionary but I need to add extra header above.

    I tried few dumb things but nothing gave me a good result. I want to have on first level header for every three columns and on second level header for each column. They must be different.

    I expect output with two headers above columns.

    Continue reading...

Compartilhe esta Página