Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read XLSB File in Pandas Python

Tags:

python

pandas

There are many questions on this, but there has been no simple answer on how to read an xlsb file into pandas. Is there an easy way to do this?

like image 861
Gayatri Avatar asked Jul 10 '17 19:07

Gayatri


People also ask

Can pandas open XLSB?

Read an Excel file into a pandas DataFrame. Supports xls , xlsx , xlsm , xlsb , odf , ods and odt file extensions read from a local filesystem or URL.

How do I view XLSB files?

You can open XLSB files with Microsoft Excel in Windows and macOS. You can also open XLSB files with OpenOffice Calc (multiplatform). However, Excel is the best option for opening XLSB files because it fully supports the formatting of Excel spreadsheets, which may include graphs and the spacing of data fields.

How do I view Excel files in pandas?

We can use the pandas module read_excel() function to read the excel file data into a DataFrame object. If you look at an excel sheet, it's a two-dimensional table. The DataFrame object also represents a two-dimensional tabular data structure.


1 Answers

With the 1.0.0 release of pandas - January 29, 2020, support for binary Excel files was added.

import pandas as pd df = pd.read_excel('path_to_file.xlsb', engine='pyxlsb') 

Notes:

  • You will need to upgrade pandas - pip install pandas --upgrade
  • You will need to install pyxlsb - pip install pyxlsb
like image 154
Glen Thompson Avatar answered Oct 01 '22 09:10

Glen Thompson