Table of Contents

NumPy-shaped arrays for .NET

NumSharp

A .NET port of NumPy focused on API parity, unmanaged NDArray storage, view semantics, broadcasting, and runtime-generated SIMD kernels.

Install and run

Start from familiar NumPy-style calls in ordinary C#.

dotnet add package NumSharp
using NumSharp;
var a = np.array(new[] { 1, 2, 3, 4, 5 });
var b = np.arange(5);
Console.WriteLine(a + b);  // [1 3 5 7 9]
NumPy 2.x Compatibility target
15 Core dtypes
V128-V512 Runtime SIMD width
Views Slicing shares memory

Documentation Map

Pick the part of the stack you are working on.

What NumSharp Optimizes For

Behavior first, with fast paths where the layout and dtype make them possible.

NumPy-shaped API

Creation, indexing, broadcasting, math, reductions, random sampling, and file I/O use familiar NumPy names and behavior.

Unmanaged storage

Arrays use raw storage behind shape and stride metadata, so views and kernels can operate close to the metal.

Runtime specialization

Elementwise, cast, reduction, scan, and selection paths emit dtype-specific IL and cache the compiled delegates.

Release-tracked performance

The benchmark dashboard publishes stable history snapshots, not one-off scratch output.