I want to output dataframe to an XML

Hello,

I am trying to write a dataframe to an xml file. The xml file is excel like XML file, I have tried using the “xml.etree.ElementTree” library, and I also asked ChatGPT, however I got nowhere. Can you guy help? please let me know if you need more clarification.

Thanks

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_excel.html

You’ll need openpyxl installed.

I got openpyxl installed, and I used it to write to excel for now