Home > Net >  How to open excel file in Polars dataframe?
How to open excel file in Polars dataframe?

Time:03-29

I am a python pandas user but recently found about polars dataframe and it seems quite promising and blazingly fast. I am not able to find a way to open an excel file in polars. Polars is happily reading csv, json, etc. but not excel.

I am extensive user of excel files in pandas and I want to try using polars. I have many sheets in excel that pandas automatically read. How can I do same with polars?

What am I missing?

CodePudding user response:

This is more of a workaround than a real answer, but you can read it into pandas and then convert it to a polars dataframe.

import polars as pl
import pandas as pd
df = pd.read_excel(...)
df_pl = pl.DataFrame(df)

You could, however, make a feature request to the Apache Arrow community to support excel files.

  • Related