polars-splines


Namepolars-splines JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryA polars expression plugin for splines
upload_time2024-01-29 10:54:49
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords splines polars
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Polars splines

An simple [extension plugin](https://github.com/pola-rs/pyo3-polars) for [py-polars](https://github.com/pola-rs/polars), that interfaces with the Rust cargo [splines](https://crates.io/crates/splines), for spline interpolation.

## Usage

The expression plugin adds `splines` to the expression namespace. This contains the method `spline` which acts on a `Series` of `Struct` type. The two fields corresponds to the (x, y) pairs to be interpolated. The `spline` method accepts a keyword argument `xi` for the interpolation points.

For example,

```python
import polars as pl
import polars_splines
import numpy as np

x = pl.Series("x", np.linspace(0, 1, 100))
y = pl.Series("y", np.sin(x))

df = pl.DataFrame({"x": x, "y": y})

xi = pl.Series("xi", np.linspace(0, 1, 1000))

dfi = df.select(
    pl.struct("x", "y").splines.spline(list(xi), fill_value=0.0).alias("yi")
).with_columns(xi)

```


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "polars-splines",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "splines,polars",
    "author": null,
    "author_email": "Mattias Matthiesen <mattmatthi@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/ef/ac/40cb4b75da553a5060b6390303a372a3c3e42f6d8ac4c6e1cb0bceb6f739/polars_splines-0.1.1.tar.gz",
    "platform": null,
    "description": "# Polars splines\n\nAn simple [extension plugin](https://github.com/pola-rs/pyo3-polars) for [py-polars](https://github.com/pola-rs/polars), that interfaces with the Rust cargo [splines](https://crates.io/crates/splines), for spline interpolation.\n\n## Usage\n\nThe expression plugin adds `splines` to the expression namespace. This contains the method `spline` which acts on a `Series` of `Struct` type. The two fields corresponds to the (x, y) pairs to be interpolated. The `spline` method accepts a keyword argument `xi` for the interpolation points.\n\nFor example,\n\n```python\nimport polars as pl\nimport polars_splines\nimport numpy as np\n\nx = pl.Series(\"x\", np.linspace(0, 1, 100))\ny = pl.Series(\"y\", np.sin(x))\n\ndf = pl.DataFrame({\"x\": x, \"y\": y})\n\nxi = pl.Series(\"xi\", np.linspace(0, 1, 1000))\n\ndfi = df.select(\n    pl.struct(\"x\", \"y\").splines.spline(list(xi), fill_value=0.0).alias(\"yi\")\n).with_columns(xi)\n\n```\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A polars expression plugin for splines",
    "version": "0.1.1",
    "project_urls": null,
    "split_keywords": [
        "splines",
        "polars"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "273cd397b2e1a074b674e46bdbf23a0fa3044a2922e915d653deda862075629f",
                "md5": "2bcab549e082d556a5caa4d12727d518",
                "sha256": "74399541429480c6a4ebb6f812e06959020ed54ca55ba47101ce7ec90eb313cf"
            },
            "downloads": -1,
            "filename": "polars_splines-0.1.1-cp312-cp312-macosx_11_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "2bcab549e082d556a5caa4d12727d518",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": ">=3.10",
            "size": 1766614,
            "upload_time": "2024-01-29T10:54:47",
            "upload_time_iso_8601": "2024-01-29T10:54:47.575479Z",
            "url": "https://files.pythonhosted.org/packages/27/3c/d397b2e1a074b674e46bdbf23a0fa3044a2922e915d653deda862075629f/polars_splines-0.1.1-cp312-cp312-macosx_11_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "efac40cb4b75da553a5060b6390303a372a3c3e42f6d8ac4c6e1cb0bceb6f739",
                "md5": "52abaa1cd4216a1216032d38f9b65c12",
                "sha256": "1164f50e9a0d21ab08325a9ac4745162e9278b28debf006319d22340a437cf09"
            },
            "downloads": -1,
            "filename": "polars_splines-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "52abaa1cd4216a1216032d38f9b65c12",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 13584,
            "upload_time": "2024-01-29T10:54:49",
            "upload_time_iso_8601": "2024-01-29T10:54:49.559218Z",
            "url": "https://files.pythonhosted.org/packages/ef/ac/40cb4b75da553a5060b6390303a372a3c3e42f6d8ac4c6e1cb0bceb6f739/polars_splines-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-29 10:54:49",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "polars-splines"
}
        
Elapsed time: 0.18540s