Importing from python output to excel

A doubt, what’s the procedure to import python data to excel? cuz i want the output to be tabulated.

Are you asking about how to take data from within python and import it into excel?
If so, you can use the csv library or pandas library to write data into a format that you can open with excel.

The csv.writer() object can write data with a parameter dialect="excel", and pandas dataframes have the method df.to_excel(). I find these to be the easiest methods for getting data I’ve scrounged up in python into Excel.

Lastly, there is the openpyxl library for both reading and writing excel files. I don’t use it often but it’s great when I occasionally need to do more in-depth manipulation of already existing Excel files with multiple sheets and whatnot.

If on the other hand, your question is regarding running python code from Excel, I would check out the xlwings package.

thanks a lot for the help.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.