Table of Contents

Class NDArray

Namespace
NumSharp
Assembly
NumSharp.dll

An array object represents a multidimensional, homogeneous array of fixed-size items.
An associated data-type object describes the format of each element in the array (its byte-order,
how many bytes it occupies in memory, whether it is an integer, a floating point number, or something else, etc.)

[SuppressMessage("ReSharper", "ParameterHidesMember")]
[SuppressMessage("ReSharper", "ParameterHidesMember")]
[SuppressMessage("ReSharper", "ParameterHidesMember")]
[SuppressMessage("ReSharper", "CoVariantArrayConversion")]
[SuppressMessage("ReSharper", "ParameterHidesMember")]
[SuppressMessage("ReSharper", "ParameterHidesMember")]
public class NDArray : IIndex, ICloneable, IEnumerable
Inheritance
NDArray
Implements
Derived
NDArray<TDType>
Inherited Members
Extension Methods

Remarks

Constructors

NDArray(IArraySlice, Shape, char)

Constructor which takes .NET array dtype and shape is determined from array

public NDArray(IArraySlice values, Shape shape = default, char order = 'C')

Parameters

values IArraySlice
shape Shape
order char

Remarks

This constructor calls IStorage.Allocate(NumSharp.Shape,System.Type)

NDArray(UnmanagedStorage)

Creates a new NDArray with this storage.

public NDArray(UnmanagedStorage storage)

Parameters

storage UnmanagedStorage

NDArray(UnmanagedStorage, Shape)

Creates a new NDArray with this storage.

protected NDArray(UnmanagedStorage storage, Shape shape)

Parameters

storage UnmanagedStorage
shape Shape

The shape to set for this NDArray, does not perform checks.

Remarks

Doesn't copy. Does not perform checks for shape.

NDArray(UnmanagedStorage, ref Shape)

Creates a new NDArray with this storage.

protected NDArray(UnmanagedStorage storage, ref Shape shape)

Parameters

storage UnmanagedStorage
shape Shape

The shape to set for this NDArray, does not perform checks.

Remarks

Doesn't copy. Does not perform checks for shape.

NDArray(NPTypeCode)

Constructor for init data type internal storage is 1D with 1 element

public NDArray(NPTypeCode typeCode)

Parameters

typeCode NPTypeCode

Data type of elements

Remarks

This constructor does not call allocation/>

NDArray(NPTypeCode, Shape)

Constructor which initialize elements with 0 type and shape are given.

public NDArray(NPTypeCode dtype, Shape shape)

Parameters

dtype NPTypeCode

internal data type

shape Shape

Shape of NDArray

Remarks

This constructor calls IStorage.Allocate(NumSharp.Shape,System.Type)

NDArray(NPTypeCode, Shape, bool)

Constructor which initialize elements with 0 type and shape are given.

public NDArray(NPTypeCode dtype, Shape shape, bool fillZeros)

Parameters

dtype NPTypeCode

internal data type

shape Shape

Shape of NDArray

fillZeros bool

Should set the values of the new allocation to default(dtype)? otherwise - old memory noise

Remarks

This constructor calls IStorage.Allocate(NumSharp.Shape,System.Type)

NDArray(NPTypeCode, TensorEngine)

Constructor for init data type internal storage is 1D with 1 element

protected NDArray(NPTypeCode typeCode, TensorEngine engine)

Parameters

typeCode NPTypeCode

Data type of elements

engine TensorEngine

The engine of this NDArray

Remarks

This constructor does not call allocation/>

NDArray(NPTypeCode, int)

Constructor which initialize elements with length of size

public NDArray(NPTypeCode dtype, int size)

Parameters

dtype NPTypeCode

Internal data type

size int

The size as a single dimension shape

Remarks

This constructor calls IStorage.Allocate(NumSharp.Shape,System.Type)

NDArray(NPTypeCode, int, bool)

Constructor which initialize elements with length of size

public NDArray(NPTypeCode dtype, int size, bool fillZeros)

Parameters

dtype NPTypeCode

Internal data type

size int

The size as a single dimension shape

fillZeros bool

Should set the values of the new allocation to default(dtype)? otherwise - old memory noise

Remarks

This constructor calls IStorage.Allocate(NumSharp.Shape,System.Type)

NDArray(Array, Shape, char)

Constructor which takes .NET array dtype and shape is determined from array

public NDArray(Array values, Shape shape = default, char order = 'C')

Parameters

values Array
shape Shape
order char

Remarks

This constructor calls IStorage.Allocate(NumSharp.Shape,System.Type)

NDArray(Type)

Constructor for init data type internal storage is 1D with 1 element

public NDArray(Type dtype)

Parameters

dtype Type

Data type of elements

Remarks

This constructor does not call allocation/>

NDArray(Type, Shape)

Constructor which initialize elements with 0 type and shape are given.

public NDArray(Type dtype, Shape shape)

Parameters

dtype Type

internal data type

shape Shape

Shape of NDArray

Remarks

This constructor calls IStorage.Allocate(NumSharp.Shape,System.Type)

NDArray(Type, Shape, bool)

Constructor which initialize elements with 0 type and shape are given.

public NDArray(Type dtype, Shape shape, bool fillZeros)

Parameters

dtype Type

internal data type

shape Shape

Shape of NDArray

fillZeros bool

Should set the values of the new allocation to default(dtype)? otherwise - old memory noise

Remarks

This constructor calls IStorage.Allocate(NumSharp.Shape,System.Type)

NDArray(Type, TensorEngine)

Constructor for init data type internal storage is 1D with 1 element

protected NDArray(Type dtype, TensorEngine engine)

Parameters

dtype Type

Data type of elements

engine TensorEngine

The engine of this NDArray

Remarks

This constructor does not call allocation/>

NDArray(Type, int)

Constructor which initialize elements with length of size

public NDArray(Type dtype, int size)

Parameters

dtype Type

Internal data type

size int

The size as a single dimension shape

Remarks

This constructor calls IStorage.Allocate(NumSharp.Shape,System.Type)

NDArray(Type, int, bool)

Constructor which initialize elements with length of size

public NDArray(Type dtype, int size, bool fillZeros)

Parameters

dtype Type

Internal data type

size int

The size as a single dimension shape

fillZeros bool

Should set the values of the new allocation to default(dtype)? otherwise - old memory noise

Remarks

This constructor calls IStorage.Allocate(NumSharp.Shape,System.Type)

Fields

Storage

The internal storage that stores data for this NDArray.

protected UnmanagedStorage Storage

Field Value

UnmanagedStorage

tensorEngine

protected TensorEngine tensorEngine

Field Value

TensorEngine

Properties

Address

Gets the address that this NDArray starts from.

protected void* Address { get; }

Property Value

void*

Array

Get: Gets internal storage array by calling IStorage.GetData
Set: Replace internal storage by calling IStorage.ReplaceData(System.Array)

protected IArraySlice Array { get; }

Property Value

IArraySlice

Remarks

Setting does not replace internal storage array.

this[NDArray<bool>]

Used to perform selection based on a boolean mask.

[SuppressMessage("ReSharper", "CoVariantArrayConversion")]
public NDArray this[NDArray<bool> mask] { get; set; }

Parameters

mask NDArray<bool>

Property Value

NDArray

Remarks

Exceptions

IndexOutOfRangeException

When one of the indices exceeds limits.

ArgumentException

indices must be of Int type (byte, u/short, u/int, u/long).

this[NDArray<int>[]]

Used to perform selection based on a selection indices.

public NDArray this[params NDArray<int>[] selection] { get; set; }

Parameters

selection NDArray<int>[]

Property Value

NDArray

Remarks

Exceptions

IndexOutOfRangeException

When one of the indices exceeds limits.

ArgumentException

indices must be of Int type (byte, u/short, u/int, u/long).

this[Slice[]]

Slice the array with Python slice notation like this: ":, 2:7:1, ..., np.newaxis"

public NDArray this[params Slice[] slice] { get; set; }

Parameters

slice Slice[]

A string containing slice notations for every dimension, delimited by comma

Property Value

NDArray

A sliced view

this[int*, int]

Used to perform selection based on given indices.

public NDArray this[int* dims, int ndims] { get; set; }

Parameters

dims int*

The pointer to the dimensions

ndims int

The count of ints in dims

Property Value

NDArray

this[object[]]

Perform slicing, index extraction, masking and indexing all at the same time with mixed index objects

public NDArray this[params object[] indicesObjects] { get; set; }

Parameters

indicesObjects object[]

Property Value

NDArray

this[string]

Slice the array with Python slice notation like this: ":, 2:7:1, ..., np.newaxis"

public NDArray this[string slice] { get; set; }

Parameters

slice string

A string containing slice notations for every dimension, delimited by comma

Property Value

NDArray

A sliced view

Shape

The shape representing this NDArray.

public Shape Shape { get; set; }

Property Value

Shape

T

The transposed array.
Same as self.transpose().

public NDArray T { get; }

Property Value

NDArray

Remarks

TensorEngine

The tensor engine that handles this NDArray.

public TensorEngine TensorEngine { get; set; }

Property Value

TensorEngine

Unsafe

Provides an interface for unsafe methods in NDArray.

public NDArray._Unsafe Unsafe { get; }

Property Value

NDArray._Unsafe

base

Gets the array owning the memory, or null if this array owns its data.

public NDArray? @base { get; }

Property Value

NDArray

An NDArray wrapping the base storage for views, or null for arrays that own their data (e.g., created via np.arange, np.zeros, or copy()).

Remarks

NumPy Compatibility: This property mirrors NumPy's ndarray.base attribute. All views chain to the ultimate owner (not intermediate views).

Example:

var a = np.arange(10);    // a.@base == null (owns data)
var b = a["2:5"];         // b.@base.Storage == a.Storage (view)
var c = b["1:2"];         // c.@base.Storage == a.Storage (chains to original!)
var d = a.copy();         // d.@base == null (copy owns data)
var e = a.reshape(2, 5);  // e.@base.Storage == a.Storage (view)

View Detection: Use arr.@base != null or arr.Storage.IsView to detect if an array is a view. Note that arr.@base != null may trigger NDArray's operator overloading for element-wise comparison. Prefer arr.Storage.IsView for simple boolean checks.

Semantic Difference from NumPy: In NumPy, c.base is a returns True (object identity). In NumSharp, c.@base creates a new wrapper each call, so ReferenceEquals(c.@base, a) is false. However, the underlying storage is the same: c.@base.Storage == a.Storage is true.

Memory Safety: The underlying memory is kept alive by the shared Disposer in the MemoryBlock, not by this property. Views remain valid even if the original array reference is garbage collected.

See Also

dtype

The dtype of this array.

public Type dtype { get; }

Property Value

Type

dtypesize

public int dtypesize { get; }

Property Value

int

flat

A 1-D iterator over the array.

public NDArray flat { get; }

Property Value

NDArray

