Published on: 13th September 2022
This post was created while writing my Data Analysis with Polars course. Check it out on Udemy
One thing people ask me about switching from Pandas to Polars is working with 3rd party libraries. What if they don’t support Polars?
Often, however, this isn’t much of an issue…
Take the example below with the NLP library Spacy. Here Spacy takes a column from a Polars dataframe in the same way it would take a column from a Pandas dataframe.
import spacy
nlp = spacy.load("en_core_web_sm")
doc = nlp(df[0,"text"])
spacy.displacy.render(doc, style="ent")
Why does this work so smoothly? Because many libraries aren’t looking for a pandas dataframe column - they just want an iterable. A pandas column is an iterable, but so is a tuple, list or a polars dataframe column.
Want to know more about Polars for high performance data science and ML? Then you can:
or let me know if you would like a Polars workshop for your organisation.