{"id":27241,"library":"polars-ds","title":"Polars-ds","description":"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.","status":"active","version":"0.11.2","language":"python","source_language":"en","source_url":"https://github.com/abstractqqq/polars_ds","tags":["polars","extension","data-science","graph","linear-algebra"],"install":[{"cmd":"pip install polars-ds","lang":"bash","label":"Latest version"}],"dependencies":[{"reason":"Core dependency, polars-ds extends Polars","package":"polars","optional":false}],"imports":[{"note":"polars-ds extends Polars' DataFrame; no separate imports needed","wrong":null,"symbol":"DataFrame","correct":"import polars as pl"},{"note":"Main public API for graph functionality","wrong":null,"symbol":"Graph","correct":"from polars_ds.graph import Graph"},{"note":"polars_ds itself does not export ext; must explicitly import polars_ds.ext to use extra expressions","wrong":"import polars_ds","symbol":"ext","correct":"import polars_ds.ext"}],"quickstart":{"code":"import polars as pl\nimport polars_ds.ext as pds\ndf = pl.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6]})\nresult = df.select(pds.col('a').l1_normalize())\nprint(result)","lang":"python","description":"Compute L1 normalization on column 'a' using polars-ds extended expressions."},"warnings":[{"fix":"Add 'import polars_ds.ext' to your code.","message":"polars_ds.ext must be imported explicitly to use expression extensions; just importing polars_ds does not register them.","severity":"gotcha","affected_versions":"all"},{"fix":"Update to use new expression-based API; refer to migration guide in docs.","message":"The '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.","severity":"deprecated","affected_versions":"<0.9.0"},{"fix":"Change import to 'import polars_ds.ext as pds'.","message":"In 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'.","severity":"breaking","affected_versions":">=0.10.0"},{"fix":"Upgrade Polars: pip install 'polars>=0.20.0'","message":"polars-ds requires Polars 0.20.x or newer; using older Polars leads to import errors or missing symbols.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use: from polars_ds.graph import Graph","cause":"Graph is in submodule polars_ds.graph, not top-level.","error":"ImportError: cannot import name 'Graph' from 'polars_ds'"},{"fix":"Add 'import polars_ds.ext' before using extension expressions.","cause":"Did not import polars_ds.ext before calling extension methods.","error":"AttributeError: 'Expr' object has no attribute 'l1_normalize'"},{"fix":"Either use pds.col('a').l1_normalize() after importing polars_ds.ext, or apply via df.select(pds.col('a').l1_normalize()).","cause":"Incorrect syntax: tried to call extension method directly on column, e.g., pl.col('a').l1_normalize() without importing ext.","error":"TypeError: 'Expr' object is not callable"},{"fix":"Run: pip install polars-ds","cause":"Library not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'polars_ds'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}