NumSharp 0.20.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package NumSharp --version 0.20.0
NuGet\Install-Package NumSharp -Version 0.20.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="NumSharp" Version="0.20.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NumSharp --version 0.20.0
#r "nuget: NumSharp, 0.20.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.
// Install NumSharp as a Cake Addin
#addin nuget:?package=NumSharp&version=0.20.0

// Install NumSharp as a Cake Tool
#tool nuget:?package=NumSharp&version=0.20.0

NumSharp

NumPy port in C# .NET Standard<a href="http://scisharpstack.org"><img src="https://github.com/SciSharp/SciSharp/blob/master/art/scisharp_badge.png" width="200" height="200" align="right" /></a>

Join the chat at https://gitter.im/publiclab/publiclab AppVeyor codecov NuGet Badge

Is it difficult to translate python machine learning code into C#? Because too many functions can’t be found in the corresponding code in the .Net SDK. NumSharp is the C# version of NumPy, which is as consistent as possible with the NumPy programming interface, including function names and parameter locations. By introducing the NumSharp tool library, you can easily convert from python code to C# code. Here is a comparison code between NumSharp and NumPy (left is python, right is C#):

comparision

If you want to read some more informations, we start a doc on https://scisharp.github.io/NumSharp/.

NumSharp has implemented the arange, array, max, min, reshape, normalize, unique interfaces. More and more interfaces will be added to the library gradually. If you want to use .NET to get started with machine learning, NumSharp will be your best tool library.

Implemented APIs

The NumPy class is a high-level abstraction of NDArray that allows NumSharp to be used in the same way as Python's NumPy, minimizing API differences caused by programming language features, allowing .NET developers to maximize Utilize a wide range of NumPy code resources to seamlessly translate python code into .NET code.

Check the code: src\NumSharp.Core\APIs

How to use

using NumSharp;
// create a vector
var nd = np.arange(12)

// create a matrix
nd = np.arange(12).reshape(3, 4);

// access data by index
var data = nd[1, 1];

// create a tensor
nd = np.arange(12).reshape(2, 3, 2);

// get the 2nd vector in the 1st dimension
data = n[new Shape(1)];

// get the 3rd vector in the (axis 1, axis 2) dimension
data = n[new Shape(1, 2)];

// interate ndarray
foreach (data in nd)
{
  // data is a ndarray or a value
}

Install NumSharp in NuGet

PM> Install-Package NumSharp

How to make docs

How to run benchmark

C: \> dotnet NumSharp.Benchmark.dll nparange

Reference the documents generated by DocFX.

Reference the documents host on readthedocs.io.

NumSharp is referenced by:

You might also be interested in NumSharp's sister project Numpy.NET.

NumSharp is a member project of SciSharp.org which is the .NET based ecosystem of open-source software for mathematics, science, and engineering. Welcome to fork and pull request to add more APIs, and make reference list longer.

<img src="https://avatars3.githubusercontent.com/u/44989469?s=200&v=4" width="80">

Join us on Gitter

Scan QR code to join TIM group:

SciSharp STACK

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (19)

Showing the top 5 NuGet packages that depend on NumSharp:

Package Downloads
Microsoft.Quantum.Simulators The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Classical simulators of quantum computers for the Q# programming language.

Microsoft.Quantum.Standard The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Microsoft's Quantum standard libraries.

Bigtree.Algorithm

Machine Learning library in .NET Core.

Microsoft.Quantum.Standard.Visualization The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Provides IQ# visualization support for Microsoft's Q# standard libraries.

our1314.work

Package Description

GitHub repositories (9)

Showing the top 5 popular GitHub repositories that depend on NumSharp:

Repository Stars
stakira/OpenUtau
Open singing synthesis platform / Open source UTAU successor
SciSharp/NumSharp
High Performance Computation for N-D Tensors in .NET, similar API to NumPy.
kendryte/nncase
Open deep learning compiler stack for Kendryte AI accelerators ✨
SciSharp/SiaNet
An easy to use C# deep learning library with CUDA/OpenCL support
microsoft/qsharp-runtime
Runtime components for Q#
Version Downloads Last updated
0.30.0 262,950 2/14/2021
0.20.5 691,337 12/31/2019
0.20.4 321,893 10/5/2019
0.20.3 3,474 9/28/2019
0.20.2 2,372 9/11/2019
0.20.1 17,666 9/1/2019
0.20.0 3,666 8/20/2019
0.10.6 26,348 7/24/2019
0.10.5 2,428 7/22/2019
0.10.4 2,394 7/18/2019
0.10.3 11,475 6/15/2019
0.10.2 2,103 5/25/2019
0.10.1 3,594 5/11/2019
0.10.0 2,328 5/5/2019
0.9.0 3,313 4/15/2019
0.8.3 1,959 3/29/2019
0.8.2 2,687 3/25/2019
0.8.1 2,123 3/22/2019
0.8.0 2,253 3/12/2019
0.7.4 1,829 3/7/2019
0.7.3 500,748 2/20/2019
0.7.2 2,272 2/18/2019
0.7.1 2,306 2/12/2019
0.7.0 1,886 1/28/2019
0.6.6 2,272 1/26/2019
0.6.5 2,317 1/11/2019
0.6.4 2,320 1/7/2019
0.6.3 1,845 12/30/2018
0.6.2 5,733 12/27/2018
0.6.1 1,836 12/26/2018
0.6.0 1,911 12/21/2018
0.5.0 1,888 12/5/2018
0.4.0 1,798 11/21/2018
0.3.0 1,818 11/7/2018
0.2.0 3,867 10/29/2018
0.1.0 2,019 10/10/2018

Most of the library (>95%) has been rewritten within over 400 commits in course of 3 months.

- Full n-d, slice, broadcasting and axis support in all reimplemented methods (e.g. np.sum, np.concatenate) Broadcasting n-d shapes against each other.

- NDArray Slicing and nested slicing (nd["-1, ::2"]["1::3, :, 0"])

- Full and precise (to numpy) type resolving and conversion (upcasting, downcasting and all other cases)

- Use of unmanaged memory and unsafe code in favor of performance.

- NumSharp no longer perform copies except for cases when numpy does. Compared to previous version, indexing an n-d array (e.g. nd[0,1] when shape is (3,3,3,3)) would return a copy when now it returns a reference (alias).