# NumSharp >
## Installation ```bash dotnet add package NumSharp ``` ## Quick Start ```csharp using NumSharp; var a = np.array(new[] { 1, 2, 3, 4, 5 }); var b = np.zeros((3, 4)); var result = np.sum(a); var slice = a["1:4"]; // Slicing returns views ``` ## Documentation - [NumSharp's ndarray is NDArray!](https://scisharp.github.io/NumSharp/docs/NDArray.html): NumPy's central type is numpy.ndarray. NumSharp's is NDArray. If you know one, you know the other — same concept, same memory model, same semantics, same operator behavior, ported to .NET idioms. Th - [NDIter — kerneling your NDArray with IL generation](https://scisharp.github.io/NumSharp/docs/NDIter.html): NumPy's NpyIter is one of the core schedulers behind ufuncs, reductions, broadcasting, and advanced iteration. It decides which axes to walk, which axes can coalesce, whether operands need buffers, an - [Python Array API Standard](https://scisharp.github.io/NumSharp/docs/array-api-standard.html): If you've ever tried to write code that works with NumPy, PyTorch, JAX, and CuPy, you know the pain. They all do similar things, but the APIs are just different enough that your code breaks when you s - [](https://scisharp.github.io/NumSharp/docs/benchmarks-dashboard.html): - [Broadcasting](https://scisharp.github.io/NumSharp/docs/broadcasting.html): Broadcasting allows arithmetic operations between arrays of different shapes. When you add a (3, 4) matrix to a (4,) vector, NumSharp automatically "broadcasts" the vector across each row—no explici - [Buffering, Arrays and Unmanaged Memory](https://scisharp.github.io/NumSharp/docs/buffering.html): NumSharp stores all array data in unmanaged memory for maximum performance. This design choice—borrowed from NumPy's architecture—enables zero-copy interop with native libraries, efficient memory- - [NumPy Compliance & Compatibility](https://scisharp.github.io/NumSharp/docs/compliance.html): NumSharp's compatibility target is NumPy 2.x, with the implementation and differential-test oracle currently pinned to NumPy 2.4.2. The target is both API compatibility and behavioral - [NumPy API Coverage & Support](https://scisharp.github.io/NumSharp/docs/coverage-support-dashboard.html): - [Dtypes in NumSharp](https://scisharp.github.io/NumSharp/docs/dtypes.html): Every array in NumSharp has a dtype—a data type that determines what kind of values the array stores, how many bytes each element takes, and which operations are valid. When you write np.zeros(10, n - [NumSharp Exceptions](https://scisharp.github.io/NumSharp/docs/exceptions.html): NumSharp provides a structured exception hierarchy designed for NumPy compatibility and clear error messages. All exceptions inherit from NumSharpException and follow NumPy's error message format. - [IL Kernel Generation in NumSharp](https://scisharp.github.io/NumSharp/docs/il-generation.html): Most numerical libraries face the same fork in the road: write generic managed loops that are portable but slow, or bind to a native backend that is fast but - [Introduction](https://scisharp.github.io/NumSharp/docs/intro.html): The following pages are for the users who want to use NumSharp. - [NumSharp.Build Compiler — build-time `[NDScoped]` memory reclamation](https://scisharp.github.io/NumSharp/docs/numsharp-build-compiler.html): NumSharp.Build is the optional build-time compiler package that makes a composition method eagerly return its transients' pooled buffers instead of waiting on the finalizer. Mark a method [NDScoped] - [](https://scisharp.github.io/NumSharp/docs/tests-oracle-dashboard.html): ## API Reference - [NumSharp.NDArray](https://scisharp.github.io/NumSharp/api/NumSharp.NDArray.html): Main n-dimensional array type - [NumSharp.np](https://scisharp.github.io/NumSharp/api/NumSharp.np.html): Static NumPy-style API - [NumSharp.Shape](https://scisharp.github.io/NumSharp/api/NumSharp.Shape.html): Array dimensions and strides ## Supported Data Types bool, byte, short, ushort, int, uint, long, ulong, float, double, decimal, char ## Key Concepts - **NDArray**: Multi-dimensional array in unmanaged memory - **Shape**: Dimensions and strides for offset calculation - **Broadcasting**: Arrays with different shapes operate element-wise - **Views**: Slicing returns views (shared memory), use `.copy()` for copies ## Optional - [Full API Reference](https://scisharp.github.io/NumSharp/api/): Complete class and method documentation - [GitHub Repository](https://github.com/SciSharp/NumSharp): Source code and issues - [NuGet Package](https://www.nuget.org/packages/NumSharp): Latest releases