How to Create an Excel File with Python

Organize your data into rows and columns and export to a Common-separated Values (CSV) file

Vinicius Monteiro
Programming For Beginners

--

Photo by Stephanie Klepacki on Unsplash

This short tutorial shows how to create a data frame (rows and columns format) using Python and the Pandas tool.

pandas is a fast, powerful, flexible and easy to use open source data analysis and manipulation tool,
built on top of the Python programming language.”

I’m only touching the tip (of the tip) of the iceberg of what Pandas tool is capable of.

I then teach how to export the data frame to a Common-separated Values (CSV) file. CSV files can be opened with programs such as Microsoft Excel.

Rows and Columns Creation

Before exporting to a CSV file, you create a data frame. A data frame is a two-dimensional data structure. It matches the format that programs like Excel expect.

On a side note, look at the example in the code. If you’re into Basketball, a great way to…

--

--