Skip to content

nodejs-polars-v0.10.0

Compare
Choose a tag to compare
@universalmind303 universalmind303 released this 20 Mar 18:42
· 76 commits to main since this release
16aed5d

Highlights

New support for polars sql πŸŽ‰

import pl from "nodejs-polars"

const df = pl.DataFrame({
    title: ["The Godfather", "The Dark Knight", "Schindler's List", "Pulp Fiction", "The Shawshank Redemption"],
    release_year: [1972, 2008, 1993, 1994, 1994],
    budget: [6000000, 185000000, 22000000, 8000000, 25000000],
    gross: [134821952, 533316061, 96067179, 107930000, 28341469],
    imdb_score: [9.2, 9.0, 8.9, 8.9, 9.3]
});

const ctx = pl.SQLContext({ films: df });

// Execute a SQL query against the registered frame data
const result = ctx.execute(`
    SELECT title, release_year, imdb_score
    FROM films
    WHERE release_year > 1990
    ORDER BY imdb_score DESC
`, { eager: true });

console.log(result);

>>> shape: (4, 3)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ title                    ┆ release_year ┆ imdb_score β”‚
β”‚ ---                      ┆ ---          ┆ ---        β”‚
β”‚ str                      ┆ f64          ┆ f64        β”‚
β•žβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•ͺ══════════════β•ͺ════════════║
β”‚ The Shawshank Redemption ┆ 1994.0       ┆ 9.3        β”‚
β”‚ The Dark Knight          ┆ 2008.0       ┆ 9.0        β”‚
β”‚ Schindler's List         ┆ 1993.0       ┆ 8.9        β”‚
β”‚ Pulp Fiction             ┆ 1994.0       ┆ 8.9        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

What's Changed

Full Changelog: nodejs-polars-v0.9.0...nodejs-polars-v0.10.0