question

Upvote
Accepted
22 3 4 7

Downloading Python List to Excel File

Hi Developers! I have a Python List with Time Series Data of 15 Currency Pairs. I would like to download this list into an Excel file. I am working in the Code Book Environment. Is there a solution?


1661344785152.png

pythonexcelDownload
1661344785152.png (109.9 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
1.3k 3 2 4

Hi @levente.letenyei ,

To write Python list into Excel file, you can:

  1. save in csv file: https://www.geeksforgeeks.org/python-save-list-to-csv/ with csv module
  2. or directly in a xlsx file with ExcelWriter function from pandas lib

Once the file was created in your CodeBook environment, then you can download it from CodeBook on your machine:

1661347412429.png



1661347412429.png (116.9 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thank you very much! You saved my life!
Upvotes
1 0 0 0

Hi, @pf is there a way to create the CSV file, without defining every row? I am trying to create a csv for excel from the codebook. The populated table is 14182 rows x 2 Columns.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

If you want to create a CSV file based on a Dataframe, the easiest way is Dataframe.to_csv function.

Example : https://www.geeksforgeeks.org/how-to-export-pandas-dataframe-to-a-csv-file/

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.