Skip to content
Advertisement

Best way in Pandas to put two lists into a Dataframe and add each list to a separate Excel column

Presently, I have code that creates a new Pandas Dataframe per list and then prints each list to its own column in Excel.

What would be the way to combine the lists into a single Dataframe and then add each list to its own Excel column?

Code

JavaScript

Advertisement

Answer

This should work. Make sure to install required deps (pip install xlwt).

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement