Registry / data / polars-ds

polars-ds

JSON →
library0.11.2pypypi✓ verified 86d ago

A Python extension for Polars that adds extra data structures and algorithms (e.g., graph, set operations, linear algebra) as expressions and series. Version 0.11.2, released on PyPI, actively maintained with frequent updates.

pip install polars-ds
INSTALL
IMPORT
SIG · POLARS-DS
P
polars-ds
datapythonv0.11.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DataFrame
import polars as pl
polars-ds extends Polars' DataFrame; no separate imports needed
Graph
from polars_ds.graph import Graph
Main public API for graph functionality
ext
import polars_ds.ext
import polars_ds
polars_ds itself does not export ext; must explicitly import polars_ds.ext to use extra expressions

Compute L1 normalization on column 'a' using polars-ds extended expressions.

import polars as pl import polars_ds.ext as pds df = pl.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6]}) result = df.select(pds.col('a').l1_normalize()) print(result)
Debug
Known issues
gotchapolars_ds.ext must be imported explicitly to use expression extensions; just importing polars_ds does not register them.
fix
Add 'import polars_ds.ext' to your code.
affects: all
deprecatedThe 'polars_ds.graph.Graph' class API changed in v0.9.0; old methods like 'graph.nodes()' now return a Polars expression instead of a list.
fix
Update to use new expression-based API; refer to migration guide in docs.
affects: <0.9.0
breakingIn v0.10.0, 'polars_ds.ext' moved from a module to a subpackage; imports like 'from polars_ds.ext import l1_normalize' no longer work. Use 'import polars_ds.ext as pds' then 'pds.l1_normalize'.
fix
Change import to 'import polars_ds.ext as pds'.
affects: >=0.10.0
gotchapolars-ds requires Polars 0.20.x or newer; using older Polars leads to import errors or missing symbols.
fix
Upgrade Polars: pip install 'polars>=0.20.0'
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'Graph' from 'polars_ds'
Graph is in submodule polars_ds.graph, not top-level.
fix
Use: from polars_ds.graph import Graph
AttributeError: 'Expr' object has no attribute 'l1_normalize'
Did not import polars_ds.ext before calling extension methods.
fix
Add 'import polars_ds.ext' before using extension expressions.
TypeError: 'Expr' object is not callable
Incorrect syntax: tried to call extension method directly on column, e.g., pl.col('a').l1_normalize() without importing ext.
fix
Either use pds.col('a').l1_normalize() after importing polars_ds.ext, or apply via df.select(pds.col('a').l1_normalize()).
ModuleNotFoundError: No module named 'polars_ds'
Library not installed or installed in wrong environment.
fix
Run: pip install polars-ds
Upgrade
Version history
0.11.2latest on PyPI · released Apr 30, 2026
Audit
Dependencies
polarsrequiredCore dependency, polars-ds extends Polars
Agent activity
4 hits · last 30 days
node
4
Resources
polars-ds — pip install polars-ds · libregistry