Polars.NET.Core 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Polars.NET.Core --version 1.0.0
                    
NuGet\Install-Package Polars.NET.Core -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Polars.NET.Core" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Polars.NET.Core" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Polars.NET.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Polars.NET.Core --version 1.0.0
                    
#r "nuget: Polars.NET.Core, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Polars.NET.Core@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Polars.NET.Core&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Polars.NET.Core&version=1.0.0
                    
Install as a Cake Tool

<div align="center"> <img src="assets/logo.svg" width="160" height="160" alt="Polars.NET Logo" /> <h1>Polars.NET</h1> <p><b>Blazingly Fast, Vectorized DataFrames & LINQ Engine for .NET</b></p> <p><i>Powered by Rust Polars & Apache Arrow with zero-copy interoperability, native expression compilation, and full cloud lakehouse support.</i></p>

<p> <a href="https://www.nuget.org/packages/Polars.NET"><img src="https://img.shields.io/nuget/v/Polars.NET.svg" alt="NuGet Polars.NET" /></a> <a href="https://www.nuget.org/packages/Polars.FSharp"><img src="https://img.shields.io/nuget/v/Polars.FSharp.svg" alt="NuGet Polars.FSharp" /></a> <a href="https://www.nuget.org/packages/Polars.NET"><img src="https://img.shields.io/nuget/dt/Polars.NET.svg" alt="NuGet Downloads" /></a> <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="License" /></a> <a href="https://errorlsc.github.io/Polars.NET/"><img src="https://img.shields.io/badge/docs-online-512BD4.svg?style=flat-square&logo=read-the-docs&logoColor=white" alt="Documentation" /></a> </p>

<p> <a href="https://errorlsc.github.io/Polars.NET/"><b>Documentation Website</b></a> | <a href="https://errorlsc.github.io/Polars.NET/articles/quickstart"><b>Quick Start</b></a> | <a href="https://errorlsc.github.io/Polars.NET/articles/linq"><b>LINQ Guide</b></a> | <a href="https://errorlsc.github.io/Polars.NET/api/csharp_generated/DataFrame"><b>C# API</b></a> | <a href="https://errorlsc.github.io/Polars.NET/api/fsharp_generated/pl"><b>F# API</b></a> | <a href="https://errorlsc.github.io/Polars.NET/llms.txt"><b>llms.txt</b></a> | <a href="https://github.com/ErrorLSC/Polars.NET-Cookbook"><b>Cookbook</b></a> </p> </div>


Highlights

  • 100% Native Pushdown LINQ: Translates C# IQueryable<T> and F# query { } computation expressions directly into native Rust LazyFrame physical plans. Zero intermediate .NET row object allocations on fully pushed down queries. Passed all TPC-H queries test for both C# and F#.
  • Blazing Fast SIMD & Multithreading: Vectorized query execution backed by the Rust Polars engine, delivering 10x-50x speedups over legacy .NET data processing frameworks.
  • Truly Idiomatic .NET Experience: Ingest collections directly via DataFrame.FromRows(list), pipe database streams using reader.AsPolarsQueryable<T>(), perform ANSI SQL Merge on List<T>, and enumerate rows via zero-GC stack-allocated ref struct cursors.
  • Seamless In-Memory Interop: LINQ queries can directly .Join(), .Concat(), or .Union() an arbitrary in-memory List<T> against a high-volume DataFrame query with automatic native Arrow transposition.
  • Enterprise Lakehouse & Arrow: Zero-copy Apache Arrow C Data Interface, streaming ADO.NET IDataReader, Delta Lake ACID transactions with full time-travel, and cloud object store integration (Amazon S3, Azure Blob, Google Cloud Storage).

Installation

Polars.NET targets .NET 8.0+ and requires referencing both the managed API package and the matching native runtime package for your execution platform:

C# Users

# Core API package
dotnet add package Polars.NET

# Platform native runtime (choose matching your deployment target):
dotnet add package Polars.NET.Native.win-x64
# dotnet add package Polars.NET.Native.linux-x64
# dotnet add package Polars.NET.Native.linux-arm64
# dotnet add package Polars.NET.Native.osx-arm64

# Optional: LINQ expression tree compiler
dotnet add package Polars.NET.Linq