Remarks

ndim

Dimension count

public int ndim { get; }

Property Value

int

order

public char order { get; }

Property Value

char

shape

Data length of every dimension

public int[] shape { get; set; }

Property Value

int[]

size

Total of elements

public int size { get; }

Property Value

int

strides

public int[] strides { get; }

Property Value

int[]

typecode

The NPTypeCode of this array.

public NPTypeCode typecode { get; }

Property Value

NPTypeCode

Methods

AsGeneric<T>()

Tries to cast to NDArray<TDType>, otherwise creates an alias without reallocating data.

public NDArray<T> AsGeneric<T>() where T : unmanaged

Returns

NDArray<T>

This NDArray as a generic version.

Type Parameters

T

The type of the generic

Exceptions

InvalidOperationException

When T != dtype

AsOrMakeGeneric<T>()

Tries to cast to NDArray<TDType>, otherwise calls NDArray<T>.astype.

public NDArray<T> AsOrMakeGeneric<T>() where T : unmanaged

Returns

NDArray<T>

This NDArray as a generic version.

Type Parameters

T

The type of the generic

Exceptions

InvalidOperationException

When T != dtype

AsString(NDArray)

Converts the entire NDArray to a string.

public static string AsString(NDArray arr)

Parameters

arr NDArray

Returns

string

Remarks

Performs a copy due to String .net-framework limitations.

AsStringArray(NDArray)

Convert to String[] from NDArray

public static string[] AsStringArray(NDArray arr)

Parameters

arr NDArray

Returns

string[]

Clone()

Clone the whole NDArray internal storage is also cloned into 2nd memory area

public NDArray Clone()

Returns

NDArray

Cloned NDArray

CloneData()

public IArraySlice CloneData()

Returns

IArraySlice

CloneData<T>()

public ArraySlice<T> CloneData<T>() where T : unmanaged

Returns

ArraySlice<T>

Type Parameters

T

CopyTo(IMemoryBlock)

Copies the entire contents of this storage to given address (using Count).

public void CopyTo(IMemoryBlock slice)

Parameters

slice IMemoryBlock

The slice to copy to.

CopyTo(nint)

Copies the entire contents of this storage to given address.

public void CopyTo(nint ptr)

Parameters

ptr nint

CopyTo(void*)

Copies the entire contents of this storage to given address (using Count).

public void CopyTo(void* address)

Parameters

address void*

The address to copy to.

CopyTo<T>(IMemoryBlock<T>)

Copies the entire contents of this storage to given address (using Count).

public void CopyTo<T>(IMemoryBlock<T> block) where T : unmanaged

Parameters

block IMemoryBlock<T>

The slice to copy to.

Type Parameters

T

CopyTo<T>(T*)

Copies the entire contents of this storage to given address.

public void CopyTo<T>(T* address) where T : unmanaged

Parameters

address T*

The address to copy to.

Type Parameters

T

CopyTo<T>(T[])

Copies the entire contents of this storage to given array.

public void CopyTo<T>(T[] array) where T : unmanaged

Parameters

array T[]

The array to copy to.

Type Parameters

T

Data<T>()

Shortcut for access internal elements

public ArraySlice<T> Data<T>() where T : unmanaged

Returns

ArraySlice<T>

Type Parameters

T

Equals(object)

Determines if NDArray data is same

public override bool Equals(object obj)

Parameters

obj object

NDArray to compare

Returns

bool

if reference is same

ExpandEllipsis(object[], int)

protected static IEnumerable<object> ExpandEllipsis(object[] ndarrays, int ndim)

Parameters

ndarrays object[]
ndim int

Returns

IEnumerable<object>

FetchIndices(NDArray, NDArray[], NDArray, bool)

protected static NDArray FetchIndices(NDArray src, NDArray[] indices, NDArray @out, bool extraDim)

Parameters

src NDArray
indices NDArray[]
out NDArray
extraDim bool

Returns

NDArray

FetchIndicesNDNonLinear<T>(NDArray<T>, NDArray[], int, int[], int[], NDArray)

Accepts collapsed

[SuppressMessage("ReSharper", "SuggestVarOrType_Elsewhere")]
protected static NDArray<T> FetchIndicesNDNonLinear<T>(NDArray<T> source, NDArray[] indices, int ndsCount, int[] retShape, int[] subShape, NDArray @out) where T : unmanaged

Parameters

source NDArray<T>
indices NDArray[]
ndsCount int
retShape int[]
subShape int[]
out NDArray

Returns

NDArray<T>

Type Parameters

T

FetchIndicesND<T>(NDArray<T>, NDArray<int>, NDArray[], int, int[], int[], NDArray)

Accepts collapsed

protected static NDArray<T> FetchIndicesND<T>(NDArray<T> src, NDArray<int> offsets, NDArray[] indices, int ndsCount, int[] retShape, int[] subShape, NDArray @out) where T : unmanaged

Parameters

src NDArray<T>
offsets NDArray<int>
indices NDArray[]
ndsCount int
retShape int[]
subShape int[]
out NDArray

Returns

NDArray<T>

Type Parameters

T

FetchIndices<T>(NDArray<T>, NDArray[], NDArray, bool)

protected static NDArray<T> FetchIndices<T>(NDArray<T> source, NDArray[] indices, NDArray @out, bool extraDim) where T : unmanaged

Parameters

source NDArray<T>
indices NDArray[]
out NDArray
extraDim bool

Returns

NDArray<T>

Type Parameters

T

FromMultiDimArray<T>(Array, bool)

Creates an NDArray out of given array of type T

public static NDArray FromMultiDimArray<T>(Array ndarray, bool copy = true) where T : unmanaged

Parameters

ndarray Array
copy bool

true for making

Returns

NDArray

Type Parameters

T

FromString(string)

Converts a string to a vector ndarray of bytes.

public static NDArray FromString(string str)

Parameters

str string

Returns

NDArray

GetAtIndex(int)

Retrieves value of

public ValueType GetAtIndex(int index)

Parameters

index int

Returns

ValueType

GetAtIndex<T>(int)

Retrieves value of

public T GetAtIndex<T>(int index) where T : unmanaged

Parameters

index int

Returns

T

Type Parameters

T

GetBoolean(params int[])

Retrieves value of type bool.

public bool GetBoolean(params int[] indices)

Parameters

indices int[]

The shape's indices to get.

Returns

bool

Exceptions

NullReferenceException

When DType is not bool

GetByte(params int[])

Retrieves value of type byte.

public byte GetByte(params int[] indices)

Parameters

indices int[]

The shape's indices to get.

Returns

byte

Exceptions

NullReferenceException

When DType is not byte

GetChar(params int[])

Retrieves value of type char.

public char GetChar(params int[] indices)

Parameters

indices int[]

The shape's indices to get.

Returns

char

Exceptions

NullReferenceException

When DType is not char

GetData()

Get reference to internal data storage

public IArraySlice GetData()

Returns

IArraySlice

reference to internal storage as System.Array

GetData(params int[])

Gets a NDArray at given indices.

public NDArray GetData(params int[] indices)

Parameters

indices int[]

The coordinates to the wanted value

Returns

NDArray

Remarks

Does not copy, returns a memory slice - this is similar to this[int[]]

GetData<T>()

Gets the internal storage and converts it to T if necessary.

public ArraySlice<T> GetData<T>() where T : unmanaged

Returns

ArraySlice<T>

An array of type T

Type Parameters

T

The returned type.

GetDecimal(params int[])

Retrieves value of type decimal.

public decimal GetDecimal(params int[] indices)

Parameters

indices int[]

The shape's indices to get.

Returns

decimal

Exceptions

NullReferenceException

When DType is not decimal

GetDouble(params int[])

Retrieves value of type double.

public double GetDouble(params int[] indices)

Parameters

indices int[]

The shape's indices to get.

Returns

double

Exceptions

NullReferenceException

When DType is not double

GetEnumerator()

Returns an enumerator that iterates through a collection.

public IEnumerator GetEnumerator()

Returns

IEnumerator

An IEnumerator object that can be used to iterate through the collection.

GetIndices(NDArray, NDArray[])

Used to perform selection based on indices, equivalent to nd[NDArray[]].

public NDArray GetIndices(NDArray @out, NDArray[] indices)

Parameters

out NDArray
indices NDArray[]

Returns

NDArray

Remarks

Exceptions

IndexOutOfRangeException

When one of the indices exceeds limits.

ArgumentException

indices must be of Int type (byte, u/short, u/int, u/long).

GetIndicesFromSlice(Shape, Slice, int)

Converts a slice to indices for the special case where slices are mixed with NDArrays in this[...]

protected static NDArray<int> GetIndicesFromSlice(Shape shape, Slice slice, int axis)

Parameters

shape Shape
slice Slice
axis int

Returns

NDArray<int>

GetIndicesFromSlice(int[], Slice, int)

Converts a slice to indices for the special case where slices are mixed with NDArrays in this[...]

protected static NDArray<int> GetIndicesFromSlice(int[] shape, Slice slice, int axis)

Parameters

shape int[]
slice Slice
axis int

Returns

NDArray<int>

GetInt16(params int[])

Retrieves value of type short.

public short GetInt16(params int[] indices)

Parameters

indices int[]

The shape's indices to get.

Returns

short

Exceptions

NullReferenceException

When DType is not short

GetInt32(params int[])

Retrieves value of type int.

public int GetInt32(params int[] indices)

Parameters

indices int[]

The shape's indices to get.

Returns

int

Exceptions

NullReferenceException

When DType is not int

GetInt64(params int[])

Retrieves value of type long.

public long GetInt64(params int[] indices)

Parameters

indices int[]

The shape's indices to get.

Returns

long

Exceptions

NullReferenceException

When DType is not long

GetNDArrays(int)

Get all NDArray slices at that specific dimension.

[SuppressMessage("ReSharper", "LoopCanBeConvertedToQuery")]
public NDArray[] GetNDArrays(int axis = 0)

Parameters

axis int

Zero-based dimension index on which axis and forward of it to select data., e.g. dimensions=1, shape is (2,2,3,3), returned shape = 4 times of (3,3)

Returns

NDArray[]

Examples

