Excel, a component of the Microsoft Office pack, is one of the popular formats in which data is stored and visualized. Since 2010, Office has supported the .xlsx format. We can read XLSX files using the OpenPyXl and pandas functions.
XLSX format
Using OpenPyXl for XLSX files
OpenPyXl is a Python library for reading and writing Excel files. It is an open source project. A new workbook is created using the following command:
wb = Workbook()
We can access the currently active sheet by using the following command:
ws = wb.active()
To change the sheet name, use the title command:
ws.title = "Demo Name"
A single row can be added to the sheet using the append method:
ws.append()
A new sheet can be created using the create_sheet...