# Optional: ML.NET integration
dotnet add package Polars.NET.ML

F# Users

# F# idiomatic API package
dotnet add package Polars.FSharp

# Platform native runtime:
dotnet add package Polars.NET.Native.win-x64

# Optional: F# Query CE & LINQ integration
dotnet add package Polars.NET.Linq

Quick Tour

1. C# LINQ Query (IQueryable<T>)

Write standard C# LINQ queries that compile directly into Rust SIMD kernels without hydrating managed objects:

using Polars;
using Polars.CSharp;
using Polars.CSharp.Linq;

public record Order(int Id, string Customer, string Region, double Revenue);

List<Order> orders = GetOrders();

// 1. Direct entry from in-memory collection, DataFrame, or ADO.NET IDataReader:
var query = from o in orders.AsPolarsQueryable()
            where o.Revenue >= 500.0 && o.Region != "Test"
            group o by o.Region into g
            select new {
                Region = g.Key,
                TotalRevenue = g.Sum(x => x.Revenue),
                OrderCount = g.Count()
            };

// 2. Materialize directly into a Polars DataFrame (Zero heap allocations):
using DataFrame resultDf = query.ToDataFrame();
resultDf.Show();

// 3. Or inspect the compiled native plan:
Console.WriteLine(query.Explain());

2. C# Vectorized Expressions (LazyFrame & Pl.Col)

Harness the full power of the Polars DSL for complex analytics, column expressions, and Selectors:

using Polars.CSharp;
using Pl = Polars.CSharp.Polars;
using Cs = Polars.CSharp.Polars.Selectors;

// Read high-throughput Parquet lazily:
using var lf = LazyFrame.ScanParquet("orders/*.parquet");

using var summaryDf = lf
    .Filter(Pl.Col("order_date") >= new DateOnly(2025, 1, 1))
    .GroupBy("region")
    .Agg(
        Pl.Col("revenue").Sum().Alias("total_revenue"),
        Pl.Col("customer_id").NUnique().Alias("unique_customers"),
        Cs.Numeric().Mean().Prefix("avg_")
    )
    .Sort("total_revenue", descending: true)
    .Collect();

summaryDf.Show();

3. F# Query Computation Expression

Leverage F# strong typing, anonymous records, and pipeline combinators over native queries:

open Polars.FSharp
open Polars.FSharp.Query

// F# query { } compiles into native Rust DAG:
let summaryQuery =
    query {
        for o in df.AsQueryable<Order>() do
        where (o.Revenue >= 500.0 && o.Region <> "Test")
        groupValBy o o.Region into g
        select {|
            Region = g.Key
            TotalRevenue = g.Sum(fun x -> x.Revenue)
            OrderCount = g.Count()
        |}
    }

use resultDf = summaryQuery.ToDataFrame()
resultDf.Show()

4. Polars.NET Exclusive: Strongly-Typed SQL Merge

Perform complete ANSI SQL MERGE upsert operations directly on DataFrames or in-memory collections:

List<ProductItem> inMemoryTarget = GetTargetProducts();
List<ProductItem> incomingUpdates = GetSourceProducts();

// Start merge directly from an in-memory List<T>:
using DataFrame mergedDf = inMemoryTarget.Merge(incomingUpdates, t => t.Id, s => s.Id)
    .WhenMatched(
        (t, s) => s.Price > t.Price,
        then => then.Update(set => set.Set(t => t.Price, (t, s) => s.Price))
    )
    .WhenNotMatchedByTarget(then => then.Insert())
    .WhenNotMatchedBySource(t => t.Category == "Seasonal", then => then.Delete())
    .ToDataFrame(); // Or materialize directly to List<ProductItem> via .ToList()

Documentation & Guides

Comprehensive documentation, architecture references, and API catalogs are available on our documentation portal:

Topic Documentation Guide Description
Quick Start Quick Start Guide 5-minute setup, core operations, and data ingestion
LINQ Provider LINQ & Query CE 3-tier compiler, BCL mappings, and pushdown architecture
Expressions Expressions & Column Ops Vectorized computations, string, date/time, and math functions
Lazy Execution LazyFrame & Streaming Predicate pushdown, projection pruning, and streaming engine
Lakehouse Delta Lake & ACID Storage Parquet scanning, Delta ACID transactions, and time-travel
Time Series Time Series & Analytics Dynamic groupby, rolling windows, and interpolation
Ecosystem Ecosystem & Native Interop Apache Arrow, ADO.NET, ML.NET, Tensor, and Spans
C# Idioms Idiomatic C# Practices SafeHandles, collection expressions, and fast-path row cursors
F# Idioms Idiomatic F# Practices Zero-allocation struct enumerators, modules, and pipeline operators
AI / LLMs llms.txt Curated context and anti-hallucination guardrails for LLM agents

Architecture at a Glance

Polars.NET uses a modular three-tier architecture to deliver native speed without sacrificing .NET safety:

+-------------------------------------------------------------------+
|                     User Application Layer                        |
|   C# LINQ (IQueryable<T>)  |  C# Fluent DSL  |  F# Query CE / FP  |
+-------------------------------------------------------------------+
                                  |
                                  v
+-------------------------------------------------------------------+
|               Polars.NET High-Level Managed Layer                 |
|   - Polars.CSharp (DataFrame, LazyFrame, Series, Expr, Selectors) |
|   - Polars.FSharp (Idiomatic modules, struct enumerators)         |
|   - Polars.NET.Linq (Expression tree compiler & plan generator)   |
+-------------------------------------------------------------------+
                                  |
                                  v
+-------------------------------------------------------------------+
|              Polars.NET.Core (FFI & Interop Layer)                |
|   - SafeHandle lifetime management (Zero-leak guarantee)          |
|   - Apache Arrow C Data Interface zero-copy bridge                |
|   - P/Invoke bindings & NativeShim library loaders                |
+-------------------------------------------------------------------+
                                  |
                                  v
+-------------------------------------------------------------------+
|                 Rust Polars Native Engine                         |
|   - Multithreaded chunked execution engine                        |
|   - SIMD vectorization & memory-mapped I/O                        |
|   - Physical query planner, optimizer & streaming sink            |
+-------------------------------------------------------------------+

Benchmarks

Polars.NET brings the blazing performance of Rust Polars directly to the .NET ecosystem:

<div align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="assets/benchmark_summary_dark.png"> <img alt="Speedup Summary vs Legacy .NET" src="assets/benchmark_summary_light.png" width="750" /> </picture> </div>


Acknowledgements

Polars.NET stands on the shoulders of giants:

  • Polars (pola.rs) - The lightning-fast DataFrame library developed by Ritchie Vink and the Polars team.
  • Apache Arrow - The columnar in-memory data standard powering zero-copy interop.

License

MIT License. See LICENSE for details.
Third-party licenses and notices are documented in THIRD_PARTY_LICENSES.html.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on Polars.NET.Core:

Package Downloads
Polars.NET

A blazing fast DataFrame library for .NET, powered by the Rust Polars engine and Apache Arrow. Features multi-threaded query execution, lazy evaluation, and data extraction into modern .NET Tensors (ReadOnlyTensorSpan) for hardware-accelerated SIMD math and AI inference.

Polars.FSharp

Idiomatic F# API for Polars DataFrame library with strict type safety and pipeline support.

Polars.NET.Linq

LINQ Translation Engine for Polars.NET and Polars.FSharp. Write strong-typed C#/F# queries and execute them at native speed

Polars.NET.ML

The Machine Learning extension for Polars.NET. This package provides high-speed data bridges between Polars DataFrames, Apache Arrow memory, ML.NET (IDataView). Unlock hardware-accelerated SIMD math, train classic ML models, and seamlessly integrate with deep learning pipelines (ONNX).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 137 10/26/2026
1.0.0 189 10/24/2026
0.7.0 2,316 8/8/2026
0.6.0 881 6/9/2026
0.5.0 232 5/26/2026
0.4.0 2,938 3/20/2026
0.3.1 293 2/28/2026
0.3.0 517 2/26/2026
0.2.1-beta1 726 2/6/2026
0.2.0-beta1 248 2/4/2026
0.1.0-beta1 199 1/14/2026
0.1.0-alpha2 179 1/10/2026
0.1.0-alpha1 174 1/4/2026