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]
Documentation Map
Pick the part of the stack you are working on.
Shape, strides, storage, indexing, and the mental model for NumSharp arrays.
Semantics BroadcastingHow NumSharp stretches operands without materializing repeated data.
Kernels NDIterThe iterator layer that schedules strided, buffered, and fused inner loops.
Runtime compiler IL GenerationDynamicMethod kernels, SIMD paths, cache families, and generator ownership.
Parity NumPy complianceCompatibility notes, behavioral scope, and areas still being tightened.
Performance BenchmarksCurrent NumSharp-vs-NumPy results with drill-down reports by subsystem.
What NumSharp Optimizes For
Behavior first, with fast paths where the layout and dtype make them possible.
Creation, indexing, broadcasting, math, reductions, random sampling, and file I/O use familiar NumPy names and behavior.
Arrays use raw storage behind shape and stride metadata, so views and kernels can operate close to the metal.
Elementwise, cast, reduction, scan, and selection paths emit dtype-specific IL and cache the compiled delegates.
The benchmark dashboard publishes stable history snapshots, not one-off scratch output.