Narwhals is a library that provides a Polars-like API and serves as a compatibility layer between different DataFrame libraries.
🟢 How Narwhals helps?
It allows writing one set of logic that runs natively on input data backend and returns same type of DataFrame that was input.
It doesn't constantly convert tables into one central format, it wraps/translates calls into the native backend API to keep computations "native" (i.e., avoid expensive conversions). This reduces overhead and preserves performance.
- Supports pandas index, even though other backends do not have it at all.
- Has lazy computations for those who love optimization and deferred execution.
As a result, we get the ability to write libraries and utilities without worrying about which tabular backend team uses. This advantage is already used by popular projects such as Plotly, Bokeh and Darts.
🤖 Data Science, ML & Big Data with @DataXplore