var nd = np.arange(27).reshape(3,1,3,3);
var ret = nd.GetNDArrays(1);
Assert.IsTrue(ret.All(n=>n.Shape == new Shape(3,3));
Assert.IsTrue(ret.Length == 3);
var nd = np.arange(27).reshape(3,1,3,3);

var ret = nd.GetNDArrays(0);
Assert.IsTrue(ret.All(n=>n.Shape == new Shape(1,3,3));
Assert.IsTrue(ret.Length == 3);

Remarks

Does not perform copy.

GetSingle(params int[])

Retrieves value of type float.

public float GetSingle(params int[] indices)

Parameters

indices int[]

The shape's indices to get.

Returns

float

Exceptions

NullReferenceException

When DType is not float

GetString(params int[])

Get a string out of a vector of chars.

public string GetString(params int[] indices)

Parameters

indices int[]

Returns

string

Remarks

Performs a copy due to String .net-framework limitations.

GetStringAt(int)

Get a string out of a vector of chars.

public string GetStringAt(int offset)

Parameters

offset int

Returns

string

Remarks

Performs a copy due to String .net-framework limitations.

GetUInt16(params int[])

Retrieves value of type ushort.

public ushort GetUInt16(params int[] indices)

Parameters

indices int[]

The shape's indices to get.

Returns

ushort

Exceptions

NullReferenceException

When DType is not ushort

GetUInt32(params int[])

Retrieves value of type uint.

public uint GetUInt32(params int[] indices)

Parameters

indices int[]

The shape's indices to get.

Returns

uint

Exceptions

NullReferenceException

When DType is not uint

GetUInt64(params int[])

Retrieves value of type ulong.

public ulong GetUInt64(params int[] indices)

Parameters

indices int[]

The shape's indices to get.

Returns

ulong

Exceptions

NullReferenceException

When DType is not ulong

GetValue(params int[])

Retrieves value of unspecified type (will figure using DType).

public ValueType GetValue(params int[] indices)

Parameters

indices int[]

The shape's indices to get.

Returns

ValueType

Exceptions

NullReferenceException

When DType is not object

GetValue<T>(params int[])

Retrieves value of unspecified type (will figure using DType).

public T GetValue<T>(params int[] indices) where T : unmanaged

Parameters

indices int[]

The shape's indices to get.

Returns

T

Type Parameters

T

Exceptions

NullReferenceException

When DType is not object

MakeGeneric<T>()

Creates an alias without reallocating data.

public NDArray<T> MakeGeneric<T>() where T : unmanaged

Returns

NDArray<T>

This NDArray as a generic version.

Type Parameters

T

The type of the generic

Exceptions

InvalidOperationException

When T != dtype

Normalize()

Normalizes all entries into the range between 0 and 1

Note: this is not a numpy function.

public void Normalize()

PrepareIndexGetters(Shape, NDArray[])

Generates index getter function based on given indices.

protected static Func<int, int>[] PrepareIndexGetters(Shape srcShape, NDArray[] indices)

Parameters

srcShape Shape

The shape to get indice from

indices NDArray[]

The indices trying to index.

Returns

Func<int, int>[]

ReplaceData(IArraySlice)

Sets values as the internal data source and changes the internal storage data type to values type.

public void ReplaceData(IArraySlice values)

Parameters

values IArraySlice

Remarks

Does not copy values and doesn't change shape.

ReplaceData(IArraySlice, Type)

Sets values as the internal data source and changes the internal storage data type to values type.

public void ReplaceData(IArraySlice values, Type dtype)

Parameters

values IArraySlice
dtype Type

Remarks

Does not copy values and doesn't change shape.

ReplaceData(NDArray)

Sets nd as the internal data storage and changes the internal storage data type to nd type.

public void ReplaceData(NDArray nd)

Parameters

nd NDArray

Remarks

Does not copy values and does change shape and dtype.

ReplaceData(Array)

Sets values as the internal data storage and changes the internal storage data type to values type.

public void ReplaceData(Array values)

Parameters

values Array

Remarks

Does not copy values.

ReplaceData(Array, NPTypeCode)

Set an Array to internal storage, cast it to new dtype and if necessary change dtype

public void ReplaceData(Array values, NPTypeCode typeCode)

Parameters

values Array
typeCode NPTypeCode

Remarks

Does not copy values unless cast is necessary and doesn't change shape.

ReplaceData(Array, Type)

Sets values as the internal data storage and changes the internal storage data type to dtype and casts values if necessary.

public void ReplaceData(Array values, Type dtype)

Parameters

values Array

The values to set as internal data soruce

dtype Type

The type to change this storage to and the type to cast values if necessary.

Remarks

Does not copy values unless cast is necessary.

Scalar(object)

Creates a scalar NDArray of value and dtype.

public static NDArray Scalar(object value)

Parameters

value object

The value of the scalar

Returns

NDArray

Remarks

In case when value is not dtype, Converts.ChangeType(object,System.Type) will be called.

Scalar(object, NPTypeCode)

Creates a scalar NDArray of value and dtype.

public static NDArray Scalar(object value, NPTypeCode typeCode)

Parameters

value object

The value of the scalar

typeCode NPTypeCode

The type code of the scalar.

Returns

NDArray

Remarks

In case when value is not dtype, Converts.ChangeType(object,System.Type) will be called.

Scalar(object, Type)

Creates a scalar NDArray of value and dtype.

public static NDArray Scalar(object value, Type dtype)

Parameters

value object

The value of the scalar

dtype Type

The type of the scalar.

Returns

NDArray

Remarks

In case when value is not dtype, Converts.ChangeType(object,System.Type) will be called.

Scalar(ValueType)

Creates a scalar NDArray of value and dtype.

public static NDArray Scalar(ValueType value)

Parameters

value ValueType

The value of the scalar

Returns

NDArray

Remarks

In case when value is not dtype, Converts.ChangeType(object,System.Type) will be called.

Scalar<T>(object)

Creates a scalar NDArray of value and dtype.

public static NDArray Scalar<T>(object value) where T : unmanaged

Parameters

value object

The value of the scalar, attempt to convert will be performed

Returns

NDArray

Type Parameters

T

Remarks

In case when value is not dtype, Converts.ChangeType(object,System.Type) will be called.

Scalar<T>(T)

Creates a scalar NDArray of value and dtype.

public static NDArray Scalar<T>(T value) where T : unmanaged

Parameters

value T

The value of the scalar

Returns

NDArray

Type Parameters

T

Remarks

In case when value is not dtype, Converts.ChangeType(object,System.Type) will be called.

SetAtIndex(object, int)

Retrieves value at given linear (offset) index.

public void SetAtIndex(object obj, int index)

Parameters

obj object
index int

SetAtIndex<T>(T, int)

Retrieves value of

public void SetAtIndex<T>(T value, int index) where T : unmanaged

Parameters

value T
index int

Type Parameters

T

SetBoolean(bool, params int[])

Sets a bool at specific coordinates.

public void SetBoolean(bool value, params int[] indices)

Parameters

value bool

The values to assign

indices int[]

The coordinates to set value at.

SetByte(byte, params int[])

Sets a byte at specific coordinates.

public void SetByte(byte value, params int[] indices)

Parameters

value byte

The values to assign

indices int[]

The coordinates to set value at.

SetChar(char, params int[])

Sets a char at specific coordinates.

public void SetChar(char value, params int[] indices)

Parameters

value char

The values to assign

indices int[]

The coordinates to set value at.

SetData(IArraySlice, params int[])

Set a IArraySlice at given indices.

public void SetData(IArraySlice value, params int[] indices)

Parameters

value IArraySlice

The value to set

indices int[]

The

Remarks

Does not change internal storage data type.
If value does not match DType, value will be converted.

SetData(NDArray, params int[])

Set a NDArray at given indices.

public void SetData(NDArray value, params int[] indices)

Parameters

value NDArray

The value to set

indices int[]

The

Remarks

Does not change internal storage data type.
If value does not match DType, value will be converted.

SetData(object)

public void SetData(object p)

Parameters

p object

SetData(object, params int[])

Set a NDArray, IArraySlice, Array or a scalar value at given indices.

public void SetData(object value, params int[] indices)

Parameters

value object

The value to set

indices int[]

The

Remarks

Does not change internal storage data type.
If value does not match DType, value will be converted.

SetDecimal(decimal, params int[])

Sets a decimal at specific coordinates.

public void SetDecimal(decimal value, params int[] indices)

Parameters

value decimal

The values to assign

indices int[]

The coordinates to set value at.

SetDouble(double, params int[])

Sets a double at specific coordinates.

public void SetDouble(double value, params int[] indices)

Parameters

value double

The values to assign

indices int[]

The coordinates to set value at.

SetIndices(NDArray, NDArray[])

Used to perform set a selection based on indices, equivalent to nd[NDArray[]] = values.

public void SetIndices(NDArray values, NDArray[] indices)

Parameters

values NDArray

The values to set via .

indices NDArray[]

Remarks

Exceptions

IndexOutOfRangeException

When one of the indices exceeds limits.

ArgumentException

indices must be of Int type (byte, u/short, u/int, u/long).

NumSharpException

If this array is not writeable (e.g., broadcast array).

SetIndices(NDArray, NDArray[], NDArray)

protected static void SetIndices(NDArray src, NDArray[] indices, NDArray values)

Parameters

src NDArray
indices NDArray[]
values NDArray

SetIndices(object[], NDArray)

protected void SetIndices(object[] indicesObjects, NDArray values)

Parameters

indicesObjects object[]
values NDArray

SetIndicesNDNonLinear<T>(NDArray<T>, NDArray[], int, int[], int[], NDArray<T>)

Accepts collapsed

[SuppressMessage("ReSharper", "SuggestVarOrType_Elsewhere")]
protected static void SetIndicesNDNonLinear<T>(NDArray<T> source, NDArray[] indices, int ndsCount, int[] retShape, int[] subShape, NDArray<T> values) where T : unmanaged

Parameters

source NDArray<T>
indices NDArray[]
ndsCount int
retShape int[]
subShape int[]
values NDArray<T>

Type Parameters

T

SetIndicesND<T>(NDArray<T>, NDArray<int>, NDArray[], int, int[], int[], NDArray<T>)

Accepts collapsed

protected static void SetIndicesND<T>(NDArray<T> dst, NDArray<int> dstOffsets, NDArray[] dstIndices, int ndsCount, int[] retShape, int[] subShape, NDArray<T> values) where T : unmanaged

Parameters

dst NDArray<T>
dstOffsets NDArray<int>
dstIndices NDArray[]
ndsCount int
retShape int[]
subShape int[]
values NDArray<T>

Type Parameters

T

SetIndices<T>(NDArray<T>, NDArray[], NDArray)

protected static void SetIndices<T>(NDArray<T> source, NDArray[] indices, NDArray values) where T : unmanaged

Parameters

source NDArray<T>
indices NDArray[]
values NDArray

Type Parameters

T

SetInt16(short, params int[])

Sets a short at specific coordinates.

public void SetInt16(short value, params int[] indices)

Parameters

value short

The values to assign

indices int[]

The coordinates to set value at.

SetInt32(int, params int[])

Sets a int at specific coordinates.

public void SetInt32(int value, params int[] indices)

Parameters

value int

The values to assign

indices int[]

The coordinates to set value at.

SetInt64(long, params int[])

Sets a long at specific coordinates.

public void SetInt64(long value, params int[] indices)

Parameters

value long

The values to assign

indices int[]

The coordinates to set value at.

SetSingle(float, params int[])

Sets a float at specific coordinates.

public void SetSingle(float value, params int[] indices)

Parameters

value float

The values to assign

indices int[]

The coordinates to set value at.

SetString(string, params int[])

public void SetString(string value, params int[] indices)

Parameters

value string
indices int[]

SetStringAt(string, int)

public void SetStringAt(string value, int offset)

Parameters

value string
offset int

SetUInt16(ushort, params int[])

Sets a ushort at specific coordinates.

public void SetUInt16(ushort value, params int[] indices)

Parameters

value ushort

The values to assign

indices int[]

The coordinates to set value at.

SetUInt32(uint, params int[])

Sets a uint at specific coordinates.

public void SetUInt32(uint value, params int[] indices)

Parameters

value uint

The values to assign

indices int[]

The coordinates to set value at.

SetUInt64(ulong, params int[])

Sets a ulong at specific coordinates.

public void SetUInt64(ulong value, params int[] indices)

Parameters

value ulong

The values to assign

indices int[]

The coordinates to set value at.

SetValue(object, params int[])

Set a single value at given indices.

public void SetValue(object value, params int[] indices)

Parameters

value object

The value to set

indices int[]

The

Remarks

Does not change internal storage data type.
If value does not match DType, value will be converted.

SetValue(ValueType, params int[])

Set a single value at given indices.

public void SetValue(ValueType value, params int[] indices)

Parameters

value ValueType

The value to set

indices int[]

The

Remarks

Does not change internal storage data type.
If value does not match DType, value will be converted.

SetValue<T>(T, params int[])

Set a single value at given indices.

public void SetValue<T>(T value, params int[] indices) where T : unmanaged

Parameters

value T

The value to set

indices int[]

The

Type Parameters

T

Remarks

Does not change internal storage data type.
If value does not match DType, value will be converted.

ToArray<T>()

public T[] ToArray<T>() where T : unmanaged

Returns

T[]

Type Parameters

T

ToByteArray()

public byte[] ToByteArray()

Returns

byte[]

ToJaggedArray<T>()

public Array ToJaggedArray<T>() where T : unmanaged

Returns

Array

Type Parameters

T

ToMuliDimArray<T>()

public Array ToMuliDimArray<T>() where T : unmanaged

Returns

Array

Type Parameters

T

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

ToString(bool)

public string ToString(bool flat)

Parameters

flat bool

Returns

string

amax(int, bool, Type)

Return the maximum of an array or maximum along an axis.

[SuppressMessage("ReSharper", "TooWideLocalVariableScope")]
[SuppressMessage("ReSharper", "ParameterHidesMember")]
public NDArray amax(int axis, bool keepdims = false, Type dtype = null)

Parameters

axis int

Axis or axes along which to operate.

keepdims bool

If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.

dtype Type

the type expected as a return, null will remain the same dtype.

Returns

NDArray

Maximum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.

Remarks

amax(Type)

Return the maximum of an array or maximum along an axis.

[SuppressMessage("ReSharper", "TooWideLocalVariableScope")]
[SuppressMessage("ReSharper", "ParameterHidesMember")]
public NDArray amax(Type dtype = null)

Parameters

dtype Type

the type expected as a return, null will remain the same dtype.

Returns

NDArray

Maximum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.

Remarks

amax<T>()

Return the maximum of an array or maximum along an axis.

public T amax<T>() where T : unmanaged

Returns

T

Maximum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.

Type Parameters

T

The expected return type, cast will be performed if necessary.

Remarks

amin(int, bool, Type)

Return the minimum of an array or minimum along an axis.

[SuppressMessage("ReSharper", "TooWideLocalVariableScope")]
[SuppressMessage("ReSharper", "ParameterHidesMember")]
public NDArray amin(int axis, bool keepdims = false, Type dtype = null)

Parameters

axis int

Axis or axes along which to operate.

keepdims bool

If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.

dtype Type

the type expected as a return, null will remain the same dtype.

Returns

NDArray

Minimum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.

Remarks

amin(Type)

Return the minimum of an array or minimum along an axis.

[SuppressMessage("ReSharper", "TooWideLocalVariableScope")]
[SuppressMessage("ReSharper", "ParameterHidesMember")]
public NDArray amin(Type dtype = null)

Parameters

dtype Type

the type expected as a return, null will remain the same dtype.

Returns

NDArray

Minimum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.

Remarks

amin<T>()

Return the minimum of an array or minimum along an axis.

public T amin<T>() where T : unmanaged

Returns

T

Minimum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.

Type Parameters

T

The expected return type, cast will be performed if necessary.

Remarks

argmax()

Returns the indices of the maximum values along an axis.

public int argmax()

Returns

int

The index of the maximal value in the array.

Remarks

argmax(int)

Returns the indices of the maximum values along an axis.

public int argmax(int axis)

Parameters

axis int

Returns

int

Array of indices into the array. It has the same shape as a.shape with the dimension along axis removed.

Remarks

argmin()

Returns the indices of the minimum values along an axis.

public int argmin()

Returns

int

The index of the minimum value in the array.

Remarks

argmin(int)

Returns the indices of the minimum values along an axis.

public int argmin(int axis)

Parameters

axis int

Returns

int

Array of indices into the array. It has the same shape as a.shape with the dimension along axis removed.

Remarks

argsort<T>(int)

Returns the indices that would sort an array.

Perform an indirect sort along the given axis using the algorithm specified by the kind keyword.It returns an array of indices of the same shape as a that index data along the given axis in sorted order.

public NDArray argsort<T>(int axis = -1)

Parameters

axis int

Returns

NDArray

Type Parameters

T

array_equal(NDArray)

True if two arrays have the same shape and elements, False otherwise.

public bool array_equal(NDArray rhs)

Parameters

rhs NDArray

Input array.

Returns

bool

Returns True if the arrays are equal.

Remarks

astype(NPTypeCode, bool)

Copy of the array, cast to a specified type.

public NDArray astype(NPTypeCode typeCode, bool copy = true)

Parameters

typeCode NPTypeCode
copy bool

By default, astype always returns a newly allocated array. If this is set to false, the input internal array is replaced instead of returning a new NDArray with the casted data.

Returns

NDArray

An NDArray of given dtype.

Remarks

astype(Type, bool)

Copy of the array, cast to a specified type.

[SuppressMessage("ReSharper", "ParameterHidesMember")]
public NDArray astype(Type dtype, bool copy = true)

Parameters

dtype Type

The dtype to cast this array.

copy bool

By default, astype always returns a newly allocated array. If this is set to false, the input internal array is replaced instead of returning a new NDArray with the casted data.

Returns

NDArray

An NDArray of given dtype.

Remarks

convolve(NDArray, string)

Returns the discrete, linear convolution of two one-dimensional sequences.

The convolution operator is often seen in signal processing, where it models the effect of a linear time-invariant system on a signal[1]. In probability theory, the sum of two independent random variables is distributed according to the convolution of their individual distributions.

If v is longer than a, the arrays are swapped before computation.

public NDArray convolve(NDArray rhs, string mode = "full")

Parameters

rhs NDArray
mode string

Returns

NDArray

copy(char)

Return a copy of the array.

public NDArray copy(char order = 'C')

Parameters

order char

Returns

NDArray

Remarks

cumsum(int?, Type)

Return the cumulative sum of the elements along a given axis.

public NDArray cumsum(int? axis = null, Type dtype = null)

Parameters

axis int?

Axis along which the cumulative sum is computed. The default (-1) is to compute the cumsum over the flattened array.

dtype Type

Type of the returned array and of the accumulator in which the elements are summed. If dtype is not specified, it defaults to the dtype of a, unless a has an integer dtype with a precision less than that of the default platform integer. In that case, the default platform integer is used.

Returns

NDArray

A new array holding the result is returned unless out is specified, in which case a reference to out is returned. The result has the same size as a, and the same shape as a if axis is not None or a is a 1-d array.

Remarks

delete(IEnumerable)

public NDArray delete(IEnumerable delete)

Parameters

delete IEnumerable

Returns

NDArray

dot(in NDArray)

Dot product of two arrays. See remarks.

public NDArray dot(in NDArray b)

Parameters

b NDArray

Rhs, Second argument.

Returns

NDArray

Returns the dot product of a and b. If a and b are both scalars or both 1-D arrays then a scalar is returned; otherwise an array is returned. If out is given, then it is returned.

Remarks

https://numpy.org/doc/stable/reference/generated/numpy.dot.html
Specifically,
- If both a and b are 1-D arrays, it is inner product of vectors (without complex conjugation).
- If both a and b are 2-D arrays, it is matrix multiplication, but using matmul or a @ b is preferred.
- If either a or b is 0-D(scalar), it is equivalent to multiply and using numpy.multiply(a, b) or a* b is preferred.
- If a is an N-D array and b is a 1-D array, it is a sum product over the last axis of a and b.
- If a is an N-D array and b is an M-D array(where M>=2), it is a sum product over the last axis of a and the second-to-last axis of b:
dot(a, b)[i,j,k,m] = sum(a[i,j,:] * b[k,:,m])

dstack(params NDArray[])

Stack arrays in sequence depth wise (along third axis). This is equivalent to concatenation along the third axis after 2-D arrays of shape(M, N) have been reshaped to(M, N,1) and 1-D arrays of shape(N,) have been reshaped to(1, N,1). Rebuilds arrays divided by dsplit. This function makes most sense for arrays with up to 3 dimensions.For instance, for pixel-data with a height(first axis), width(second axis), and r/g/b channels(third axis). The functions concatenate, stack and block provide more general stacking and concatenation operations.

public NDArray dstack(params NDArray[] tup)

Parameters

tup NDArray[]

The arrays must have the same shape along all but the third axis. 1-D or 2-D arrays must have the same shape.

Returns

NDArray

The array formed by stacking the given arrays, will be at least 3-D.

Remarks

flatten(char)

Return a copy of the array collapsed into one dimension.

public NDArray flatten(char order = 'C')

Parameters

order char

The order in which to read the elements. 'C' means row-major (C-style), 'F' means column-major (Fortran-style). NumSharp only supports 'C' order; this parameter is accepted for API compatibility but 'F' is ignored.

Returns

NDArray

A copy of the input array, flattened to one dimension.

Remarks

https://numpy.org/doc/stable/reference/generated/numpy.ndarray.flatten.html NumPy: flatten() ALWAYS returns a copy. Use ravel() for a view when possible.

hstack(params NDArray[])

Stack arrays in sequence horizontally (column wise). This is equivalent to concatenation along the second axis, except for 1-D arrays where it concatenates along the first axis.Rebuilds arrays divided by hsplit. This function makes most sense for arrays with up to 3 dimensions.For instance, for pixel-data with a height(first axis), width(second axis), and r/g/b channels(third axis). The functions concatenate, stack and block provide more general stacking and concatenation operations.

public NDArray hstack(params NDArray[] tup)

Parameters

tup NDArray[]

The arrays must have the same shape along all but the second axis, except 1-D arrays which can be any length.

Returns

NDArray

The array formed by stacking the given arrays.

Remarks

inv()

public NDArray inv()

Returns

NDArray

itemset(Shape, ValueType)

Insert scalar into an array (scalar is cast to array’s dtype, if possible)

public void itemset(Shape shape, ValueType val)

Parameters

shape Shape
val ValueType

Remarks

itemset(ref Shape, ValueType)

Insert scalar into an array (scalar is cast to array’s dtype, if possible)

public void itemset(ref Shape shape, ValueType val)

Parameters

shape Shape
val ValueType

Remarks

itemset(int[], ValueType)

Insert scalar into an array (scalar is cast to array’s dtype, if possible)

public void itemset(int[] shape, ValueType val)

Parameters

shape int[]
val ValueType

Remarks

itemset<T>(int[], T)

Insert scalar into an array (scalar is cast to array’s dtype, if possible)

public void itemset<T>(int[] shape, T val) where T : unmanaged

Parameters

shape int[]
val T

Type Parameters

T

Remarks

lstqr(NDArray, double)

Least Square method

Determines NDArray X which reduces least square error of Linear System A * X = B. This NDArray is equal to A.

public NDArray lstqr(NDArray nDArrayB, double rcon = 0.0001)

Parameters

nDArrayB NDArray

Result NDArray B

rcon double

Returns

NDArray

NArray X

matrix_power(int)

public NDArray matrix_power(int power)

Parameters

power int

Returns

NDArray

max(int, bool, Type)

Return the maximum of an array or maximum along an axis.

[SuppressMessage("ReSharper", "TooWideLocalVariableScope")]
[SuppressMessage("ReSharper", "ParameterHidesMember")]
public NDArray max(int axis, bool keepdims = false, Type dtype = null)

Parameters

axis int

Axis or axes along which to operate.

keepdims bool

If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.

dtype Type

the type expected as a return, null will remain the same dtype.

Returns

NDArray

Maximum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.

Remarks

max(Type)

Return the maximum of an array or maximum along an axis.

[SuppressMessage("ReSharper", "TooWideLocalVariableScope")]
[SuppressMessage("ReSharper", "ParameterHidesMember")]
public NDArray max(Type dtype = null)

Parameters

dtype Type

the type expected as a return, null will remain the same dtype.

Returns

NDArray

Maximum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.

Remarks

max<T>()

Return the maximum of an array or maximum along an axis.

public T max<T>() where T : unmanaged

Returns

T

Maximum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.

Type Parameters

T

The expected return type, cast will be performed if necessary.

Remarks

mean()

Compute the arithmetic mean along the specified axis. Returns the average of the array elements. The average is taken over the flattened array by default, otherwise over the specified axis. float64 intermediate and return values are used for integer inputs.

public NDArray mean()

Returns

NDArray

returns a new array containing the mean values, otherwise a reference to the output array is returned.

Remarks

mean(int)

Compute the arithmetic mean along the specified axis. Returns the average of the array elements. The average is taken over the flattened array by default, otherwise over the specified axis. float64 intermediate and return values are used for integer inputs.

public NDArray mean(int axis)

Parameters

axis int

Axis or axes along which the means are computed. The default is to compute the mean of the flattened array.

Returns

NDArray

returns a new array containing the mean values, otherwise a reference to the output array is returned.

Remarks

mean(int, NPTypeCode, bool)

Compute the arithmetic mean along the specified axis. Returns the average of the array elements. The average is taken over the flattened array by default, otherwise over the specified axis. float64 intermediate and return values are used for integer inputs.

public NDArray mean(int axis, NPTypeCode type, bool keepdims = false)

Parameters

axis int

Axis or axes along which the means are computed. The default is to compute the mean of the flattened array.

type NPTypeCode

Type to use in computing the mean. For integer inputs, the default is float64; for floating point inputs, it is the same as the input dtype.

keepdims bool

If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array. If the default value is passed, then keepdims will not be passed through to the mean method of sub-classes of ndarray, however any non-default value will be.If the sub-class’ method does not implement keepdims any exceptions will be raised.

Returns

NDArray

returns a new array containing the mean values, otherwise a reference to the output array is returned.

Remarks

mean(int, bool)

Compute the arithmetic mean along the specified axis. Returns the average of the array elements. The average is taken over the flattened array by default, otherwise over the specified axis. float64 intermediate and return values are used for integer inputs.

public NDArray mean(int axis, bool keepdims)

Parameters

axis int

Axis or axes along which the means are computed. The default is to compute the mean of the flattened array.

keepdims bool

If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array. If the default value is passed, then keepdims will not be passed through to the mean method of sub-classes of ndarray, however any non-default value will be.If the sub-class’ method does not implement keepdims any exceptions will be raised.

Returns

NDArray

returns a new array containing the mean values, otherwise a reference to the output array is returned.

mean(int, Type, bool)

Compute the arithmetic mean along the specified axis. Returns the average of the array elements. The average is taken over the flattened array by default, otherwise over the specified axis. float64 intermediate and return values are used for integer inputs.

public NDArray mean(int axis, Type type, bool keepdims = false)

Parameters

axis int

Axis or axes along which the means are computed. The default is to compute the mean of the flattened array.

type Type

Type to use in computing the mean. For integer inputs, the default is float64; for floating point inputs, it is the same as the input dtype.

keepdims bool

If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array. If the default value is passed, then keepdims will not be passed through to the mean method of sub-classes of ndarray, however any non-default value will be.If the sub-class’ method does not implement keepdims any exceptions will be raised.

Returns

NDArray

returns a new array containing the mean values, otherwise a reference to the output array is returned.

Remarks

mgrid(NDArray)

nd_grid instance which returns a dense multi-dimensional “meshgrid”. An instance of numpy.lib.index_tricks.nd_grid which returns an dense (or fleshed out) mesh-grid when indexed, so that each returned argument has the same shape. The dimensions and number of the output arrays are equal to the number of indexing dimensions.If the step length is not a complex number, then the stop is not inclusive.

public (NDArray, NDArray) mgrid(NDArray rhs)

Parameters

rhs NDArray

Returns

(NDArray Lhs, NDArray Rhs)

mesh-grid ndarrays all of the same dimensions

Remarks

min(int, bool, Type)

Return the minimum of an array or minimum along an axis.

[SuppressMessage("ReSharper", "TooWideLocalVariableScope")]
[SuppressMessage("ReSharper", "ParameterHidesMember")]
public NDArray min(int axis, bool keepdims = false, Type dtype = null)

Parameters

axis int

Axis or axes along which to operate.

keepdims bool

If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.

dtype Type

the type expected as a return, null will remain the same dtype.

Returns

NDArray

Minimum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.

Remarks

min(Type)

Return the minimum of an array or minimum along an axis.

[SuppressMessage("ReSharper", "TooWideLocalVariableScope")]
[SuppressMessage("ReSharper", "ParameterHidesMember")]
public NDArray min(Type dtype = null)

Parameters

dtype Type

the type expected as a return, null will remain the same dtype.

Returns

NDArray

Minimum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.

Remarks

min<T>()

Return the minimum of an array or minimum along an axis.

public T min<T>() where T : unmanaged

Returns

T

Minimum of a. If axis is None, the result is a scalar value. If axis is given, the result is an array of dimension a.ndim - 1.

Type Parameters

T

The expected return type, cast will be performed if necessary.

Remarks

multi_dot(params NDArray[])

public NDArray multi_dot(params NDArray[] np2Multi)

Parameters

np2Multi NDArray[]

Returns

NDArray

negate()

Negates all values by performing: -x

public NDArray negate()

Returns

NDArray

negative()

Negates all positive values.

public NDArray negative()

Returns

NDArray

positive()

Positives all negative values.

public NDArray positive()

Returns

NDArray

prod(int?, Type, bool)

Return the product of array elements over a given axis.

public NDArray prod(int? axis = null, Type dtype = null, bool keepdims = false)

Parameters

axis int?

Axis or axes along which a product is performed. The default, axis=None, will calculate the product of all the elements in the input array. If axis is negative it counts from the last to the first axis.

dtype Type

The type of the returned array, as well as of the accumulator in which the elements are multiplied. The dtype of a is used by default unless a has an integer dtype of less precision than the default platform integer. In that case, if a is signed then the platform integer is used while if a is unsigned then an unsigned integer of the same precision as the platform integer is used.

keepdims bool

If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.

Returns

NDArray

An array shaped as a but with the specified axis removed.

Remarks

qr()

public (NDArray, NDArray) qr()

Returns

(NDArray Lhs, NDArray Rhs)

ravel()

Return a contiguous flattened array. A 1-D array, containing the elements of the input, is returned

public NDArray ravel()

Returns

NDArray

Remarks

reshape(Shape)

Gives a new shape to an array without changing its data.

public NDArray reshape(Shape newShape)

Parameters

newShape Shape

The new shape should be compatible with the original shape. If an integer, then the result will be a 1-D array of that length. One shape dimension can be -1. In this case, the value is inferred from the length of the array and remaining dimensions.

Returns

NDArray

This will be a new view object if possible; otherwise, it will be a copy. Note there is no guarantee of the memory layout (C- or Fortran- contiguous) of the returned array.

Remarks

reshape(ref Shape)

Gives a new shape to an array without changing its data.

public NDArray reshape(ref Shape newShape)

Parameters

newShape Shape

The new shape should be compatible with the original shape. If an integer, then the result will be a 1-D array of that length. One shape dimension can be -1. In this case, the value is inferred from the length of the array and remaining dimensions.

Returns

NDArray

This will be a new view object if possible; otherwise, it will be a copy. Note there is no guarantee of the memory layout (C- or Fortran- contiguous) of the returned array.

Remarks

reshape(params int[])

Gives a new shape to an array without changing its data.

[SuppressMessage("ReSharper", "ParameterHidesMember")]
public NDArray reshape(params int[] shape)

Parameters

shape int[]

The new shape should be compatible with the original shape. If an integer, then the result will be a 1-D array of that length. One shape dimension can be -1. In this case, the value is inferred from the length of the array and remaining dimensions.

Returns

NDArray

This will be a new view object if possible; otherwise, it will be a copy. Note there is no guarantee of the memory layout (C- or Fortran- contiguous) of the returned array.

Remarks

reshape_unsafe(Shape)

Gives a new shape to an array without changing its data.

public NDArray reshape_unsafe(Shape newshape)

Parameters

newshape Shape

The new shape should be compatible with the original shape. If an integer, then the result will be a 1-D array of that length. One shape dimension can be -1. In this case, the value is inferred from the length of the array and remaining dimensions.

Returns

NDArray

This will be a new view object if possible; otherwise, it will be a copy. Note there is no guarantee of the memory layout (C- or Fortran- contiguous) of the returned array.

Remarks

reshape_unsafe(ref Shape)

Gives a new shape to an array without changing its data.

public NDArray reshape_unsafe(ref Shape newshape)

Parameters

newshape Shape

The new shape should be compatible with the original shape. If an integer, then the result will be a 1-D array of that length. One shape dimension can be -1. In this case, the value is inferred from the length of the array and remaining dimensions.

Returns

NDArray

This will be a new view object if possible; otherwise, it will be a copy. Note there is no guarantee of the memory layout (C- or Fortran- contiguous) of the returned array.

Remarks

reshape_unsafe(params int[])

Gives a new shape to an array without changing its data.

[SuppressMessage("ReSharper", "ParameterHidesMember")]
public NDArray reshape_unsafe(params int[] shape)

Parameters

shape int[]

The new shape should be compatible with the original shape. If an integer, then the result will be a 1-D array of that length. One shape dimension can be -1. In this case, the value is inferred from the length of the array and remaining dimensions.

Returns

NDArray

This will be a new view object if possible; otherwise, it will be a copy. Note there is no guarantee of the memory layout (C- or Fortran- contiguous) of the returned array.

Remarks

roll(int)

Roll array elements along a given axis.

Elements that roll beyond the last position are re-introduced at the first. The array is flattened before shifting, after which the original shape is restored.

public NDArray roll(int shift)

Parameters

shift int

The number of places by which elements are shifted.

Returns

NDArray

Output array, with the same shape as the input.

Remarks

roll(int, int)

Roll array elements along a given axis.

Elements that roll beyond the last position are re-introduced at the first.

public NDArray roll(int shift, int axis)

Parameters

shift int

The number of places by which elements are shifted.

axis int

Axis along which elements are shifted.

Returns

NDArray

Output array, with the same shape as the input.

Remarks

std(bool, int?, NPTypeCode?)

Compute the standard deviation along the specified axis. Returns the standard deviation, a measure of the spread of a distribution, of the array elements. The standard deviation is computed for the flattened array by default, otherwise over the specified axis.

public NDArray std(bool keepdims = false, int? ddof = null, NPTypeCode? dtype = null)

Parameters

keepdims bool

If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.

ddof int?

Means Delta Degrees of Freedom. The divisor used in calculations is N - ddof, where N represents the number of elements. By default ddof is zero.

dtype NPTypeCode?

Returns

NDArray

returns a new array containing the std values, otherwise a reference to the output array is returned.

Remarks

std(int, bool, int?, NPTypeCode?)

Compute the standard deviation along the specified axis. Returns the standard deviation, a measure of the spread of a distribution, of the array elements. The standard deviation is computed for the flattened array by default, otherwise over the specified axis.

public NDArray std(int axis, bool keepdims = false, int? ddof = null, NPTypeCode? dtype = null)

Parameters

axis int

Axis or axes along which the standard deviation is computed. The default is to compute the standard deviation of the flattened array.

keepdims bool

If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.

ddof int?

Means Delta Degrees of Freedom. The divisor used in calculations is N - ddof, where N represents the number of elements. By default ddof is zero.

dtype NPTypeCode?

Returns

NDArray

returns a new array containing the std values, otherwise a reference to the output array is returned.

Remarks

sum()

Sum of array elements into a scalar.

public NDArray sum()

Returns

NDArray

An array with the same shape as a, with the specified axis removed. If a is a 0-d array, or if axis is None, a scalar is returned. If an output array is specified, a reference to out is returned.

Remarks

sum(int)

Sum of array elements over a given axis.

public NDArray sum(int axis)

Parameters

axis int

Axis or axes along which a sum is performed. The default, axis=None, will sum all of the elements of the input array. If axis is negative it counts from the last to the first axis.

Returns

NDArray

An array with the same shape as a, with the specified axis removed. If a is a 0-d array, or if axis is None, a scalar is returned. If an output array is specified, a reference to out is returned.

Remarks

sum(int, bool, NPTypeCode?)

Sum of array elements over a given axis.

public NDArray sum(int axis, bool keepdims, NPTypeCode? typeCode = null)

Parameters

axis int

Axis or axes along which a sum is performed. The default, axis=None, will sum all of the elements of the input array. If axis is negative it counts from the last to the first axis.

keepdims bool

If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array. If the default value is passed, then keepdims will not be passed through to the sum method of sub-classes of ndarray, however any non-default value will be.If the sub-class’ method does not implement keepdims any exceptions will be raised.

typeCode NPTypeCode?

The type of the returned array and of the accumulator in which the elements are summed. The dtype of a is used by default unless a has an integer dtype of less precision than the default platform integer. In that case, if a is signed then the platform integer is used while if a is unsigned then an unsigned integer of the same precision as the platform integer is used.

Returns

NDArray

An array with the same shape as a, with the specified axis removed. If a is a 0-d array, or if axis is None, a scalar is returned. If an output array is specified, a reference to out is returned.

Remarks

sum(int, bool, Type)

Sum of array elements over a given axis.

public NDArray sum(int axis, bool keepdims, Type dtype)

Parameters

axis int

Axis or axes along which a sum is performed. The default, axis=None, will sum all of the elements of the input array. If axis is negative it counts from the last to the first axis.

keepdims bool

If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array. If the default value is passed, then keepdims will not be passed through to the sum method of sub-classes of ndarray, however any non-default value will be.If the sub-class’ method does not implement keepdims any exceptions will be raised.

dtype Type

The type of the returned array and of the accumulator in which the elements are summed. The dtype of a is used by default unless a has an integer dtype of less precision than the default platform integer. In that case, if a is signed then the platform integer is used while if a is unsigned then an unsigned integer of the same precision as the platform integer is used.

Returns

NDArray

An array with the same shape as a, with the specified axis removed. If a is a 0-d array, or if axis is None, a scalar is returned. If an output array is specified, a reference to out is returned.

Remarks

svd()

public (NDArray, NDArray, NDArray) svd()

Returns

(NDArray, NDArray, NDArray)

swapaxes(int, int)

Interchange two axes of an array.

public NDArray swapaxes(int axis1, int axis2)

Parameters

axis1 int

First axis.

axis2 int

Second axis.

Returns

NDArray

Remarks

tofile(string)

Write array to a file as text or binary (default).
Data is always written in ‘C’ order, independent of the order of a.
The data produced by this method can be recovered using the function fromfile().

public void tofile(string fid)

Parameters

fid string

An open file object, or a string containing a filename.

Remarks

transpose(int[])

Permute the dimensions of an array.

public NDArray transpose(int[] premute = null)

Parameters

premute int[]

By default, reverse the dimensions, otherwise permute the axes according to the values given.

Returns

NDArray

a with its axes permuted. A view is returned whenever possible.

Remarks

unique()

Find the unique elements of an array.

Returns the sorted unique elements of an array.There are three optional outputs in addition to the unique elements:

  • the indices of the input array that give the unique values
  • the indices of the unique array that reconstruct the input array
  • the number of times each unique value comes up in the input array
public NDArray unique()

Returns

NDArray

The sorted unique values.

Remarks

unique<T>()

Find the unique elements of an array.

Returns the sorted unique elements of an array.There are three optional outputs in addition to the unique elements:

  • the indices of the input array that give the unique values
  • the indices of the unique array that reconstruct the input array
  • the number of times each unique value comes up in the input array
protected NDArray unique<T>() where T : unmanaged

Returns

NDArray

Type Parameters

T

Remarks

var(bool, int?, NPTypeCode?)

Compute the standard deviation along the specified axis. Returns the standard deviation, a measure of the spread of a distribution, of the array elements. The standard deviation is computed for the flattened array by default, otherwise over the specified axis.

public NDArray var(bool keepdims = false, int? ddof = null, NPTypeCode? dtype = null)

Parameters

keepdims bool

If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.

ddof int?

Means Delta Degrees of Freedom. The divisor used in calculations is N - ddof, where N represents the number of elements. By default ddof is zero.

dtype NPTypeCode?

Returns

NDArray

returns a new array containing the std values, otherwise a reference to the output array is returned.

Remarks

var(int, bool, int?, NPTypeCode?)

Compute the standard deviation along the specified axis. Returns the standard deviation, a measure of the spread of a distribution, of the array elements. The standard deviation is computed for the flattened array by default, otherwise over the specified axis.

public NDArray var(int axis, bool keepdims = false, int? ddof = null, NPTypeCode? dtype = null)

Parameters

axis int

Axis or axes along which the standard deviation is computed. The default is to compute the standard deviation of the flattened array.

keepdims bool

If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.

ddof int?

Means Delta Degrees of Freedom. The divisor used in calculations is N - ddof, where N represents the number of elements. By default ddof is zero.

dtype NPTypeCode?

Returns

NDArray

returns a new array containing the std values, otherwise a reference to the output array is returned.

Remarks

view(Type)

New view of array with the same data.

public NDArray view(Type dtype = null)

Parameters

dtype Type

Data-type descriptor of the returned view, e.g., float32 or int16. The default, None, results in the view having the same data-type as a. This argument can also be specified as an ndarray sub-class, which then specifies the type of the returned object (this is equivalent to setting the type parameter).

Returns

NDArray

Remarks

view<T>()

New view of array with the same data.

public NDArray<T> view<T>() where T : unmanaged

Returns

NDArray<T>

Type Parameters

T

Remarks

vstack(params NDArray[])

Stack arrays in sequence vertically (row wise).
This is equivalent to concatenation along the first axis after 1-D arrays of shape(N,) have been reshaped to(1, N). Rebuilds arrays divided by vsplit.

public NDArray vstack(params NDArray[] tup)

Parameters

tup NDArray[]

The arrays must have the same shape along all but the first axis. 1-D arrays must have the same length.

Returns

NDArray

https://numpy.org/doc/stable/reference/generated/numpy.vstack.html

Operators

operator +(NDArray, NDArray)

public static NDArray operator +(NDArray x, NDArray y)

Parameters

x NDArray
y NDArray

Returns

NDArray

operator +(NDArray, bool)

public static NDArray operator +(NDArray left, bool right)

Parameters

left NDArray
right bool

Returns

NDArray

operator +(NDArray, byte)

public static NDArray operator +(NDArray left, byte right)

Parameters

left NDArray
right byte

Returns

NDArray

operator +(NDArray, char)

public static NDArray operator +(NDArray left, char right)

Parameters

left NDArray
right char

Returns

NDArray

operator +(NDArray, decimal)

public static NDArray operator +(NDArray left, decimal right)

Parameters

left NDArray
right decimal

Returns

NDArray

operator +(NDArray, double)

public static NDArray operator +(NDArray left, double right)

Parameters

left NDArray
right double

Returns

NDArray

operator +(NDArray, short)

public static NDArray operator +(NDArray left, short right)

Parameters

left NDArray
right short

Returns

NDArray

operator +(NDArray, int)

public static NDArray operator +(NDArray left, int right)

Parameters

left NDArray
right int

Returns

NDArray

operator +(NDArray, long)

public static NDArray operator +(NDArray left, long right)

Parameters

left NDArray
right long

Returns

NDArray

operator +(NDArray, float)

public static NDArray operator +(NDArray left, float right)

Parameters

left NDArray
right float

Returns

NDArray

operator +(NDArray, ushort)

public static NDArray operator +(NDArray left, ushort right)

Parameters

left NDArray
right ushort

Returns

NDArray

operator +(NDArray, uint)

public static NDArray operator +(NDArray left, uint right)

Parameters

left NDArray
right uint

Returns

NDArray

operator +(NDArray, ulong)

public static NDArray operator +(NDArray left, ulong right)

Parameters

left NDArray
right ulong

Returns

NDArray

operator +(bool, NDArray)

public static NDArray operator +(bool left, NDArray right)

Parameters

left bool
right NDArray

Returns

NDArray

operator +(byte, NDArray)

public static NDArray operator +(byte left, NDArray right)

Parameters

left byte
right NDArray

Returns

NDArray

operator +(char, NDArray)

public static NDArray operator +(char left, NDArray right)

Parameters

left char
right NDArray

Returns

NDArray

operator +(decimal, NDArray)

public static NDArray operator +(decimal left, NDArray right)

Parameters

left decimal
right NDArray

Returns

NDArray

operator +(double, NDArray)

public static NDArray operator +(double left, NDArray right)

Parameters

left double
right NDArray

Returns

NDArray

operator +(short, NDArray)

public static NDArray operator +(short left, NDArray right)

Parameters

left short
right NDArray

Returns

NDArray

operator +(int, NDArray)

public static NDArray operator +(int left, NDArray right)

Parameters

left int
right NDArray

Returns

NDArray

operator +(long, NDArray)

public static NDArray operator +(long left, NDArray right)

Parameters

left long
right NDArray

Returns

NDArray

operator +(float, NDArray)

public static NDArray operator +(float left, NDArray right)

Parameters

left float
right NDArray

Returns

NDArray

operator +(ushort, NDArray)

public static NDArray operator +(ushort left, NDArray right)

Parameters

left ushort
right NDArray

Returns

NDArray

operator +(uint, NDArray)

public static NDArray operator +(uint left, NDArray right)

Parameters

left uint
right NDArray

Returns

NDArray

operator +(ulong, NDArray)

public static NDArray operator +(ulong left, NDArray right)

Parameters

left ulong
right NDArray

Returns

NDArray

operator &(NDArray, NDArray)

public static NDArray<bool> operator &(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray<bool>

operator &(NDArray, byte)

public static NDArray<byte> operator &(NDArray lhs, byte rhs)

Parameters

lhs NDArray
rhs byte

Returns

NDArray<byte>

operator |(NDArray, NDArray)

public static NDArray operator |(NDArray np_, NDArray obj_)

Parameters

np_ NDArray
obj_ NDArray

Returns

NDArray

operator /(NDArray, NDArray)

public static NDArray operator /(NDArray x, NDArray y)

Parameters

x NDArray
y NDArray

Returns

NDArray

operator /(NDArray, bool)

public static NDArray operator /(NDArray left, bool right)

Parameters

left NDArray
right bool

Returns

NDArray

operator /(NDArray, byte)

public static NDArray operator /(NDArray left, byte right)

Parameters

left NDArray
right byte

Returns

NDArray

operator /(NDArray, char)

public static NDArray operator /(NDArray left, char right)

Parameters

left NDArray
right char

Returns

NDArray

operator /(NDArray, decimal)

public static NDArray operator /(NDArray left, decimal right)

Parameters

left NDArray
right decimal

Returns

NDArray

operator /(NDArray, double)

public static NDArray operator /(NDArray left, double right)

Parameters

left NDArray
right double

Returns

NDArray

operator /(NDArray, short)

public static NDArray operator /(NDArray left, short right)

Parameters

left NDArray
right short

Returns

NDArray

operator /(NDArray, int)

public static NDArray operator /(NDArray left, int right)

Parameters

left NDArray
right int

Returns

NDArray

operator /(NDArray, long)

public static NDArray operator /(NDArray left, long right)

Parameters

left NDArray
right long

Returns

NDArray

operator /(NDArray, float)

public static NDArray operator /(NDArray left, float right)

Parameters

left NDArray
right float

Returns

NDArray

operator /(NDArray, ushort)

public static NDArray operator /(NDArray left, ushort right)

Parameters

left NDArray
right ushort

Returns

NDArray

operator /(NDArray, uint)

public static NDArray operator /(NDArray left, uint right)

Parameters

left NDArray
right uint

Returns

NDArray

operator /(NDArray, ulong)

public static NDArray operator /(NDArray left, ulong right)

Parameters

left NDArray
right ulong

Returns

NDArray

operator /(bool, NDArray)

public static NDArray operator /(bool left, NDArray right)

Parameters

left bool
right NDArray

Returns

NDArray

operator /(byte, NDArray)

public static NDArray operator /(byte left, NDArray right)

Parameters

left byte
right NDArray

Returns

NDArray

operator /(char, NDArray)

public static NDArray operator /(char left, NDArray right)

Parameters

left char
right NDArray

Returns

NDArray

operator /(decimal, NDArray)

public static NDArray operator /(decimal left, NDArray right)

Parameters

left decimal
right NDArray

Returns

NDArray

operator /(double, NDArray)

public static NDArray operator /(double left, NDArray right)

Parameters

left double
right NDArray

Returns

NDArray

operator /(short, NDArray)

public static NDArray operator /(short left, NDArray right)

Parameters

left short
right NDArray

Returns

NDArray

operator /(int, NDArray)

public static NDArray operator /(int left, NDArray right)

Parameters

left int
right NDArray

Returns

NDArray

operator /(long, NDArray)

public static NDArray operator /(long left, NDArray right)

Parameters

left long
right NDArray

Returns

NDArray

operator /(float, NDArray)

public static NDArray operator /(float left, NDArray right)

Parameters

left float
right NDArray

Returns

NDArray

operator /(ushort, NDArray)

public static NDArray operator /(ushort left, NDArray right)

Parameters

left ushort
right NDArray

Returns

NDArray

operator /(uint, NDArray)

public static NDArray operator /(uint left, NDArray right)

Parameters

left uint
right NDArray

Returns

NDArray

operator /(ulong, NDArray)

public static NDArray operator /(ulong left, NDArray right)

Parameters

left ulong
right NDArray

Returns

NDArray

operator ==(NDArray, object)

public static NDArray<bool> operator ==(NDArray left, object right)

Parameters

left NDArray
right object

Returns

NDArray<bool>

explicit operator Array(NDArray)

public static explicit operator Array(NDArray nd)

Parameters

nd NDArray

Returns

Array

explicit operator string(NDArray)

public static explicit operator string(NDArray d)

Parameters

d NDArray

Returns

string

explicit operator ushort(NDArray)

public static explicit operator ushort(NDArray nd)

Parameters

nd NDArray

Returns

ushort

explicit operator NDArray(ushort)

public static explicit operator NDArray(ushort d)

Parameters

d ushort

Returns

NDArray

operator >(NDArray, int)

public static NDArray<bool> operator >(NDArray np, int obj)

Parameters

np NDArray
obj int

Returns

NDArray<bool>

operator >(NDArray, object)

public static NDArray<bool> operator >(NDArray np, object obj)

Parameters

np NDArray
obj object

Returns

NDArray<bool>

implicit operator bool(NDArray)

public static implicit operator bool(NDArray nd)

Parameters

nd NDArray

Returns

bool

implicit operator char(NDArray)

public static implicit operator char(NDArray nd)

Parameters

nd NDArray

Returns

char

implicit operator decimal(NDArray)

public static implicit operator decimal(NDArray nd)

Parameters

nd NDArray

Returns

decimal

implicit operator double(NDArray)

public static implicit operator double(NDArray nd)

Parameters

nd NDArray

Returns

double

implicit operator short(NDArray)

public static implicit operator short(NDArray nd)

Parameters

nd NDArray

Returns

short

implicit operator int(NDArray)

public static implicit operator int(NDArray nd)

Parameters

nd NDArray

Returns

int

implicit operator long(NDArray)

public static implicit operator long(NDArray nd)

Parameters

nd NDArray

Returns

long

implicit operator float(NDArray)

public static implicit operator float(NDArray nd)

Parameters

nd NDArray

Returns

float

implicit operator uint(NDArray)

public static implicit operator uint(NDArray nd)

Parameters

nd NDArray

Returns

uint

implicit operator ulong(NDArray)

public static implicit operator ulong(NDArray nd)

Parameters

nd NDArray

Returns

ulong

implicit operator NDArray(Array)

public static implicit operator NDArray(Array array)

Parameters

array Array

Returns

NDArray

implicit operator NDArray(bool)

public static implicit operator NDArray(bool d)

Parameters

d bool

Returns

NDArray

implicit operator NDArray(char)

public static implicit operator NDArray(char d)

Parameters

d char

Returns

NDArray

implicit operator NDArray(decimal)

public static implicit operator NDArray(decimal d)

Parameters

d decimal

Returns

NDArray

implicit operator NDArray(double)

public static implicit operator NDArray(double d)

Parameters

d double

Returns

NDArray

implicit operator NDArray(short)

public static implicit operator NDArray(short d)

Parameters

d short

Returns

NDArray

implicit operator NDArray(int)

public static implicit operator NDArray(int d)

Parameters

d int

Returns

NDArray

implicit operator NDArray(long)

public static implicit operator NDArray(long d)

Parameters

d long

Returns

NDArray

implicit operator NDArray(Complex)

public static implicit operator NDArray(Complex d)

Parameters

d Complex

Returns

NDArray

implicit operator NDArray(float)

public static implicit operator NDArray(float d)

Parameters

d float

Returns

NDArray

implicit operator NDArray(string)

public static implicit operator NDArray(string str)

Parameters

str string

Returns

NDArray

implicit operator NDArray(uint)

public static implicit operator NDArray(uint d)

Parameters

d uint

Returns

NDArray

implicit operator NDArray(ulong)

public static implicit operator NDArray(ulong d)

Parameters

d ulong

Returns

NDArray

operator !=(NDArray, object)

public static NDArray<bool> operator !=(NDArray np, object obj)

Parameters

np NDArray
obj object

Returns

NDArray<bool>

operator <(NDArray, int)

public static NDArray<bool> operator <(NDArray np, int obj)

Parameters

np NDArray
obj int

Returns

NDArray<bool>

operator <(NDArray, object)

public static NDArray<bool> operator <(NDArray np, object obj)

Parameters

np NDArray
obj object

Returns

NDArray<bool>

operator !(NDArray)

public static NDArray<bool> operator !(NDArray self)

Parameters

self NDArray

Returns

NDArray<bool>

operator %(NDArray, NDArray)

public static NDArray operator %(NDArray x, NDArray y)

Parameters

x NDArray
y NDArray

Returns

NDArray

operator %(NDArray, bool)

public static NDArray operator %(NDArray left, bool right)

Parameters

left NDArray
right bool

Returns

NDArray

operator %(NDArray, byte)

public static NDArray operator %(NDArray left, byte right)

Parameters

left NDArray
right byte

Returns

NDArray

operator %(NDArray, char)

public static NDArray operator %(NDArray left, char right)

Parameters

left NDArray
right char

Returns

NDArray

operator %(NDArray, decimal)

public static NDArray operator %(NDArray left, decimal right)

Parameters

left NDArray
right decimal

Returns

NDArray

operator %(NDArray, double)

public static NDArray operator %(NDArray left, double right)

Parameters

left NDArray
right double

Returns

NDArray

operator %(NDArray, short)

public static NDArray operator %(NDArray left, short right)

Parameters

left NDArray
right short

Returns

NDArray

operator %(NDArray, int)

public static NDArray operator %(NDArray left, int right)

Parameters

left NDArray
right int

Returns

NDArray

operator %(NDArray, long)

public static NDArray operator %(NDArray left, long right)

Parameters

left NDArray
right long

Returns

NDArray

operator %(NDArray, float)

public static NDArray operator %(NDArray left, float right)

Parameters

left NDArray
right float

Returns

NDArray

operator %(NDArray, ushort)

public static NDArray operator %(NDArray left, ushort right)

Parameters

left NDArray
right ushort

Returns

NDArray

operator %(NDArray, uint)

public static NDArray operator %(NDArray left, uint right)

Parameters

left NDArray
right uint

Returns

NDArray

operator %(NDArray, ulong)

public static NDArray operator %(NDArray left, ulong right)

Parameters

left NDArray
right ulong

Returns

NDArray

operator %(bool, NDArray)

public static NDArray operator %(bool left, NDArray right)

Parameters

left bool
right NDArray

Returns

NDArray

operator %(byte, NDArray)

public static NDArray operator %(byte left, NDArray right)

Parameters

left byte
right NDArray

Returns

NDArray

operator %(char, NDArray)

public static NDArray operator %(char left, NDArray right)

Parameters

left char
right NDArray

Returns

NDArray

operator %(decimal, NDArray)

public static NDArray operator %(decimal left, NDArray right)

Parameters

left decimal
right NDArray

Returns

NDArray

operator %(double, NDArray)

public static NDArray operator %(double left, NDArray right)

Parameters

left double
right NDArray

Returns

NDArray

operator %(short, NDArray)

public static NDArray operator %(short left, NDArray right)

Parameters

left short
right NDArray

Returns

NDArray

operator %(int, NDArray)

public static NDArray operator %(int left, NDArray right)

Parameters

left int
right NDArray

Returns

NDArray

operator %(long, NDArray)

public static NDArray operator %(long left, NDArray right)

Parameters

left long
right NDArray

Returns

NDArray

operator %(float, NDArray)

public static NDArray operator %(float left, NDArray right)

Parameters

left float
right NDArray

Returns

NDArray

operator %(ushort, NDArray)

public static NDArray operator %(ushort left, NDArray right)

Parameters

left ushort
right NDArray

Returns

NDArray

operator %(uint, NDArray)

public static NDArray operator %(uint left, NDArray right)

Parameters

left uint
right NDArray

Returns

NDArray

operator %(ulong, NDArray)

public static NDArray operator %(ulong left, NDArray right)

Parameters

left ulong
right NDArray

Returns

NDArray

operator *(NDArray, NDArray)

public static NDArray operator *(NDArray x, NDArray y)

Parameters

x NDArray
y NDArray

Returns

NDArray

operator *(NDArray, bool)

public static NDArray operator *(NDArray left, bool right)

Parameters

left NDArray
right bool

Returns

NDArray

operator *(NDArray, byte)

public static NDArray operator *(NDArray left, byte right)

Parameters

left NDArray
right byte

Returns

NDArray

operator *(NDArray, char)

public static NDArray operator *(NDArray left, char right)

Parameters

left NDArray
right char

Returns

NDArray

operator *(NDArray, decimal)

public static NDArray operator *(NDArray left, decimal right)

Parameters

left NDArray
right decimal

Returns

NDArray

operator *(NDArray, double)

public static NDArray operator *(NDArray left, double right)

Parameters

left NDArray
right double

Returns

NDArray

operator *(NDArray, short)

public static NDArray operator *(NDArray left, short right)

Parameters

left NDArray
right short

Returns

NDArray

operator *(NDArray, int)

public static NDArray operator *(NDArray left, int right)

Parameters

left NDArray
right int

Returns

NDArray

operator *(NDArray, long)

public static NDArray operator *(NDArray left, long right)

Parameters

left NDArray
right long

Returns

NDArray

operator *(NDArray, float)

public static NDArray operator *(NDArray left, float right)

Parameters

left NDArray
right float

Returns

NDArray

operator *(NDArray, ushort)

public static NDArray operator *(NDArray left, ushort right)

Parameters

left NDArray
right ushort

Returns

NDArray

operator *(NDArray, uint)

public static NDArray operator *(NDArray left, uint right)

Parameters

left NDArray
right uint

Returns

NDArray

operator *(NDArray, ulong)

public static NDArray operator *(NDArray left, ulong right)

Parameters

left NDArray
right ulong

Returns

NDArray

operator *(bool, NDArray)

public static NDArray operator *(bool left, NDArray right)

Parameters

left bool
right NDArray

Returns

NDArray

operator *(byte, NDArray)

public static NDArray operator *(byte left, NDArray right)

Parameters

left byte
right NDArray

Returns

NDArray

operator *(char, NDArray)

public static NDArray operator *(char left, NDArray right)

Parameters

left char
right NDArray

Returns

NDArray

operator *(decimal, NDArray)

public static NDArray operator *(decimal left, NDArray right)

Parameters

left decimal
right NDArray

Returns

NDArray

operator *(double, NDArray)

public static NDArray operator *(double left, NDArray right)

Parameters

left double
right NDArray

Returns

NDArray

operator *(short, NDArray)

public static NDArray operator *(short left, NDArray right)

Parameters

left short
right NDArray

Returns

NDArray

operator *(int, NDArray)

public static NDArray operator *(int left, NDArray right)

Parameters

left int
right NDArray

Returns

NDArray

operator *(long, NDArray)

public static NDArray operator *(long left, NDArray right)

Parameters

left long
right NDArray

Returns

NDArray

operator *(float, NDArray)

public static NDArray operator *(float left, NDArray right)

Parameters

left float
right NDArray

Returns

NDArray

operator *(ushort, NDArray)

public static NDArray operator *(ushort left, NDArray right)

Parameters

left ushort
right NDArray

Returns

NDArray

operator *(uint, NDArray)

public static NDArray operator *(uint left, NDArray right)

Parameters

left uint
right NDArray

Returns

NDArray

operator *(ulong, NDArray)

public static NDArray operator *(ulong left, NDArray right)

Parameters

left ulong
right NDArray

Returns

NDArray

operator -(NDArray, NDArray)

public static NDArray operator -(NDArray x, NDArray y)

Parameters

x NDArray
y NDArray

Returns

NDArray

operator -(NDArray, bool)

public static NDArray operator -(NDArray left, bool right)

Parameters

left NDArray
right bool

Returns

NDArray

operator -(NDArray, byte)

public static NDArray operator -(NDArray left, byte right)

Parameters

left NDArray
right byte

Returns

NDArray

operator -(NDArray, char)

public static NDArray operator -(NDArray left, char right)

Parameters

left NDArray
right char

Returns

NDArray

operator -(NDArray, decimal)

public static NDArray operator -(NDArray left, decimal right)

Parameters

left NDArray
right decimal

Returns

NDArray

operator -(NDArray, double)

public static NDArray operator -(NDArray left, double right)

Parameters

left NDArray
right double

Returns

NDArray

operator -(NDArray, short)

public static NDArray operator -(NDArray left, short right)

Parameters

left NDArray
right short

Returns

NDArray

operator -(NDArray, int)

public static NDArray operator -(NDArray left, int right)

Parameters

left NDArray
right int

Returns

NDArray

operator -(NDArray, long)

public static NDArray operator -(NDArray left, long right)

Parameters

left NDArray
right long

Returns

NDArray

operator -(NDArray, float)

public static NDArray operator -(NDArray left, float right)

Parameters

left NDArray
right float

Returns

NDArray

operator -(NDArray, ushort)

public static NDArray operator -(NDArray left, ushort right)

Parameters

left NDArray
right ushort

Returns

NDArray

operator -(NDArray, uint)

public static NDArray operator -(NDArray left, uint right)

Parameters

left NDArray
right uint

Returns

NDArray

operator -(NDArray, ulong)

public static NDArray operator -(NDArray left, ulong right)

Parameters

left NDArray
right ulong

Returns

NDArray

operator -(bool, NDArray)

public static NDArray operator -(bool left, NDArray right)

Parameters

left bool
right NDArray

Returns

NDArray

operator -(byte, NDArray)

public static NDArray operator -(byte left, NDArray right)

Parameters

left byte
right NDArray

Returns

NDArray

operator -(char, NDArray)

public static NDArray operator -(char left, NDArray right)

Parameters

left char
right NDArray

Returns

NDArray

operator -(decimal, NDArray)

public static NDArray operator -(decimal left, NDArray right)

Parameters

left decimal
right NDArray

Returns

NDArray

operator -(double, NDArray)

public static NDArray operator -(double left, NDArray right)

Parameters

left double
right NDArray

Returns

NDArray

operator -(short, NDArray)

public static NDArray operator -(short left, NDArray right)

Parameters

left short
right NDArray

Returns

NDArray

operator -(int, NDArray)

public static NDArray operator -(int left, NDArray right)

Parameters

left int
right NDArray

Returns

NDArray

operator -(long, NDArray)

public static NDArray operator -(long left, NDArray right)

Parameters

left long
right NDArray

Returns

NDArray

operator -(float, NDArray)

public static NDArray operator -(float left, NDArray right)

Parameters

left float
right NDArray

Returns

NDArray

operator -(ushort, NDArray)

public static NDArray operator -(ushort left, NDArray right)

Parameters

left ushort
right NDArray

Returns

NDArray

operator -(uint, NDArray)

public static NDArray operator -(uint left, NDArray right)

Parameters

left uint
right NDArray

Returns

NDArray

operator -(ulong, NDArray)

public static NDArray operator -(ulong left, NDArray right)

Parameters

left ulong
right NDArray

Returns

NDArray

operator -(NDArray)

public static NDArray operator -(NDArray x)

Parameters

x NDArray

Returns

NDArray

operator +(NDArray)

public static NDArray operator +(NDArray x)

Parameters

x NDArray

Returns

NDArray