Table of Contents

Class np

Namespace
NumSharp
Assembly
NumSharp.dll

API bridge between NumSharp and Python NumPy

[SuppressMessage("ReSharper", "StaticMemberInitializerReferesToMemberBelow")]
public static class np
Inheritance
np
Inherited Members

Fields

bool

public static readonly Type @bool

Field Value

Type

bool8

public static readonly Type bool8

Field Value

Type

bool_

public static readonly Type bool_

Field Value

Type

byte

public static readonly Type @byte

Field Value

Type

char

public static readonly Type @char

Field Value

Type

complex128

public static readonly Type complex128

Field Value

Type

complex64

public static readonly Type complex64

Field Value

Type

complex_

public static readonly Type complex_

Field Value

Type

decimal

public static readonly Type @decimal

Field Value

Type

double

public static readonly Type @double

Field Value

Type

float32

public static readonly Type float32

Field Value

Type

float64

public static readonly Type float64

Field Value

Type

float_

public static readonly Type float_

Field Value

Type

int0

public static readonly Type int0

Field Value

Type

int16

public static readonly Type int16

Field Value

Type

int32

public static readonly Type int32

Field Value

Type

int64

public static readonly Type int64

Field Value

Type

int_

public static readonly Type int_

Field Value

Type

intp

public static readonly Type intp

Field Value

Type

newaxis

A convenient alias for None, useful for indexing arrays.

public static readonly Slice newaxis

Field Value

Slice

Remarks

https://numpy.org/doc/stable/user/basics.indexing.html

https://stackoverflow.com/questions/42190783/what-does-three-dots-in-python-mean-when-indexing-what-looks-like-a-number

ubyte

public static readonly Type ubyte

Field Value

Type

uint

public static readonly Type @uint

Field Value

Type

uint0

public static readonly Type uint0

Field Value

Type

uint16

public static readonly Type uint16

Field Value

Type

uint32

public static readonly Type uint32

Field Value

Type

uint64

public static readonly Type uint64

Field Value

Type

uint8

public static readonly Type uint8

Field Value

Type

Properties

BackendEngine

public static BackendType BackendEngine { get; set; }

Property Value

BackendType

Inf

public static double Inf { get; }

Property Value

double

Infinity

public static double Infinity { get; }

Property Value

double

NAN

public static double NAN { get; }

Property Value

double

NINF

public static double NINF { get; }

Property Value

double

NaN

public static double NaN { get; }

Property Value

double

PINF

public static double PINF { get; }

Property Value

double

chars

public static Type chars { get; }

Property Value

Type

e

public static double e { get; }

Property Value

double

euler_gamma

public static double euler_gamma { get; }

Property Value

double

inf

public static double inf { get; }

Property Value

double

infinity

public static double infinity { get; }

Property Value

double

infty

public static double infty { get; }

Property Value

double

nan

public static double nan { get; }

Property Value

double

pi

public static double pi { get; }

Property Value

double

random

public static NumPyRandom random { get; }

Property Value

NumPyRandom

Methods

LoadJagged(byte[])

public static Array LoadJagged(byte[] bytes)

Parameters

bytes byte[]

Returns

Array

LoadJagged(Stream, bool)

public static Array LoadJagged(Stream stream, bool trim = true)

Parameters

stream Stream
trim bool

Returns

Array

LoadJagged(string)

public static Array LoadJagged(string path)

Parameters

path string

Returns

Array

LoadJagged_Npz(byte[])

public static NpzDictionary<Array> LoadJagged_Npz(byte[] bytes)

Parameters

bytes byte[]

Returns

NpzDictionary<Array>

LoadJagged_Npz(Stream, bool)

public static NpzDictionary<Array> LoadJagged_Npz(Stream stream, bool trim = true)

Parameters

stream Stream
trim bool

Returns

NpzDictionary<Array>

LoadJagged_Npz(string)

public static NpzDictionary<Array> LoadJagged_Npz(string path)

Parameters

path string

Returns

NpzDictionary<Array>

LoadMatrix(byte[])

public static Array LoadMatrix(byte[] bytes)

Parameters

bytes byte[]

Returns

Array

LoadMatrix(Stream)

public static Array LoadMatrix(Stream stream)

Parameters

stream Stream

Returns

Array

LoadMatrix(string)

public static Array LoadMatrix(string path)

Parameters

path string

Returns

Array

LoadMatrix_Npz(byte[])

public static NpzDictionary<Array> LoadMatrix_Npz(byte[] bytes)

Parameters

bytes byte[]

Returns

NpzDictionary<Array>

LoadMatrix_Npz(Stream)

public static NpzDictionary<Array> LoadMatrix_Npz(Stream stream)

Parameters

stream Stream

Returns

NpzDictionary<Array>

LoadMatrix_Npz(string)

public static NpzDictionary<Array> LoadMatrix_Npz(string path)

Parameters

path string

Returns

NpzDictionary<Array>

Load_Npz<T>(byte[])

public static NpzDictionary<T> Load_Npz<T>(byte[] bytes) where T : class, ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable

Parameters

bytes byte[]

Returns

NpzDictionary<T>

Type Parameters

T

Load_Npz<T>(byte[], out T)

public static void Load_Npz<T>(byte[] bytes, out T value) where T : class, ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable

Parameters

bytes byte[]
value T

Type Parameters

T

Load_Npz<T>(Stream)

public static NpzDictionary<T> Load_Npz<T>(Stream stream) where T : class, ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable

Parameters

stream Stream

Returns

NpzDictionary<T>

Type Parameters

T

Load_Npz<T>(Stream, out NpzDictionary<T>)

public static NpzDictionary<T> Load_Npz<T>(Stream stream, out NpzDictionary<T> value) where T : class, ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable

Parameters

stream Stream
value NpzDictionary<T>

Returns

NpzDictionary<T>

Type Parameters

T

Load_Npz<T>(Stream, out T)

public static void Load_Npz<T>(Stream stream, out T value) where T : class, ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable

Parameters

stream Stream
value T

Type Parameters

T

Load_Npz<T>(string)

public static NpzDictionary<T> Load_Npz<T>(string path) where T : class, ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable

Parameters

path string

Returns

NpzDictionary<T>

Type Parameters

T

Load_Npz<T>(string, out NpzDictionary<T>)

public static NpzDictionary<T> Load_Npz<T>(string path, out NpzDictionary<T> value) where T : class, ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable

Parameters

path string
value NpzDictionary<T>

Returns

NpzDictionary<T>

Type Parameters

T

Load_Npz<T>(string, out T)

public static void Load_Npz<T>(string path, out T value) where T : class, ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable

Parameters

path string
value T

Type Parameters

T

Load<T>(byte[])

public static T Load<T>(byte[] bytes) where T : class, ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable

Parameters

bytes byte[]

Returns

T

Type Parameters

T

Load<T>(byte[], out T)

public static T Load<T>(byte[] bytes, out T value) where T : class, ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable

Parameters

bytes byte[]
value T

Returns

T

Type Parameters

T

Load<T>(Stream)

public static T Load<T>(Stream stream) where T : class, ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable

Parameters

stream Stream

Returns

T

Type Parameters

T

Load<T>(Stream, out T)

public static T Load<T>(Stream stream, out T value) where T : class, ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable

Parameters

stream Stream
value T

Returns

T

Type Parameters

T

Load<T>(string)

public static T Load<T>(string path) where T : class, ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable

Parameters

path string

Returns

T

Type Parameters

T

Load<T>(string, out T)

public static T Load<T>(string path, out T value) where T : class, ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable

Parameters

path string
value T

Returns

T

Type Parameters

T

Save(Array)

public static byte[] Save(Array array)

Parameters

array Array

Returns

byte[]

Save(Array, Stream)

public static ulong Save(Array array, Stream stream)

Parameters

array Array
stream Stream

Returns

ulong

Save(Array, string)

public static ulong Save(Array array, string path)

Parameters

array Array
path string

Returns

ulong

Save_Npz(Array, CompressionLevel)

public static byte[] Save_Npz(Array array, CompressionLevel compression = CompressionLevel.Fastest)

Parameters

array Array
compression CompressionLevel

Returns

byte[]

Save_Npz(Array, Stream, CompressionLevel, bool)

public static void Save_Npz(Array array, Stream stream, CompressionLevel compression = CompressionLevel.Fastest, bool leaveOpen = false)

Parameters

array Array
stream Stream
compression CompressionLevel
leaveOpen bool

Save_Npz(Array, string, CompressionLevel)

public static void Save_Npz(Array array, string path, CompressionLevel compression = CompressionLevel.Fastest)

Parameters

array Array
path string
compression CompressionLevel

Save_Npz(Dictionary<string, Array>, CompressionLevel)

public static byte[] Save_Npz(Dictionary<string, Array> arrays, CompressionLevel compression = CompressionLevel.Fastest)

Parameters

arrays Dictionary<string, Array>
compression CompressionLevel

Returns

byte[]

Save_Npz(Dictionary<string, Array>, Stream, CompressionLevel, bool)

public static void Save_Npz(Dictionary<string, Array> arrays, Stream stream, CompressionLevel compression = CompressionLevel.Fastest, bool leaveOpen = false)

Parameters

arrays Dictionary<string, Array>
stream Stream
compression CompressionLevel
leaveOpen bool

Save_Npz(Dictionary<string, Array>, string, CompressionLevel)

public static void Save_Npz(Dictionary<string, Array> arrays, string path, CompressionLevel compression = CompressionLevel.Fastest)

Parameters

arrays Dictionary<string, Array>
path string
compression CompressionLevel

abs(in NDArray)

Calculate the absolute value element-wise.
np.abs is a shorthand for this function.

public static NDArray abs(in NDArray a)

Parameters

a NDArray

Input value.

Returns

NDArray

An ndarray containing the absolute value of each element in x.

Remarks

abs(in NDArray, NPTypeCode?)

Calculate the absolute value element-wise.
np.abs is a shorthand for this function.

public static NDArray abs(in NDArray a, NPTypeCode? outType)

Parameters

a NDArray

Input value.

outType NPTypeCode?

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

An ndarray containing the absolute value of each element in x.

Remarks

abs(in NDArray, Type)

Calculate the absolute value element-wise.
np.abs is a shorthand for this function.

public static NDArray abs(in NDArray a, Type outType)

Parameters

a NDArray

Input value.

outType Type

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

An ndarray containing the absolute value of each element in x.

Remarks

absolute(in NDArray)

Calculate the absolute value element-wise.
np.abs is a shorthand for this function.

public static NDArray absolute(in NDArray a)

Parameters

a NDArray

Input value.

Returns

NDArray

An ndarray containing the absolute value of each element in x.

Remarks

absolute(in NDArray, NPTypeCode?)

Calculate the absolute value element-wise.
np.abs is a shorthand for this function.

public static NDArray absolute(in NDArray a, NPTypeCode? outType)

Parameters

a NDArray

Input value.

outType NPTypeCode?

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

An ndarray containing the absolute value of each element in x.

Remarks

absolute(in NDArray, Type)

Calculate the absolute value element-wise.
np.abs is a shorthand for this function.

public static NDArray absolute(in NDArray a, Type outType)

Parameters

a NDArray

Input value.

outType Type

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

An ndarray containing the absolute value of each element in x.

Remarks

add(in NDArray, in NDArray)

public static NDArray add(in NDArray x1, in NDArray x2)

Parameters

x1 NDArray
x2 NDArray

Returns

NDArray

Remarks

all(NDArray)

Test whether all array elements along a given axis evaluate to True.

public static bool all(NDArray a)

Parameters

a NDArray

Input array or object that can be converted to an array.

Returns

bool

A new boolean or ndarray is returned unless out is specified, in which case a reference to out is returned.

Remarks

all(NDArray, int, bool)

Test whether all array elements along a given axis evaluate to True.

public static NDArray<bool> all(NDArray nd, int axis, bool keepdims = false)

Parameters

nd NDArray
axis int

Axis or axes along which a logical AND reduction is performed. The default (axis = None) is to perform a logical OR over all the dimensions of the input array. axis may be negative, in which case it counts from the last to the first axis.

keepdims bool

Returns

NDArray<bool>

A new boolean or ndarray is returned unless out is specified, in which case a reference to out is returned.

Remarks

allclose(NDArray, NDArray, double, double, bool)

Returns True if two arrays are element-wise equal within a tolerance. The tolerance values are positive, typically very small numbers.The

relative difference (rtol * abs(b)) and the absolute difference atol are added together to compare against the absolute difference between a and b. If either array contains one or more NaNs, False is returned. Infs are treated as equal if they are in the same place and of the same sign in both arrays.

public static bool allclose(NDArray a, NDArray b, double rtol = 1E-05, double atol = 1E-08, bool equal_nan = false)

Parameters

a NDArray

Input array to compare with b

b NDArray

Input array to compare with a.

rtol double

The relative tolerance parameter(see Notes)

atol double

The absolute tolerance parameter(see Notes)

equal_nan bool

Whether to compare NaN's as equal. If True, NaN's in a will be considered equal to NaN's in b in the output array.

Returns

bool

amax(NDArray, int?, bool, Type)

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

public static NDArray amax(NDArray a, int? axis = null, bool keepdims = false, Type dtype = null)

Parameters

a NDArray
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<T>(NDArray)

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

public static T amax<T>(NDArray a) where T : unmanaged

Parameters

a NDArray

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 type expected as a return, cast is performed if necessary.

Remarks

amin(in NDArray, int?, bool, Type)

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

public static NDArray amin(in NDArray a, int? axis = null, bool keepdims = false, Type dtype = null)

Parameters

a NDArray

Input data.

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<T>(in NDArray)

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

public static T amin<T>(in NDArray a) where T : unmanaged

Parameters

a NDArray

Input data.

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 type expected as a return, cast is performed if necessary.

Remarks

any(NDArray)

Test whether any array element along a given axis evaluates to True.

public static bool any(NDArray a)

Parameters

a NDArray

Input array or object that can be converted to an array.

Returns

bool

A new boolean or ndarray is returned unless out is specified, in which case a reference to out is returned.

Remarks

any(NDArray, int, bool)

Test whether any array element along a given axis evaluates to True.

public static NDArray<bool> any(NDArray nd, int axis, bool keepdims)

Parameters

nd NDArray
axis int

Axis or axes along which a logical OR reduction is performed. The default (axis = None) is to perform a logical OR over all the dimensions of the input array. axis may be negative, in which case it counts from the last to the first axis.

keepdims bool

Returns

NDArray<bool>

A new boolean or ndarray is returned unless out is specified, in which case a reference to out is returned.

Remarks

arange(double)

Return evenly spaced values within a given interval.

Values are generated within the half-open interval [start, stop) (in other words, the interval including start but excluding stop). For integer arguments the function is equivalent to the Python built-in range function, but returns an ndarray rather than a list.

When using a non-integer step, such as 0.1, the results will often not be consistent. It is better to use numpy.linspace for these cases.

public static NDArray arange(double stop)

Parameters

stop double

End of interval. The interval does not include this value, except in some cases where step is not an integer and floating point round-off affects the length of out.

Returns

NDArray

Array of evenly spaced values.

For floating point arguments, the length of the result is ceil((stop - start)/step). Because of floating point overflow, this rule may result in the last element of out being greater than stop.

arange(double, double, double)

Return evenly spaced values within a given interval.

Values are generated within the half-open interval [start, stop) (in other words, the interval including start but excluding stop). For integer arguments the function is equivalent to the Python built-in range function, but returns an ndarray rather than a list.

When using a non-integer step, such as 0.1, the results will often not be consistent. It is better to use numpy.linspace for these cases.

public static NDArray arange(double start, double stop, double step = 1)

Parameters

start double

Start of interval. The interval includes this value. The default start value is 0.

stop double

End of interval. The interval does not include this value, except in some cases where step is not an integer and floating point round-off affects the length of out.

step double

Spacing between values. For any output out, this is the distance between two adjacent values, out[i+1] - out[i]. The default step size is 1. If step is specified as a position argument, start must also be given.

Returns

NDArray

Array of evenly spaced values.

For floating point arguments, the length of the result is ceil((stop - start)/step). Because of floating point overflow, this rule may result in the last element of out being greater than stop.

arange(int)

Return evenly spaced values within a given interval.

Values are generated within the half-open interval [start, stop) (in other words, the interval including start but excluding stop). For integer arguments the function is equivalent to the Python built-in range function, but returns an ndarray rather than a list.

When using a non-integer step, such as 0.1, the results will often not be consistent. It is better to use numpy.linspace for these cases.

public static NDArray arange(int stop)

Parameters

stop int

End of interval. The interval does not include this value, except in some cases where step is not an integer and floating point round-off affects the length of out.

Returns

NDArray

Array of evenly spaced values.

For floating point arguments, the length of the result is ceil((stop - start)/step). Because of floating point overflow, this rule may result in the last element of out being greater than stop.

arange(int, int, int)

Return evenly spaced values within a given interval.

Values are generated within the half-open interval [start, stop) (in other words, the interval including start but excluding stop). For integer arguments the function is equivalent to the Python built-in range function, but returns an ndarray rather than a list.

When using a non-integer step, such as 0.1, the results will often not be consistent. It is better to use numpy.linspace for these cases.

public static NDArray arange(int start, int stop, int step = 1)

Parameters

start int

Start of interval. The interval includes this value. The default start value is 0.

stop int

End of interval. The interval does not include this value, except in some cases where step is not an integer and floating point round-off affects the length of out.

step int

Spacing between values. For any output out, this is the distance between two adjacent values, out[i+1] - out[i]. The default step size is 1. If step is specified as a position argument, start must also be given.

Returns

NDArray

Array of evenly spaced values.

For floating point arguments, the length of the result is ceil((stop - start)/step). Because of floating point overflow, this rule may result in the last element of out being greater than stop.

arange(float)

Return evenly spaced values within a given interval.

Values are generated within the half-open interval [start, stop) (in other words, the interval including start but excluding stop). For integer arguments the function is equivalent to the Python built-in range function, but returns an ndarray rather than a list.

When using a non-integer step, such as 0.1, the results will often not be consistent. It is better to use numpy.linspace for these cases.

public static NDArray arange(float stop)

Parameters

stop float

End of interval. The interval does not include this value, except in some cases where step is not an integer and floating point round-off affects the length of out.

Returns

NDArray

Array of evenly spaced values.

For floating point arguments, the length of the result is ceil((stop - start)/step). Because of floating point overflow, this rule may result in the last element of out being greater than stop.

arange(float, float, float)

Return evenly spaced values within a given interval.

Values are generated within the half-open interval [start, stop) (in other words, the interval including start but excluding stop). For integer arguments the function is equivalent to the Python built-in range function, but returns an ndarray rather than a list.

When using a non-integer step, such as 0.1, the results will often not be consistent. It is better to use numpy.linspace for these cases.

public static NDArray arange(float start, float stop, float step = 1)

Parameters

start float

Start of interval. The interval includes this value. The default start value is 0.

stop float

End of interval. The interval does not include this value, except in some cases where step is not an integer and floating point round-off affects the length of out.

step float

Spacing between values. For any output out, this is the distance between two adjacent values, out[i+1] - out[i]. The default step size is 1. If step is specified as a position argument, start must also be given.

Returns

NDArray

Array of evenly spaced values.

For floating point arguments, the length of the result is ceil((stop - start)/step). Because of floating point overflow, this rule may result in the last element of out being greater than stop.

arccos(in NDArray, NPTypeCode?)

Trigonometric inverse cosine, element-wise.
The inverse of cos so that, if y = cos(x), then x = arccos(y).

public static NDArray arccos(in NDArray x, NPTypeCode? outType = null)

Parameters

x NDArray

Input array.

outType NPTypeCode?

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

The angle of the ray intersecting the unit circle at the given x-coordinate in radians [0, pi]. This is a scalar if x is a scalar.

Remarks

arccos(in NDArray, Type)

Trigonometric inverse cosine, element-wise.
The inverse of cos so that, if y = cos(x), then x = arccos(y).

public static NDArray arccos(in NDArray x, Type outType)

Parameters

x NDArray

Input array.

outType Type

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

The angle of the ray intersecting the unit circle at the given x-coordinate in radians [0, pi]. This is a scalar if x is a scalar.

Remarks

arcsin(in NDArray, NPTypeCode?)

Inverse sine, element-wise.
The convention is to return the angle z whose real part lies in [-pi/2, pi/2].

public static NDArray arcsin(in NDArray x, NPTypeCode? outType = null)

Parameters

x NDArray

Input array.

outType NPTypeCode?

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

The inverse sine of each element in x, in radians and in the closed interval [-pi/2, pi/2]. This is a scalar if x is a scalar.

Remarks

arcsin(in NDArray, Type)

Inverse sine, element-wise.
The convention is to return the angle z whose real part lies in [-pi/2, pi/2].

public static NDArray arcsin(in NDArray x, Type outType)

Parameters

x NDArray

Input array.

outType Type

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

The inverse sine of each element in x, in radians and in the closed interval [-pi/2, pi/2]. This is a scalar if x is a scalar.

Remarks

arctan(in NDArray, NPTypeCode?)

Compute trigonometric inverse tangent, element-wise.
The inverse of tan, so that if y = tan(x) then x = arctan(y).

public static NDArray arctan(in NDArray x, NPTypeCode? outType = null)

Parameters

x NDArray

Input array.

outType NPTypeCode?

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

Return has the same shape as x. Its real part is in [-pi/2, pi/2] (arctan(+/-inf) returns +/-pi/2). This is a scalar if x is a scalar.

Remarks

arctan(in NDArray, Type)

Compute trigonometric inverse tangent, element-wise.
The inverse of tan, so that if y = tan(x) then x = arctan(y).

public static NDArray arctan(in NDArray x, Type outType)

Parameters

x NDArray

Input array.

outType Type

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

Return has the same shape as x. Its real part is in [-pi/2, pi/2] (arctan(+/-inf) returns +/-pi/2). This is a scalar if x is a scalar.

Remarks

arctan2(in NDArray, in NDArray, NPTypeCode?)

Compute Element-wise arc tangent of x1/x2 choosing the quadrant correctly.
By IEEE convention, this function is defined for x2 = +/-0 and for either or both of x1 and x2 = +/-inf

public static NDArray arctan2(in NDArray y, in NDArray x, NPTypeCode? outType = null)

Parameters

y NDArray
x NDArray

Input array y-coordinates.

outType NPTypeCode?

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

The Array of angles in radians, in the range [-pi, pi]. This is a scalar if both x1 and x2 are scalars.

Remarks

arctan2(in NDArray, in NDArray, Type)

Compute Element-wise arc tangent of x1/x2 choosing the quadrant correctly.
By IEEE convention, this function is defined for x2 = +/-0 and for either or both of x1 and x2 = +/-inf

public static NDArray arctan2(in NDArray y, in NDArray x, Type outType)

Parameters

y NDArray
x NDArray

Input array y-coordinates.

outType Type

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

The Array of angles in radians, in the range [-pi, pi]. This is a scalar if both x1 and x2 are scalars.

Remarks

are_broadcastable(NDArray, NDArray)

Tests if these two two arrays are broadcastable against each other.

public static bool are_broadcastable(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray

An array to test for broadcasting.

rhs NDArray

An array to test for broadcasting.

Returns

bool

True if these can be broadcasted against each other.

Remarks

are_broadcastable(params NDArray[])

Tests if these two two arrays are broadcastable against each other.

public static bool are_broadcastable(params NDArray[] ndArrays)

Parameters

ndArrays NDArray[]

The arrays to test for broadcasting.

Returns

bool

True if these can be broadcasted against each other.

Remarks

are_broadcastable(params Shape[])

Tests if these two two arrays are broadcastable against each other.

public static bool are_broadcastable(params Shape[] shapes)

Parameters

shapes Shape[]

The shapes to test for broadcasting.

Returns

bool

True if these can be broadcasted against each other.

Remarks

are_broadcastable(params int[][])

Tests if these two two arrays are broadcastable against each other.

public static bool are_broadcastable(params int[][] shapes)

Parameters

shapes int[][]

The shapes to test for broadcasting.

Returns

bool

True if these can be broadcasted against each other.

Remarks

argmax(NDArray)

Returns the index of the maximum value.

public static int argmax(NDArray a)

Parameters

a NDArray

Input array.

Returns

int

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

Remarks

argmax(NDArray, int)

Returns the indices of the maximum values along an axis.

public static NDArray argmax(NDArray a, int axis)

Parameters

a NDArray

Input array.

axis int

By default, the index is into the flattened array, otherwise along the specified axis.

Returns

NDArray

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

Remarks

argmin(NDArray)

Returns the index of the minimum value.

public static int argmin(NDArray a)

Parameters

a NDArray

Input array.

Returns

int

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

Remarks

argmin(NDArray, int)

Returns the indices of the minimum values along an axis.

public static NDArray argmin(NDArray a, int axis)

Parameters

a NDArray

Input array.

axis int

By default, the index is into the flattened array, otherwise along the specified axis.

Returns

NDArray

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

Remarks

argsort<T>(NDArray, 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 static NDArray argsort<T>(NDArray nd, int axis = -1)

Parameters

nd NDArray
axis int

Returns

NDArray

Type Parameters

T

around(in NDArray, int, NPTypeCode?)

Evenly round to the given number of decimals.

public static NDArray around(in NDArray x, int decimals, NPTypeCode? outType = null)

Parameters

x NDArray

Input array

decimals int

Number of decimal places to round to

outType NPTypeCode?

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

An array of the same type as a, containing the rounded values. Unless out was specified, a new array is created. A reference to the result is returned. The real and imaginary parts of complex numbers are rounded separately.The result of rounding a float is a float.

Remarks

around(in NDArray, int, Type)

Evenly round to the given number of decimals.

public static NDArray around(in NDArray x, int decimals, Type outType)

Parameters

x NDArray

Input array

decimals int

Number of decimal places to round to

outType Type

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

An array of the same type as a, containing the rounded values. Unless out was specified, a new array is created. A reference to the result is returned. The real and imaginary parts of complex numbers are rounded separately.The result of rounding a float is a float.

Remarks

around(in NDArray, NPTypeCode?)

Evenly round to the given number of decimals.

public static NDArray around(in NDArray x, NPTypeCode? outType = null)

Parameters

x NDArray

Input array

outType NPTypeCode?

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

An array of the same type as a, containing the rounded values. Unless out was specified, a new array is created. A reference to the result is returned. The real and imaginary parts of complex numbers are rounded separately.The result of rounding a float is a float.

Remarks

around(in NDArray, Type)

Evenly round to the given number of decimals.

public static NDArray around(in NDArray x, Type outType)

Parameters

x NDArray

Input array

outType Type

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

An array of the same type as a, containing the rounded values. Unless out was specified, a new array is created. A reference to the result is returned. The real and imaginary parts of complex numbers are rounded separately.The result of rounding a float is a float.

Remarks

array(NDArray, bool)

Wraps given nd in an alias. If copy is true then returns a clone.

public static NDArray array(NDArray nd, bool copy = false)

Parameters

nd NDArray
copy bool

If copy is true then returns a clone.

Returns

NDArray

array(Array, Type, int, bool, char)

Creates an NDArray from an array with an unknown size or dtype.

[SuppressMessage("ReSharper", "InvalidXmlDocComment")]
public static NDArray array(Array array, Type dtype = null, int ndmin = 1, bool copy = true, char order = 'C')

Parameters

array Array
dtype Type
ndmin int

Specifies the minimum number of dimensions that the resulting array should have. Ones will be pre-pended to the shape as needed to meet this requirement.

copy bool

Always copies if the array is larger than 1-d.

order char

Not used.

Returns

NDArray

Remarks

array(string)

Create a vector NDArray of dtype char.

public static NDArray array(string chars)

Parameters

chars string

Returns

NDArray

array(string[])

Create a vector ndarray of type <xref href="System.String" data-throw-if-not-resolved="false"></xref>.

Encode string array. format: [numOfRow lenOfRow1 lenOfRow2 contents] sample: [2 2 4 aacccc]

public static NDArray array(string[] strArray)

Parameters

strArray string[]

Returns

NDArray

array_equal(NDArray, NDArray)

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

public static bool array_equal(NDArray a, NDArray b)

Parameters

a NDArray

Input array.

b NDArray

Input array.

Returns

bool

Returns True if the arrays are equal.

Remarks

array<T>(IEnumerable<T>)

Creates a Vector NDArray from given data.

public static NDArray array<T>(IEnumerable<T> data) where T : unmanaged

Parameters

data IEnumerable<T>

The enumeration of data to create NDArray from.

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

array<T>(IEnumerable<T>, int)

Creates a Vector NDArray from given data.

public static NDArray array<T>(IEnumerable<T> data, int size) where T : unmanaged

Parameters

data IEnumerable<T>

The enumeration of data to create NDArray from.

size int

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

https://numpy.org/doc/stable/reference/generated/numpy.array.html
Always performs a copy.
size can be used to limit the amount of items to read form data. Reading stops on either size or data ends.

array<T>(T[,,,,,,,,,,,,,,,], bool)

Creates an NDArray from given data.

public static NDArray array<T>(T[,,,,,,,,,,,,,,,] data, bool copy = true) where T : unmanaged

Parameters

data T[,,,,,,,,,,,,,,,]

The array to create NDArray from.

copy bool

If true then the array will be copied to a newly allocated memory.
If false then the array will be pinned by calling Alloc(object).

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

array<T>(T[,,,,,,,,,,,,,,], bool)

Creates an NDArray from given data.

public static NDArray array<T>(T[,,,,,,,,,,,,,,] data, bool copy = true) where T : unmanaged

Parameters

data T[,,,,,,,,,,,,,,]

The array to create NDArray from.

copy bool

If true then the array will be copied to a newly allocated memory.
If false then the array will be pinned by calling Alloc(object).

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

array<T>(T[,,,,,,,,,,,,,], bool)

Creates an NDArray from given data.

public static NDArray array<T>(T[,,,,,,,,,,,,,] data, bool copy = true) where T : unmanaged

Parameters

data T[,,,,,,,,,,,,,]

The array to create NDArray from.

copy bool

If true then the array will be copied to a newly allocated memory.
If false then the array will be pinned by calling Alloc(object).

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

array<T>(T[,,,,,,,,,,,,], bool)

Creates an NDArray from given data.

public static NDArray array<T>(T[,,,,,,,,,,,,] data, bool copy = true) where T : unmanaged

Parameters

data T[,,,,,,,,,,,,]

The array to create NDArray from.

copy bool

If true then the array will be copied to a newly allocated memory.
If false then the array will be pinned by calling Alloc(object).

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

array<T>(T[,,,,,,,,,,,], bool)

Creates an NDArray from given data.

public static NDArray array<T>(T[,,,,,,,,,,,] data, bool copy = true) where T : unmanaged

Parameters

data T[,,,,,,,,,,,]

The array to create NDArray from.

copy bool

If true then the array will be copied to a newly allocated memory.
If false then the array will be pinned by calling Alloc(object).

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

array<T>(T[,,,,,,,,,,], bool)

Creates an NDArray from given data.

public static NDArray array<T>(T[,,,,,,,,,,] data, bool copy = true) where T : unmanaged

Parameters

data T[,,,,,,,,,,]

The array to create NDArray from.

copy bool

If true then the array will be copied to a newly allocated memory.
If false then the array will be pinned by calling Alloc(object).

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

array<T>(T[,,,,,,,,,], bool)

Creates an NDArray from given data.

public static NDArray array<T>(T[,,,,,,,,,] data, bool copy = true) where T : unmanaged

Parameters

data T[,,,,,,,,,]

The array to create NDArray from.

copy bool

If true then the array will be copied to a newly allocated memory.
If false then the array will be pinned by calling Alloc(object).

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

array<T>(T[,,,,,,,,], bool)

Creates an NDArray from given data.

public static NDArray array<T>(T[,,,,,,,,] data, bool copy = true) where T : unmanaged

Parameters

data T[,,,,,,,,]

The array to create NDArray from.

copy bool

If true then the array will be copied to a newly allocated memory.
If false then the array will be pinned by calling Alloc(object).

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

array<T>(T[,,,,,,,], bool)

Creates an NDArray from given data.

public static NDArray array<T>(T[,,,,,,,] data, bool copy = true) where T : unmanaged

Parameters

data T[,,,,,,,]

The array to create NDArray from.

copy bool

If true then the array will be copied to a newly allocated memory.
If false then the array will be pinned by calling Alloc(object).

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

array<T>(T[,,,,,,], bool)

Creates an NDArray from given data.

public static NDArray array<T>(T[,,,,,,] data, bool copy = true) where T : unmanaged

Parameters

data T[,,,,,,]

The array to create NDArray from.

copy bool

If true then the array will be copied to a newly allocated memory.
If false then the array will be pinned by calling Alloc(object).

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

array<T>(T[,,,,,], bool)

Creates an NDArray from given data.

public static NDArray array<T>(T[,,,,,] data, bool copy = true) where T : unmanaged

Parameters

data T[,,,,,]

The array to create NDArray from.

copy bool

If true then the array will be copied to a newly allocated memory.
If false then the array will be pinned by calling Alloc(object).

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

array<T>(T[,,,,], bool)

Creates an NDArray from given data.

public static NDArray array<T>(T[,,,,] data, bool copy = true) where T : unmanaged

Parameters

data T[,,,,]

The array to create NDArray from.

copy bool

If true then the array will be copied to a newly allocated memory.
If false then the array will be pinned by calling Alloc(object).

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

array<T>(T[,,,], bool)

Creates an NDArray from given data.

public static NDArray array<T>(T[,,,] data, bool copy = true) where T : unmanaged

Parameters

data T[,,,]

The array to create NDArray from.

copy bool

If true then the array will be copied to a newly allocated memory.
If false then the array will be pinned by calling Alloc(object).

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

array<T>(T[,,], bool)

Creates an NDArray from given data.

public static NDArray array<T>(T[,,] data, bool copy = true) where T : unmanaged

Parameters

data T[,,]

The array to create NDArray from.

copy bool

If true then the array will be copied to a newly allocated memory.
If false then the array will be pinned by calling Alloc(object).

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

array<T>(T[,], bool)

Creates an NDArray from given data.

public static NDArray array<T>(T[,] data, bool copy = true) where T : unmanaged

Parameters

data T[,]

The array to create NDArray from.

copy bool

If true then the array will be copied to a newly allocated memory.
If false then the array will be pinned by calling Alloc(object).

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

array<T>(params T[])

Creates a Vector NDArray from given data.

public static NDArray array<T>(params T[] data) where T : unmanaged

Parameters

data T[]

The array to create NDArray from.

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

array<T>(T[], bool)

Creates an NDArray from given data.

public static NDArray array<T>(T[] data, bool copy) where T : unmanaged

Parameters

data T[]

The array to create NDArray from.

copy bool

If true then the array will be copied to a newly allocated memory.
If false then the array will be pinned by calling Alloc(object).

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

array<T>(T[][])

Creates an NDArray from given data.

[SuppressMessage("ReSharper", "SuggestVarOrType_SimpleTypes")]
[SuppressMessage("ReSharper", "SuggestVarOrType_Elsewhere")]
public static NDArray array<T>(T[][] data) where T : unmanaged

Parameters

data T[][]

The array to create NDArray from. Shape is taken from the first item of each array/nested array.

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

array<T>(T[][][])

Creates an NDArray from given data.

[SuppressMessage("ReSharper", "SuggestVarOrType_SimpleTypes")]
[SuppressMessage("ReSharper", "SuggestVarOrType_Elsewhere")]
public static NDArray array<T>(T[][][] data) where T : unmanaged

Parameters

data T[][][]

The array to create NDArray from. Shape is taken from the first item of each array/nested array.

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

array<T>(T[][][][])

Creates an NDArray from given data.

[SuppressMessage("ReSharper", "SuggestVarOrType_SimpleTypes")]
[SuppressMessage("ReSharper", "SuggestVarOrType_Elsewhere")]
public static NDArray array<T>(T[][][][] data) where T : unmanaged

Parameters

data T[][][][]

The array to create NDArray from. Shape is taken from the first item of each array/nested array.

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

array<T>(T[][][][][])

Creates an NDArray from given data.

[SuppressMessage("ReSharper", "SuggestVarOrType_SimpleTypes")]
[SuppressMessage("ReSharper", "SuggestVarOrType_Elsewhere")]
public static NDArray array<T>(T[][][][][] data) where T : unmanaged

Parameters

data T[][][][][]

The array to create NDArray from. Shape is taken from the first item of each array/nested array.

Returns

NDArray

An NDArray with the data and shape of the given array.

Type Parameters

T

The type of given array, must be compliant to numpy's supported dtypes.

Remarks

asanyarray(in object, Type)

Convert the input to an ndarray, but pass ndarray subclasses through.

public static NDArray asanyarray(in object a, Type dtype = null)

Parameters

a object

Input data, in any form that can be converted to an array. This includes scalars, lists, lists of tuples, tuples, tuples of tuples, tuples of lists, and ndarrays.

dtype Type

By default, the data-type is inferred from the input data.

Returns

NDArray

Array interpretation of a. If a is an ndarray or a subclass of ndarray, it is returned as-is and no copy is performed.

Remarks

asarray(string)

public static NDArray asarray(string data)

Parameters

data string

Returns

NDArray

asarray(string[], int)

public static NDArray asarray(string[] data, int ndim = 1)

Parameters

data string[]
ndim int

Returns

NDArray

asarray<T>(T)

public static NDArray asarray<T>(T data) where T : struct

Parameters

data T

Returns

NDArray

Type Parameters

T

asarray<T>(T[], int)

public static NDArray asarray<T>(T[] data, int ndim = 1) where T : struct

Parameters

data T[]
ndim int

Returns

NDArray

Type Parameters

T

asscalar(NDArray)

Convert an array of size 1 to its scalar equivalent.

public static ValueType asscalar(NDArray nd)

Parameters

nd NDArray

Input NDArray of size 1.

Returns

ValueType

Remarks

asscalar(Array)

Convert an array of size 1 to its scalar equivalent.

public static ValueType asscalar(Array arr)

Parameters

arr Array

Input array of size 1.

Returns

ValueType

Remarks

asscalar<T>(ArraySlice<T>)

Convert an array of size 1 to its scalar equivalent.

public static T asscalar<T>(ArraySlice<T> arr) where T : unmanaged

Parameters

arr ArraySlice<T>

Input array of size 1.

Returns

T

Type Parameters

T

Remarks

asscalar<T>(IArraySlice)

Convert an array of size 1 to its scalar equivalent.

public static T asscalar<T>(IArraySlice arr) where T : unmanaged

Parameters

arr IArraySlice

Input array of size 1.

Returns

T

Type Parameters

T

Remarks

asscalar<T>(NDArray)

Convert an array of size 1 to its scalar equivalent.

public static T asscalar<T>(NDArray nd) where T : unmanaged

Parameters

nd NDArray

Input NDArray of size 1.

Returns

T

Type Parameters

T

Remarks

asscalar<T>(Array)

Convert an array of size 1 to its scalar equivalent.

public static T asscalar<T>(Array arr)

Parameters

arr Array

Input array of size 1.

Returns

T

Type Parameters

T

Remarks

atleast_1d(NDArray)

Convert inputs to arrays with at least one dimension. Scalar inputs are converted to 1-dimensional arrays, whilst higher-dimensional inputs are preserved.

public static NDArray atleast_1d(NDArray arr)

Parameters

arr NDArray

Returns

NDArray

An array, or list of arrays, each with a.ndim >= 1. Copies are made only if necessary.

Remarks

atleast_1d(params NDArray[])

Convert inputs to arrays with at least one dimension. Scalar inputs are converted to 1-dimensional arrays, whilst higher-dimensional inputs are preserved.

public static NDArray[] atleast_1d(params NDArray[] arys)

Parameters

arys NDArray[]

One or more input arrays.

Returns

NDArray[]

An array, or list of arrays, each with a.ndim >= 1. Copies are made only if necessary.

Remarks

atleast_1d(object)

Convert inputs to arrays with at least one dimension. Scalar inputs are converted to 1-dimensional arrays, whilst higher-dimensional inputs are preserved.

public static NDArray atleast_1d(object arys)

Parameters

arys object

One or more input arrays.

Returns

NDArray

An array, or list of arrays, each with a.ndim >= 1. Copies are made only if necessary.

Remarks

atleast_1d(params object[])

Convert inputs to arrays with at least one dimension. Scalar inputs are converted to 1-dimensional arrays, whilst higher-dimensional inputs are preserved.

public static NDArray[] atleast_1d(params object[] arys)

Parameters

arys object[]

One or more input arrays.

Returns

NDArray[]

An array, or list of arrays, each with a.ndim >= 1. Copies are made only if necessary.

Remarks

atleast_2d(NDArray)

View inputs as arrays with at least two dimensions.

public static NDArray atleast_2d(NDArray arr)

Parameters

arr NDArray

One or more array-like sequences. Non-array inputs are converted to arrays. Arrays that already have two or more dimensions are preserved.

Returns

NDArray

An array, or list of arrays, each with a.ndim >= 2. Copies are avoided where possible, and views with two or more dimensions are returned.

Remarks

atleast_2d(params NDArray[])

View inputs as arrays with at least two dimensions.

public static NDArray[] atleast_2d(params NDArray[] arys)

Parameters

arys NDArray[]

One or more array-like sequences. Non-array inputs are converted to arrays. Arrays that already have two or more dimensions are preserved.

Returns

NDArray[]

An array, or list of arrays, each with a.ndim >= 2. Copies are avoided where possible, and views with two or more dimensions are returned.

Remarks

atleast_2d(object)

View inputs as arrays with at least two dimensions.

public static NDArray atleast_2d(object arys)

Parameters

arys object

One or more array-like sequences. Non-array inputs are converted to arrays. Arrays that already have two or more dimensions are preserved.

Returns

NDArray

An array, or list of arrays, each with a.ndim >= 2. Copies are avoided where possible, and views with two or more dimensions are returned.

Remarks

atleast_2d(params object[])

View inputs as arrays with at least two dimensions.

public static NDArray[] atleast_2d(params object[] arys)

Parameters

arys object[]

One or more array-like sequences. Non-array inputs are converted to arrays. Arrays that already have two or more dimensions are preserved.

Returns

NDArray[]

An array, or list of arrays, each with a.ndim >= 2. Copies are avoided where possible, and views with two or more dimensions are returned.

Remarks

atleast_3d(NDArray)

View inputs as arrays with at least three dimensions.

public static NDArray atleast_3d(NDArray arr)

Parameters

arr NDArray

Returns

NDArray

An array, or list of arrays, each with a.ndim >= 3. Copies are avoided where possible, and views with three or more dimensions are returned. For example, a 1-D array of shape (N,) becomes a view of shape (1, N, 1), and a 2-D array of shape (M, N) becomes a view of shape (M, N, 1).

Remarks

atleast_3d(params NDArray[])

View inputs as arrays with at least three dimensions.

public static NDArray[] atleast_3d(params NDArray[] arys)

Parameters

arys NDArray[]

One or more array-like sequences. Non-array inputs are converted to arrays. Arrays that already have three or more dimensions are preserved.

Returns

NDArray[]

An array, or list of arrays, each with a.ndim >= 3. Copies are avoided where possible, and views with three or more dimensions are returned. For example, a 1-D array of shape (N,) becomes a view of shape (1, N, 1), and a 2-D array of shape (M, N) becomes a view of shape (M, N, 1).

Remarks

atleast_3d(object)

View inputs as arrays with at least three dimensions.

public static NDArray atleast_3d(object arys)

Parameters

arys object

One or more array-like sequences. Non-array inputs are converted to arrays. Arrays that already have three or more dimensions are preserved.

Returns

NDArray

An array, or list of arrays, each with a.ndim >= 3. Copies are avoided where possible, and views with three or more dimensions are returned. For example, a 1-D array of shape (N,) becomes a view of shape (1, N, 1), and a 2-D array of shape (M, N) becomes a view of shape (M, N, 1).

Remarks

atleast_3d(params object[])

View inputs as arrays with at least three dimensions.

public static NDArray[] atleast_3d(params object[] arys)

Parameters

arys object[]

One or more array-like sequences. Non-array inputs are converted to arrays. Arrays that already have three or more dimensions are preserved.

Returns

NDArray[]

An array, or list of arrays, each with a.ndim >= 3. Copies are avoided where possible, and views with three or more dimensions are returned. For example, a 1-D array of shape (N,) becomes a view of shape (1, N, 1), and a 2-D array of shape (M, N) becomes a view of shape (M, N, 1).

Remarks

broadcast(NDArray, NDArray)

Produce an object that mimics broadcasting.

public static np.Broadcast broadcast(NDArray nd1, NDArray nd2)

Parameters

nd1 NDArray
nd2 NDArray

Returns

np.Broadcast

Broadcast the input parameters against one another, and return an object that encapsulates the result. Amongst others, it has shape and nd properties, and may be used as an iterator.

Remarks

broadcast_arrays(NDArray, NDArray)

Broadcast two arrays against each other.

public static (NDArray Lhs, NDArray Rhs) broadcast_arrays(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray

An array to broadcast.

rhs NDArray

An array to broadcast.

Returns

(NDArray Lhs, NDArray Rhs)

These arrays are views on the original arrays. They are typically not contiguous. Furthermore, more than one element of a broadcasted array may refer to a single memory location. If you need to write to the arrays, make copies first.

Remarks

broadcast_arrays(params NDArray[])

Broadcast any number of arrays against each other.

public static NDArray[] broadcast_arrays(params NDArray[] ndArrays)

Parameters

ndArrays NDArray[]

The arrays to broadcast.

Returns

NDArray[]

These arrays are views on the original arrays. They are typically not contiguous. Furthermore, more than one element of a broadcasted array may refer to a single memory location. If you need to write to the arrays, make copies first.

Remarks

broadcast_to(UnmanagedStorage, UnmanagedStorage)

Broadcast an array to a new shape.

public static NDArray broadcast_to(UnmanagedStorage from, UnmanagedStorage against)

Parameters

from UnmanagedStorage

The UnmanagedStorage to broadcast.

against UnmanagedStorage

The shape to broadcast against.

Returns

NDArray

These arrays are views on the original arrays. They are typically not contiguous. Furthermore, more than one element of a broadcasted array may refer to a single memory location. If you need to write to the arrays, make copies first.

Remarks

broadcast_to(UnmanagedStorage, NDArray)

Broadcast an array to a new shape.

public static NDArray broadcast_to(UnmanagedStorage from, NDArray against)

Parameters

from UnmanagedStorage

The UnmanagedStorage to broadcast.

against NDArray

The shape to broadcast against.

Returns

NDArray

These arrays are views on the original arrays. They are typically not contiguous. Furthermore, more than one element of a broadcasted array may refer to a single memory location. If you need to write to the arrays, make copies first.

Remarks

broadcast_to(UnmanagedStorage, Shape)

Broadcast an array to a new shape.

public static NDArray broadcast_to(UnmanagedStorage from, Shape against)

Parameters

from UnmanagedStorage

The NDArray to broadcast.

against Shape

The shape to broadcast against.

Returns

NDArray

These arrays are views on the original arrays. They are typically not contiguous. Furthermore, more than one element of a broadcasted array may refer to a single memory location. If you need to write to the arrays, make copies first.

Remarks

broadcast_to(NDArray, UnmanagedStorage)

Broadcast an array to a new shape.

public static NDArray broadcast_to(NDArray from, UnmanagedStorage against)

Parameters

from NDArray

The NDArray to broadcast.

against UnmanagedStorage

The shape to broadcast against.

Returns

NDArray

These arrays are views on the original arrays. They are typically not contiguous. Furthermore, more than one element of a broadcasted array may refer to a single memory location. If you need to write to the arrays, make copies first.

Remarks

broadcast_to(NDArray, NDArray)

Broadcast an array to a new shape.

public static NDArray broadcast_to(NDArray from, NDArray against)

Parameters

from NDArray

The NDArray to broadcast.

against NDArray

The shape to broadcast against.

Returns

NDArray

These arrays are views on the original arrays. They are typically not contiguous. Furthermore, more than one element of a broadcasted array may refer to a single memory location. If you need to write to the arrays, make copies first.

Remarks

broadcast_to(NDArray, Shape)

Broadcast an array to a new shape.

public static NDArray broadcast_to(NDArray from, Shape against)

Parameters

from NDArray

The NDArray to broadcast.

against Shape

The shape to broadcast against.

Returns

NDArray

These arrays are views on the original arrays. They are typically not contiguous. Furthermore, more than one element of a broadcasted array may refer to a single memory location. If you need to write to the arrays, make copies first.

Remarks

broadcast_to(Shape, UnmanagedStorage)

Broadcast an shape against an other new shape.

public static Shape broadcast_to(Shape from, UnmanagedStorage against)

Parameters

from Shape

The shape that is to be broadcasted

against UnmanagedStorage

The shape that'll be used to broadcast from shape

Returns

Shape

A readonly view on the original array with the given shape. It is typically not contiguous. Furthermore, more than one element of a broadcasted array may refer to a single memory location.

Remarks

broadcast_to(Shape, NDArray)

Broadcast an shape against an other new shape.

public static Shape broadcast_to(Shape from, NDArray against)

Parameters

from Shape

The shape that is to be broadcasted

against NDArray

The shape that'll be used to broadcast from shape

Returns

Shape

A readonly view on the original array with the given shape. It is typically not contiguous. Furthermore, more than one element of a broadcasted array may refer to a single memory location.

Remarks

broadcast_to(Shape, Shape)

Broadcast an shape against an other new shape.

public static Shape broadcast_to(Shape from, Shape against)

Parameters

from Shape

The shape that is to be broadcasted

against Shape

The shape that'll be used to broadcast from shape

Returns

Shape

A readonly view on the original array with the given shape. It is typically not contiguous. Furthermore, more than one element of a broadcasted array may refer to a single memory location.

Remarks

ceil(in NDArray, NPTypeCode?)

Return the ceiling of the input, element-wise.
The ceil of the scalar x is the smallest integer i, such that i >= x. It is often denoted as \lceil x \rceil.

public static NDArray ceil(in NDArray x, NPTypeCode? outType = null)

Parameters

x NDArray

Input data.

outType NPTypeCode?

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

The ceiling of each element in x, with float dtype. This is a scalar if x is a scalar.

Remarks

ceil(in NDArray, Type)

Return the ceiling of the input, element-wise.
The ceil of the scalar x is the smallest integer i, such that i >= x. It is often denoted as \lceil x \rceil.

public static NDArray ceil(in NDArray x, Type outType)

Parameters

x NDArray

Input data.

outType Type

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

The ceiling of each element in x, with float dtype. This is a scalar if x is a scalar.

Remarks

clip(in NDArray, NDArray, NDArray, NDArray)

Clip (limit) the values in an array.
Given an interval, values outside the interval are clipped to the interval edges. For example, if an interval of [0, 1] is specified, values smaller than 0 become 0, and values larger than 1 become 1.

public static NDArray clip(in NDArray a, NDArray a_min, NDArray a_max, NDArray @out)

Parameters

a NDArray

Array containing elements to clip.

a_min NDArray

Minimum value. If None, clipping is not performed on lower interval edge. Not more than one of a_min and a_max may be None.

a_max NDArray

Maximum value. If None, clipping is not performed on upper interval edge. Not more than one of a_min and a_max may be None.

out NDArray

The results will be placed in this array. It may be the input array for in-place clipping. out must be of the right shape to hold the output. Its type is preserved.

Returns

NDArray

An array with the elements of a, but where values < a_min are replaced with a_min, and those > a_max with a_max.

Remarks

clip(in NDArray, NDArray, NDArray, NPTypeCode?)

Clip (limit) the values in an array.
Given an interval, values outside the interval are clipped to the interval edges. For example, if an interval of [0, 1] is specified, values smaller than 0 become 0, and values larger than 1 become 1.

public static NDArray clip(in NDArray a, NDArray a_min, NDArray a_max, NPTypeCode? outType = null)

Parameters

a NDArray

Array containing elements to clip.

a_min NDArray

Minimum value. If None, clipping is not performed on lower interval edge. Not more than one of a_min and a_max may be None.

a_max NDArray

Maximum value. If None, clipping is not performed on upper interval edge. Not more than one of a_min and a_max may be None.

outType NPTypeCode?

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

An array with the elements of a, but where values < a_min are replaced with a_min, and those > a_max with a_max.

Remarks

clip(in NDArray, NDArray, NDArray, Type)

Clip (limit) the values in an array.
Given an interval, values outside the interval are clipped to the interval edges. For example, if an interval of [0, 1] is specified, values smaller than 0 become 0, and values larger than 1 become 1.

public static NDArray clip(in NDArray a, NDArray a_min, NDArray a_max, Type outType)

Parameters

a NDArray

Array containing elements to clip.

a_min NDArray

Minimum value. If None, clipping is not performed on lower interval edge. Not more than one of a_min and a_max may be None.

a_max NDArray

Maximum value. If None, clipping is not performed on upper interval edge. Not more than one of a_min and a_max may be None.

outType Type

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

An array with the elements of a, but where values < a_min are replaced with a_min, and those > a_max with a_max.

Remarks

concatenate(NDArray[], int)

Join a sequence of arrays along an existing axis.

public static NDArray concatenate(NDArray[] arrays, int axis = 0)

Parameters

arrays NDArray[]

The arrays must have the same shape, except in the dimension corresponding to axis (the first, by default).

axis int

The axis along which the arrays will be joined. If axis is None, arrays are flattened before use. Default is 0.

Returns

NDArray

The concatenated array.

Remarks

concatenate((NDArray, NDArray, NDArray, NDArray, NDArray, NDArray, NDArray, NDArray, NDArray), int)

Join a sequence of arrays along an existing axis.

public static NDArray concatenate((NDArray, NDArray, NDArray, NDArray, NDArray, NDArray, NDArray, NDArray, NDArray) arrays, int axis = 0)

Parameters

arrays (NDArray, NDArray, NDArray, NDArray, NDArray, NDArray, NDArray, NDArray, NDArray)

The arrays must have the same shape, except in the dimension corresponding to axis (the first, by default).

axis int

The axis along which the arrays will be joined. If axis is None, arrays are flattened before use. Default is 0.

Returns

NDArray

The concatenated array.

Remarks

concatenate((NDArray, NDArray, NDArray, NDArray, NDArray, NDArray, NDArray, NDArray), int)

Join a sequence of arrays along an existing axis.

public static NDArray concatenate((NDArray, NDArray, NDArray, NDArray, NDArray, NDArray, NDArray, NDArray) arrays, int axis = 0)

Parameters

arrays (NDArray, NDArray, NDArray, NDArray, NDArray, NDArray, NDArray, NDArray)

The arrays must have the same shape, except in the dimension corresponding to axis (the first, by default).

axis int

The axis along which the arrays will be joined. If axis is None, arrays are flattened before use. Default is 0.

Returns

NDArray

The concatenated array.

Remarks

concatenate((NDArray, NDArray, NDArray, NDArray, NDArray, NDArray, NDArray), int)

Join a sequence of arrays along an existing axis.

public static NDArray concatenate((NDArray, NDArray, NDArray, NDArray, NDArray, NDArray, NDArray) arrays, int axis = 0)

Parameters

arrays (NDArray, NDArray, NDArray, NDArray, NDArray, NDArray, NDArray)

The arrays must have the same shape, except in the dimension corresponding to axis (the first, by default).

axis int

The axis along which the arrays will be joined. If axis is None, arrays are flattened before use. Default is 0.

Returns

NDArray

The concatenated array.

Remarks

concatenate((NDArray, NDArray, NDArray, NDArray, NDArray, NDArray), int)

Join a sequence of arrays along an existing axis.

public static NDArray concatenate((NDArray, NDArray, NDArray, NDArray, NDArray, NDArray) arrays, int axis = 0)

Parameters

arrays (NDArray, NDArray, NDArray, NDArray, NDArray, NDArray)

The arrays must have the same shape, except in the dimension corresponding to axis (the first, by default).

axis int

The axis along which the arrays will be joined. If axis is None, arrays are flattened before use. Default is 0.

Returns

NDArray

The concatenated array.

Remarks

concatenate((NDArray, NDArray, NDArray, NDArray, NDArray), int)

Join a sequence of arrays along an existing axis.

public static NDArray concatenate((NDArray, NDArray, NDArray, NDArray, NDArray) arrays, int axis = 0)

Parameters

arrays (NDArray, NDArray, NDArray, NDArray, NDArray)

The arrays must have the same shape, except in the dimension corresponding to axis (the first, by default).

axis int

The axis along which the arrays will be joined. If axis is None, arrays are flattened before use. Default is 0.

Returns

NDArray

The concatenated array.

Remarks

concatenate((NDArray, NDArray, NDArray, NDArray), int)

Join a sequence of arrays along an existing axis.

public static NDArray concatenate((NDArray, NDArray, NDArray, NDArray) arrays, int axis = 0)

Parameters

arrays (NDArray, NDArray, NDArray, NDArray)

The arrays must have the same shape, except in the dimension corresponding to axis (the first, by default).

axis int

The axis along which the arrays will be joined. If axis is None, arrays are flattened before use. Default is 0.

Returns

NDArray

The concatenated array.

Remarks

concatenate((NDArray, NDArray, NDArray), int)

Join a sequence of arrays along an existing axis.

public static NDArray concatenate((NDArray, NDArray, NDArray) arrays, int axis = 0)

Parameters

arrays (NDArray, NDArray, NDArray)

The arrays must have the same shape, except in the dimension corresponding to axis (the first, by default).

axis int

The axis along which the arrays will be joined. If axis is None, arrays are flattened before use. Default is 0.

Returns

NDArray

The concatenated array.

Remarks

concatenate((NDArray, NDArray), int)

Join a sequence of arrays along an existing axis.

public static NDArray concatenate((NDArray, NDArray) arrays, int axis = 0)

Parameters

arrays (NDArray Lhs, NDArray Rhs)

The arrays must have the same shape, except in the dimension corresponding to axis (the first, by default).

axis int

The axis along which the arrays will be joined. If axis is None, arrays are flattened before use. Default is 0.

Returns

NDArray

The concatenated array.

Remarks

convolve(NDArray, 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 static NDArray convolve(NDArray a, NDArray v, string mode = "full")

Parameters

a NDArray
v NDArray
mode string

Returns

NDArray

copy(NDArray, char)

Return a copy of the array.

public static NDArray copy(NDArray a, char order = 'C')

Parameters

a NDArray

Input data.

order char

Returns

NDArray

Array interpretation of a.

Remarks

copyto(NDArray, NDArray)

Copies values from one array to another, broadcasting as necessary.

public static void copyto(NDArray dst, NDArray src)

Parameters

dst NDArray

The array into which values are copied.

src NDArray

The array from which values are copied.

Remarks

cos(in NDArray, NPTypeCode?)

Cosine element-wise.

public static NDArray cos(in NDArray x, NPTypeCode? outType = null)

Parameters

x NDArray

Input array in radians.

outType NPTypeCode?

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

The sine of each element of x. This is a scalar if x is a scalar.

Remarks

cos(in NDArray, Type)

Cosine element-wise.

public static NDArray cos(in NDArray x, Type outType)

Parameters

x NDArray

Input array in radians.

outType Type

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

The sine of each element of x. This is a scalar if x is a scalar.

Remarks

cosh(in NDArray, NPTypeCode?)

Hyperbolic cosine, element-wise.
Equivalent to 1/2 * (np.exp(x) + np.exp(-x)) and np.cos(1j* x).

public static NDArray cosh(in NDArray x, NPTypeCode? outType = null)

Parameters

x NDArray

Input array.

outType NPTypeCode?

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

Output array of same shape as x. This is a scalar if x is a scalar.

Remarks

cosh(in NDArray, Type)

Hyperbolic cosine, element-wise.
Equivalent to 1/2 * (np.exp(x) + np.exp(-x)) and np.cos(1j* x).

public static NDArray cosh(in NDArray x, Type outType)

Parameters

x NDArray

Input array.

outType Type

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

Output array of same shape as x. This is a scalar if x is a scalar.

Remarks

cumsum(NDArray, int?, NPTypeCode?)

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

public static NDArray cumsum(NDArray arr, int? axis = null, NPTypeCode? typeCode = null)

Parameters

arr NDArray

Input array.

axis int?

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

typeCode NPTypeCode?

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

divide(in NDArray, in NDArray)

public static NDArray divide(in NDArray x1, in NDArray x2)

Parameters

x1 NDArray
x2 NDArray

Returns

NDArray

Remarks

dot(in NDArray, in NDArray)

Dot product of two arrays. See remarks.

public static NDArray dot(in NDArray a, in NDArray b)

Parameters

a NDArray

Lhs, First argument.

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 static 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

dtype(string)

Parse a string into a DType.

public static DType dtype(string dtype)

Parameters

dtype string

Returns

DType

A DType based on dtype, return can be null.

Remarks

https://numpy.org/doc/stable/reference/arrays.dtypes.html
This was created to ease the porting of C++ numpy to C#.

empty(Shape)

Return a new array of given shape and type, without initializing entries.

public static NDArray empty(Shape shape)

Parameters

shape Shape

Shape of the empty array, e.g., (2, 3) or 2.

Returns

NDArray

Array of uninitialized (arbitrary) data of the given shape, dtype, and order. Object arrays will be initialized to None.

Remarks

empty(Shape, NPTypeCode)

Return a new array of given shape and type, without initializing entries.

public static NDArray empty(Shape shape, NPTypeCode typeCode)

Parameters

shape Shape

Shape of the empty array, e.g., (2, 3) or 2.

typeCode NPTypeCode

Desired output data-type for the array, e.g, numpy.int8. Default is numpy.float64.

Returns

NDArray

Array of uninitialized (arbitrary) data of the given shape, dtype, and order. Object arrays will be initialized to None.

Remarks

empty(Shape, Type)

Return a new array of given shape and type, without initializing entries.

public static NDArray empty(Shape shape, Type dtype)

Parameters

shape Shape

Shape of the empty array, e.g., (2, 3) or 2.

dtype Type

Desired output data-type for the array, e.g, numpy.int8. Default is numpy.float64.

Returns

NDArray

Array of uninitialized (arbitrary) data of the given shape, dtype, and order. Object arrays will be initialized to None.

Remarks

empty(params int[])

Return a new array of given shape and type, without initializing entries.

public static NDArray empty(params int[] shapes)

Parameters

shapes int[]

Shape of the empty array, e.g., (2, 3) or 2.

Returns

NDArray

Array of uninitialized (arbitrary) data of the given shape, dtype, and order. Object arrays will be initialized to None.

Remarks

empty_like(NDArray, NPTypeCode, Shape)

Return a new array with the same shape and type as a given array.

public static NDArray empty_like(NDArray prototype, NPTypeCode typeCode, Shape shape = default)

Parameters

prototype NDArray

The shape and data-type of prototype define these same attributes of the returned array.

typeCode NPTypeCode

Overrides the data type of the result.

shape Shape

Overrides the shape of the result.

Returns

NDArray

Array of uninitialized (arbitrary) data with the same shape and type as prototype.

Remarks

empty_like(NDArray, Type, Shape)

Return a new array with the same shape and type as a given array.

public static NDArray empty_like(NDArray prototype, Type dtype = null, Shape shape = default)

Parameters

prototype NDArray

The shape and data-type of prototype define these same attributes of the returned array.

dtype Type

Overrides the data type of the result.

shape Shape

Overrides the shape of the result.

Returns

NDArray

Array of uninitialized (arbitrary) data with the same shape and type as prototype.

Remarks

empty<T>(params int[])

Return a new array of given shape and type, without initializing entries.

public static NDArray empty<T>(params int[] shapes)

Parameters

shapes int[]

Shape of the empty array, e.g., (2, 3) or 2.

Returns

NDArray

Array of uninitialized (arbitrary) data of the given shape, dtype, and order. Object arrays will be initialized to None.

Type Parameters

T

Remarks

exp(in NDArray)

Base-e exponential, element-wise.

public static NDArray exp(in NDArray a)

Parameters

a NDArray

Input value.

Returns

NDArray

The natural logarithm of x, element-wise. This is a scalar NDArray.

Remarks

exp(in NDArray, NPTypeCode)

Base-e exponential, element-wise.

public static NDArray exp(in NDArray a, NPTypeCode typeCode)

Parameters

a NDArray

Input value.

typeCode NPTypeCode

The dtype of the returned NDArray

Returns

NDArray

The natural logarithm of x, element-wise. This is a scalar NDArray.

Remarks

exp(in NDArray, Type)

Base-e exponential, element-wise.

public static NDArray exp(in NDArray a, Type dtype)

Parameters

a NDArray

Input value.

dtype Type

The dtype of the returned NDArray

Returns

NDArray

The natural logarithm of x, element-wise. This is a scalar NDArray.

Remarks

exp2(in NDArray)

Calculate 2**p for all p in the input array.

public static NDArray exp2(in NDArray a)

Parameters

a NDArray

Input value.

Returns

NDArray

Element-wise 2 to the power x. This is a scalar if x is a scalar.

Remarks

exp2(in NDArray, NPTypeCode)

Calculate 2**p for all p in the input array.

public static NDArray exp2(in NDArray a, NPTypeCode typeCode)

Parameters

a NDArray

Input value.

typeCode NPTypeCode

Returns

NDArray

Element-wise 2 to the power x. This is a scalar if x is a scalar.

Remarks

exp2(in NDArray, Type)

Calculate 2**p for all p in the input array.

public static NDArray exp2(in NDArray a, Type dtype)

Parameters

a NDArray

Input value.

dtype Type

Returns

NDArray

Element-wise 2 to the power x. This is a scalar if x is a scalar.

Remarks

expand_dims(NDArray, int)

public static NDArray expand_dims(NDArray a, int axis)

Parameters

a NDArray
axis int

Returns

NDArray

expm1(in NDArray)

Calculate exp(x) - 1 for all elements in the array.

public static NDArray expm1(in NDArray a)

Parameters

a NDArray

Input value.

Returns

NDArray

Element-wise exponential minus one: out = exp(x) - 1. This is a scalar if x is a scalar.

Remarks

expm1(in NDArray, NPTypeCode)

Calculate exp(x) - 1 for all elements in the array.

public static NDArray expm1(in NDArray a, NPTypeCode typeCode)

Parameters

a NDArray

Input value.

typeCode NPTypeCode

Returns

NDArray

Element-wise exponential minus one: out = exp(x) - 1. This is a scalar if x is a scalar.

Remarks

expm1(in NDArray, Type)

Calculate exp(x) - 1 for all elements in the array.

public static NDArray expm1(in NDArray a, Type dtype)

Parameters

a NDArray

Input value.

dtype Type

Returns

NDArray

Element-wise exponential minus one: out = exp(x) - 1. This is a scalar if x is a scalar.

Remarks

eye(int, int?, int, Type)

Return a 2-D array with ones on the diagonal and zeros elsewhere.

public static NDArray eye(int N, int? M = null, int k = 0, Type dtype = null)

Parameters

N int

Number of rows in the output.

M int?

Number of columns in the output. If None, defaults to N.

k int

Index of the diagonal: 0 (the default) refers to the main diagonal, a positive value refers to an upper diagonal, and a negative value to a lower diagonal.

dtype Type

Data-type of the returned array.

Returns

NDArray

An array where all elements are equal to zero, except for the k-th diagonal, whose values are equal to one.

Remarks

find_common_type(NPTypeCode[], NPTypeCode[])

Determine common type following standard coercion rules.

public static NPTypeCode find_common_type(NPTypeCode[] array_types, NPTypeCode[] scalar_types)

Parameters

array_types NPTypeCode[]

A list of dtypes or dtype convertible objects representing arrays. Can be null.

scalar_types NPTypeCode[]

A list of dtypes or dtype convertible objects representing scalars.Can be null.

Returns

NPTypeCode

The common data type, which is the maximum of array_types ignoring scalar_types, unless the maximum of scalar_types is of a different kind (dtype.kind). If the kind is not understood, then None is returned.

Remarks

find_common_type(NPTypeCode[], Type[])

Determine common type following standard coercion rules.

public static NPTypeCode find_common_type(NPTypeCode[] array_types, Type[] scalar_types)

Parameters

array_types NPTypeCode[]

A list of dtypes or dtype convertible objects representing arrays. Can be null.

scalar_types Type[]

A list of dtypes or dtype convertible objects representing scalars.Can be null.

Returns

NPTypeCode

The common data type, which is the maximum of array_types ignoring scalar_types, unless the maximum of scalar_types is of a different kind (dtype.kind). If the kind is not understood, then None is returned.

Remarks

find_common_type(params string[])

Resolves to which type should the output be.

public static NPTypeCode find_common_type(params string[] involvedTypes)

Parameters

involvedTypes string[]

Returns

NPTypeCode

find_common_type(string[], string[])

Determine common type following standard coercion rules.

public static NPTypeCode find_common_type(string[] array_types, string[] scalar_types)

Parameters

array_types string[]

A list of dtypes or dtype convertible objects representing arrays. Can be null.

scalar_types string[]

A list of dtypes or dtype convertible objects representing scalars.Can be null.

Returns

NPTypeCode

The common data type, which is the maximum of array_types ignoring scalar_types, unless the maximum of scalar_types is of a different kind (dtype.kind). If the kind is not understood, then None is returned.

Remarks

find_common_type(Type[])

Determine common type following standard coercion rules.

public static NPTypeCode find_common_type(Type[] array_types)

Parameters

array_types Type[]

A list of dtypes or dtype convertible objects representing arrays. Can be null.

Returns

NPTypeCode

The common data type, which is the maximum of array_types ignoring scalar_types, unless the maximum of scalar_types is of a different kind (dtype.kind). If the kind is not understood, then None is returned.

Remarks

find_common_type(Type[], NPTypeCode[])

Determine common type following standard coercion rules.

public static NPTypeCode find_common_type(Type[] array_types, NPTypeCode[] scalar_types)

Parameters

array_types Type[]

A list of dtypes or dtype convertible objects representing arrays. Can be null.

scalar_types NPTypeCode[]

A list of dtypes or dtype convertible objects representing scalars.Can be null.

Returns

NPTypeCode

The common data type, which is the maximum of array_types ignoring scalar_types, unless the maximum of scalar_types is of a different kind (dtype.kind). If the kind is not understood, then None is returned.

Remarks

find_common_type(Type[], Type[])

Determine common type following standard coercion rules.

public static NPTypeCode find_common_type(Type[] array_types, Type[] scalar_types)

Parameters

array_types Type[]

A list of dtypes or dtype convertible objects representing arrays. Can be null.

scalar_types Type[]

A list of dtypes or dtype convertible objects representing scalars.Can be null.

Returns

NPTypeCode

The common data type, which is the maximum of array_types ignoring scalar_types, unless the maximum of scalar_types is of a different kind (dtype.kind). If the kind is not understood, then None is returned.

Remarks

floor(in NDArray, NPTypeCode?)

public static NDArray floor(in NDArray x, NPTypeCode? outType = null)

Parameters

x NDArray
outType NPTypeCode?

Returns

NDArray

floor(in NDArray, Type)

public static NDArray floor(in NDArray x, Type outType)

Parameters

x NDArray
outType Type

Returns

NDArray

fmax(in NDArray, in NDArray, NDArray)

Element-wise maximum of array elements. Compare two arrays and returns a new array containing the element-wise maxima. If one of the elements being compared is a NaN, then the non-nan element is returned. If both elements are NaNs then the first is returned. The latter distinction is important for complex NaNs, which are defined as at least one of the real or imaginary parts being a NaN. The net effect is that NaNs are ignored when possible.

public static NDArray fmax(in NDArray x1, in NDArray x2, NDArray @out)

Parameters

x1 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

x2 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

out NDArray

Returns

NDArray

The maximum of x1 and x2, element-wise. This is a scalar if both x1 and x2 are scalars.

fmax(in NDArray, in NDArray, NPTypeCode?)

Element-wise maximum of array elements. Compare two arrays and returns a new array containing the element-wise maxima. If one of the elements being compared is a NaN, then the non-nan element is returned. If both elements are NaNs then the first is returned. The latter distinction is important for complex NaNs, which are defined as at least one of the real or imaginary parts being a NaN. The net effect is that NaNs are ignored when possible.

public static NDArray fmax(in NDArray x1, in NDArray x2, NPTypeCode? outType = null)

Parameters

x1 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

x2 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

outType NPTypeCode?

Returns

NDArray

The maximum of x1 and x2, element-wise. This is a scalar if both x1 and x2 are scalars.

fmax(in NDArray, in NDArray, Type)

Element-wise maximum of array elements. Compare two arrays and returns a new array containing the element-wise maxima. If one of the elements being compared is a NaN, then the non-nan element is returned. If both elements are NaNs then the first is returned. The latter distinction is important for complex NaNs, which are defined as at least one of the real or imaginary parts being a NaN. The net effect is that NaNs are ignored when possible.

public static NDArray fmax(in NDArray x1, in NDArray x2, Type outType)

Parameters

x1 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

x2 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

outType Type

Returns

NDArray

The maximum of x1 and x2, element-wise. This is a scalar if both x1 and x2 are scalars.

fmin(in NDArray, in NDArray, NDArray)

Element-wise maximum of array elements. Compare two arrays and returns a new array containing the element-wise maxima.If one of the elements being compared is a NaN, then that element is returned.If both elements are NaNs then the first is returned.The latter distinction is important for complex NaNs, which are defined as at least one of the real or imaginary parts being a NaN. The net effect is that NaNs are propagated.

public static NDArray fmin(in NDArray x1, in NDArray x2, NDArray @out)

Parameters

x1 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

x2 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

out NDArray

Returns

NDArray

The maximum of x1 and x2, element-wise. This is a scalar if both x1 and x2 are scalars.

fmin(in NDArray, in NDArray, NPTypeCode?)

Element-wise maximum of array elements. Compare two arrays and returns a new array containing the element-wise maxima.If one of the elements being compared is a NaN, then that element is returned.If both elements are NaNs then the first is returned.The latter distinction is important for complex NaNs, which are defined as at least one of the real or imaginary parts being a NaN. The net effect is that NaNs are propagated.

public static NDArray fmin(in NDArray x1, in NDArray x2, NPTypeCode? outType = null)

Parameters

x1 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

x2 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

outType NPTypeCode?

Returns

NDArray

The maximum of x1 and x2, element-wise. This is a scalar if both x1 and x2 are scalars.

fmin(in NDArray, in NDArray, Type)

Element-wise maximum of array elements. Compare two arrays and returns a new array containing the element-wise maxima.If one of the elements being compared is a NaN, then that element is returned.If both elements are NaNs then the first is returned.The latter distinction is important for complex NaNs, which are defined as at least one of the real or imaginary parts being a NaN. The net effect is that NaNs are propagated.

public static NDArray fmin(in NDArray x1, in NDArray x2, Type outType)

Parameters

x1 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

x2 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

outType Type

Returns

NDArray

The maximum of x1 and x2, element-wise. This is a scalar if both x1 and x2 are scalars.

frombuffer(byte[], string)

public static NDArray frombuffer(byte[] bytes, string dtype)

Parameters

bytes byte[]
dtype string

Returns

NDArray

frombuffer(byte[], Type)

public static NDArray frombuffer(byte[] bytes, Type dtype)

Parameters

bytes byte[]
dtype Type

Returns

NDArray

fromfile(string, NPTypeCode)

Construct an array from data in a text or binary file. A highly efficient way of reading binary data with a known data-type, as well as parsing simply formatted text files. Data written using the tofile method can be read using this function.

public static NDArray fromfile(string file, NPTypeCode dtype)

Parameters

file string

filename.

dtype NPTypeCode

Data type of the returned array. For binary files, it is used to determine the size and byte-order of the items in the file.

Returns

NDArray

Remarks

fromfile(string, Type)

Construct an array from data in a text or binary file. A highly efficient way of reading binary data with a known data-type, as well as parsing simply formatted text files. Data written using the tofile method can be read using this function.

public static NDArray fromfile(string file, Type dtype)

Parameters

file string

filename.

dtype Type

Data type of the returned array. For binary files, it is used to determine the size and byte-order of the items in the file.

Returns

NDArray

Remarks

full(Shape, ValueType)

Return a new array of given shape and type, filled with fill_value.

public static NDArray full(Shape shape, ValueType fill_value)

Parameters

shape Shape

Shape of the empty array, e.g., (2, 3) or 2.

fill_value ValueType

Fill value.

Returns

NDArray

Array of fill_value with the given shape, dtype, and order.

Remarks

full(Shape, ValueType, NPTypeCode)

Return a new array of given shape and type, filled with fill_value.

public static NDArray full(Shape shape, ValueType fill_value, NPTypeCode typeCode)

Parameters

shape Shape

Shape of the empty array, e.g., (2, 3) or 2.

fill_value ValueType

Fill value.

typeCode NPTypeCode

The desired data-type for the array The default, null, means np.array(fill_value).dtype.

Returns

NDArray

Array of fill_value with the given shape, dtype, and order.

Remarks

full(Shape, ValueType, Type)

Return a new array of given shape and type, filled with fill_value.

public static NDArray full(Shape shape, ValueType fill_value, Type dtype)

Parameters

shape Shape

Shape of the empty array, e.g., (2, 3) or 2.

fill_value ValueType

Fill value.

dtype Type

The desired data-type for the array The default, null, means np.array(fill_value).dtype.

Returns

NDArray

Array of fill_value with the given shape, dtype, and order.

Remarks

full(ValueType, Shape)

Return a new array of given shape and type, filled with fill_value.

public static NDArray full(ValueType fill_value, Shape shape)

Parameters

fill_value ValueType

Fill value.

shape Shape

Shape of the empty array, e.g., (2, 3) or 2.

Returns

NDArray

Array of fill_value with the given shape, dtype, and order.

Remarks

full(ValueType, Shape, NPTypeCode)

Return a new array of given shape and type, filled with fill_value.

public static NDArray full(ValueType fill_value, Shape shape, NPTypeCode typeCode)

Parameters

fill_value ValueType

Fill value.

shape Shape

Shape of the empty array, e.g., (2, 3) or 2.

typeCode NPTypeCode

The desired data-type for the array The default, null, means np.array(fill_value).dtype.

Returns

NDArray

Array of fill_value with the given shape, dtype, and order.

Remarks

full(ValueType, Shape, Type)

Return a new array of given shape and type, filled with fill_value.

public static NDArray full(ValueType fill_value, Shape shape, Type dtype)

Parameters

fill_value ValueType

Fill value.

shape Shape

Shape of the empty array, e.g., (2, 3) or 2.

dtype Type

The desired data-type for the array The default, null, means np.array(fill_value).dtype.

Returns

NDArray

Array of fill_value with the given shape, dtype, and order.

Remarks

full(ValueType, params int[])

Return a new array of given shape and type, filled with fill_value.

public static NDArray full(ValueType fill_value, params int[] shapes)

Parameters

fill_value ValueType

Fill value.

shapes int[]

Shape of the empty array, e.g., (2, 3) or 2.

Returns

NDArray

Array of fill_value with the given shape, dtype, and order.

Remarks

full_like(NDArray, object, Type)

Return a full array with the same shape and type as a given array.

public static NDArray full_like(NDArray a, object fill_value, Type dtype = null)

Parameters

a NDArray

The shape and data-type of a define these same attributes of the returned array.

fill_value object

Fill value.

dtype Type

Overrides the data type of the result.

Returns

NDArray

Array of fill_value with the same shape and type as a.

Remarks

full<T>(ValueType, params int[])

Return a new array of given shape and type, filled with fill_value.

public static NDArray full<T>(ValueType fill_value, params int[] shapes) where T : unmanaged

Parameters

fill_value ValueType

Fill value.

shapes int[]

Shape of the empty array, e.g., (2, 3) or 2.

Returns

NDArray

Array of fill_value with the given shape, dtype, and order.

Type Parameters

T

Remarks

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 static 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

identity(int, Type)

Return the identity array. The identity array is a square array with ones on the main diagonal.

public static NDArray identity(int n, Type dtype = null)

Parameters

n int

Number of rows (and columns) in n x n output.

dtype Type

Data-type of the output. Defaults to double.

Returns

NDArray

n x n array with its main diagonal set to one, and all other elements 0.

Remarks

isclose(NDArray, NDArray, double, double, bool)

Returns a boolean array where two arrays are element-wise equal within a tolerance. The tolerance values are positive, typically very small numbers.The
relative difference (rtol * abs(b)) and the absolute difference atol are added together to compare against the absolute difference between a and b. Warning: The default atol is not appropriate for comparing numbers that are much smaller than one(see Notes).

See also allclose(NDArray, NDArray, double, double, bool)

Notes: For finite values, isclose uses the following equation to test whether two floating point values are equivalent.

absolute(`a` - `b`) less than or equal to (`atol` + `rtol` * absolute(`b`))

Unlike the built-in math.isclose, the above equation is not symmetric in a and b -- it assumes b is the reference value -- so that isclose(a, b) might be different from isclose(b, a). Furthermore, the default value of atol is not zero, and is used to determine what small values should be considered close to zero.The default value is appropriate for expected values of order unity: if the expected values are significantly smaller than one, it can result in false positives. atol should be carefully selected for the use case at hand. A zero value for atol will result in False if either a or b is zero.

public static NDArray<bool> isclose(NDArray a, NDArray b, double rtol = 1E-05, double atol = 1E-08, bool equal_nan = false)

Parameters

a NDArray

Input array to compare with b

b NDArray

Input array to compare with a.

rtol double

The relative tolerance parameter(see Notes)

atol double

The absolute tolerance parameter(see Notes)

equal_nan bool

Whether to compare NaN's as equal. If True, NaN's in a will be considered equal to NaN's in b in the output array.

Returns

NDArray<bool>

Returns a boolean array of where a and b are equal within the given tolerance.If both a and b are scalars, returns a single boolean value.

isfinite(NDArray)

Test element-wise for finiteness (not infinity or not Not a Number).

public static NDArray<bool> isfinite(NDArray a)

Parameters

a NDArray

Returns

NDArray<bool>

The result is returned as a boolean array.

isnan(NDArray)

Test element-wise for Not a Number.

public static NDArray<bool> isnan(NDArray a)

Parameters

a NDArray

Returns

NDArray<bool>

The result is returned as a boolean array.

isscalar(object)

Returns true incase of a number, bool or string. If null, returns false.

public static bool isscalar(object obj)

Parameters

obj object

Returns

bool

Remarks

linspace(double, double, int, bool, NPTypeCode)

Return evenly spaced numbers over a specified interval.
Returns num evenly spaced samples, calculated over the interval[start, stop].
The endpoint of the interval can optionally be excluded.

public static NDArray linspace(double start, double stop, int num, bool endpoint = true, NPTypeCode typeCode = NPTypeCode.Double)

Parameters

start double

The starting value of the sequence.

stop double

The end value of the sequence, unless endpoint is set to False. In that case, the sequence consists of all but the last of num + 1 evenly spaced samples, so that stop is excluded. Note that the step size changes when endpoint is False.

num int

Number of samples to generate. Default is 50. Must be non-negative.

endpoint bool

If True, stop is the last sample. Otherwise, it is not included. Default is True.

typeCode NPTypeCode

The type of the output array. If dtype is not given, infer the data type from the other input arguments.

Returns

NDArray

Remarks

linspace(double, double, int, bool, Type)

Return evenly spaced numbers over a specified interval.
Returns num evenly spaced samples, calculated over the interval[start, stop].
The endpoint of the interval can optionally be excluded.

public static NDArray linspace(double start, double stop, int num, bool endpoint, Type dtype)

Parameters

start double

The starting value of the sequence.

stop double

The end value of the sequence, unless endpoint is set to False. In that case, the sequence consists of all but the last of num + 1 evenly spaced samples, so that stop is excluded. Note that the step size changes when endpoint is False.

num int

Number of samples to generate. Default is 50. Must be non-negative.

endpoint bool

If True, stop is the last sample. Otherwise, it is not included. Default is True.

dtype Type

The type of the output array. If dtype is not given, infer the data type from the other input arguments.

Returns

NDArray

Remarks

linspace(float, float, int, bool, NPTypeCode)

Return evenly spaced numbers over a specified interval.
Returns num evenly spaced samples, calculated over the interval[start, stop].
The endpoint of the interval can optionally be excluded.

public static NDArray linspace(float start, float stop, int num, bool endpoint = true, NPTypeCode typeCode = NPTypeCode.Float)

Parameters

start float

The starting value of the sequence.

stop float

The end value of the sequence, unless endpoint is set to False. In that case, the sequence consists of all but the last of num + 1 evenly spaced samples, so that stop is excluded. Note that the step size changes when endpoint is False.

num int

Number of samples to generate. Default is 50. Must be non-negative.

endpoint bool

If True, stop is the last sample. Otherwise, it is not included. Default is True.

typeCode NPTypeCode

The type of the output array. If dtype is not given, infer the data type from the other input arguments.

Returns

NDArray

Remarks

linspace(float, float, int, bool, Type)

Return evenly spaced numbers over a specified interval.
Returns num evenly spaced samples, calculated over the interval[start, stop].
The endpoint of the interval can optionally be excluded.

public static NDArray linspace(float start, float stop, int num, bool endpoint, Type dtype)

Parameters

start float

The starting value of the sequence.

stop float

The end value of the sequence, unless endpoint is set to False. In that case, the sequence consists of all but the last of num + 1 evenly spaced samples, so that stop is excluded. Note that the step size changes when endpoint is False.

num int

Number of samples to generate. Default is 50. Must be non-negative.

endpoint bool

If True, stop is the last sample. Otherwise, it is not included. Default is True.

dtype Type

The type of the output array. If dtype is not given, infer the data type from the other input arguments.

Returns

NDArray

Remarks

load(Stream)

public static NDArray load(Stream stream)

Parameters

stream Stream

Returns

NDArray

load(string)

public static NDArray load(string path)

Parameters

path string

Returns

NDArray

log(in NDArray)

Natural logarithm, element-wise. The natural logarithm log is the inverse of the exponential function, so that log(exp(x)) = x. The natural logarithm is logarithm in base e.

public static NDArray log(in NDArray x)

Parameters

x NDArray

Input value.

Returns

NDArray

The natural logarithm of x, element-wise. This is a scalar if x is a scalar.

Remarks

log(in NDArray, NPTypeCode?)

Natural logarithm, element-wise. The natural logarithm log is the inverse of the exponential function, so that log(exp(x)) = x. The natural logarithm is logarithm in base e.

public static NDArray log(in NDArray x, NPTypeCode? outType = null)

Parameters

x NDArray

Input value.

outType NPTypeCode?

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

The natural logarithm of x, element-wise. This is a scalar if x is a scalar.

Remarks

log(in NDArray, Type)

Natural logarithm, element-wise. The natural logarithm log is the inverse of the exponential function, so that log(exp(x)) = x. The natural logarithm is logarithm in base e.

public static NDArray log(in NDArray x, Type outType)

Parameters

x NDArray

Input value.

outType Type

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

The natural logarithm of x, element-wise. This is a scalar if x is a scalar.

Remarks

log10(in NDArray)

Return the base 10 logarithm of the input array, element-wise.

public static NDArray log10(in NDArray x)

Parameters

x NDArray

Input value.

Returns

NDArray

The logarithm to the base 10 of x, element-wise. NaNs are returned where x is negative. This is a scalar if x is a scalar.

Remarks

log10(in NDArray, NPTypeCode?)

Return the base 10 logarithm of the input array, element-wise.

public static NDArray log10(in NDArray x, NPTypeCode? outType = null)

Parameters

x NDArray

Input value.

outType NPTypeCode?

Returns

NDArray

The logarithm to the base 10 of x, element-wise. NaNs are returned where x is negative. This is a scalar if x is a scalar.

Remarks

log10(in NDArray, Type)

Return the base 10 logarithm of the input array, element-wise.

public static NDArray log10(in NDArray x, Type outType)

Parameters

x NDArray

Input value.

outType Type

Returns

NDArray

The logarithm to the base 10 of x, element-wise. NaNs are returned where x is negative. This is a scalar if x is a scalar.

Remarks

log1p(in NDArray)

Return the natural logarithm of one plus the input array, element-wise.
Calculates log(1 + x).

public static NDArray log1p(in NDArray x)

Parameters

x NDArray

Input value.

Returns

NDArray

Natural logarithm of 1 + x, element-wise. This is a scalar if x is a scalar.

Remarks

log1p(in NDArray, NPTypeCode?)

Return the natural logarithm of one plus the input array, element-wise.
Calculates log(1 + x).

public static NDArray log1p(in NDArray x, NPTypeCode? outType = null)

Parameters

x NDArray

Input value.

outType NPTypeCode?

Returns

NDArray

Natural logarithm of 1 + x, element-wise. This is a scalar if x is a scalar.

Remarks

log1p(in NDArray, Type)

Return the natural logarithm of one plus the input array, element-wise.
Calculates log(1 + x).

public static NDArray log1p(in NDArray x, Type outType)

Parameters

x NDArray

Input value.

outType Type

Returns

NDArray

Natural logarithm of 1 + x, element-wise. This is a scalar if x is a scalar.

Remarks

log2(in NDArray)

Base-2 logarithm of x.

public static NDArray log2(in NDArray x)

Parameters

x NDArray

Input value.

Returns

NDArray

Base-2 logarithm of x. This is a scalar if x is a scalar.

Remarks

log2(in NDArray, NPTypeCode?)

Base-2 logarithm of x.

public static NDArray log2(in NDArray x, NPTypeCode? outType = null)

Parameters

x NDArray

Input value.

outType NPTypeCode?

Returns

NDArray

Base-2 logarithm of x. This is a scalar if x is a scalar.

Remarks

log2(in NDArray, Type)

Base-2 logarithm of x.

public static NDArray log2(in NDArray x, Type outType)

Parameters

x NDArray

Input value.

outType Type

Returns

NDArray

Base-2 logarithm of x. This is a scalar if x is a scalar.

Remarks

matmul(in NDArray, in NDArray)

Matrix product of two arrays.

public static NDArray matmul(in NDArray x1, in NDArray x2)

Parameters

x1 NDArray

Lhs Input array, scalars not allowed.

x2 NDArray

Rhs Input array, scalars not allowed.

Returns

NDArray

The matrix product of the inputs. This is a scalar only when both x1, x2 are 1-d vectors.

Remarks

max(NDArray, int?, bool, Type)

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

public static NDArray max(NDArray a, int? axis = null, bool keepdims = false, Type dtype = null)

Parameters

a NDArray
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

maximum(in NDArray, in NDArray, NDArray)

Element-wise maximum of array elements. Compare two arrays and returns a new array containing the element-wise maxima.If one of the elements being compared is a NaN, then that element is returned.If both elements are NaNs then the first is returned.The latter distinction is important for complex NaNs, which are defined as at least one of the real or imaginary parts being a NaN. The net effect is that NaNs are propagated.

public static NDArray maximum(in NDArray x1, in NDArray x2, NDArray @out)

Parameters

x1 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

x2 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

out NDArray

Returns

NDArray

The maximum of x1 and x2, element-wise. This is a scalar if both x1 and x2 are scalars.

maximum(in NDArray, in NDArray, NPTypeCode?)

Element-wise maximum of array elements. Compare two arrays and returns a new array containing the element-wise maxima.If one of the elements being compared is a NaN, then that element is returned.If both elements are NaNs then the first is returned.The latter distinction is important for complex NaNs, which are defined as at least one of the real or imaginary parts being a NaN. The net effect is that NaNs are propagated.

public static NDArray maximum(in NDArray x1, in NDArray x2, NPTypeCode? outType = null)

Parameters

x1 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

x2 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

outType NPTypeCode?

Returns

NDArray

The maximum of x1 and x2, element-wise. This is a scalar if both x1 and x2 are scalars.

maximum(in NDArray, in NDArray, Type)

Element-wise maximum of array elements. Compare two arrays and returns a new array containing the element-wise maxima.If one of the elements being compared is a NaN, then that element is returned.If both elements are NaNs then the first is returned.The latter distinction is important for complex NaNs, which are defined as at least one of the real or imaginary parts being a NaN. The net effect is that NaNs are propagated.

public static NDArray maximum(in NDArray x1, in NDArray x2, Type outType)

Parameters

x1 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

x2 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

outType Type

Returns

NDArray

The maximum of x1 and x2, element-wise. This is a scalar if both x1 and x2 are scalars.

mean(in NDArray)

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 static NDArray mean(in NDArray a)

Parameters

a NDArray

Array containing numbers whose mean is desired. If a is not an array, a conversion is attempted.

Returns

NDArray

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

Remarks

mean(in NDArray, 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 static NDArray mean(in NDArray a, bool keepdims)

Parameters

a NDArray

Array containing numbers whose mean is desired. If a is not an array, a conversion is attempted.

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(in NDArray, 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 static NDArray mean(in NDArray a, int axis)

Parameters

a NDArray

Array containing numbers whose mean is desired. If a is not an array, a conversion is attempted.

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(in NDArray, 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 static NDArray mean(in NDArray a, int axis, NPTypeCode type, bool keepdims = false)

Parameters

a NDArray

Array containing numbers whose mean is desired. If a is not an array, a conversion is attempted.

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(in NDArray, 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 static NDArray mean(in NDArray a, int axis, bool keepdims)

Parameters

a NDArray

Array containing numbers whose mean is desired. If a is not an array, a conversion is attempted.

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(in NDArray, 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 static NDArray mean(in NDArray a, int axis, Type dtype, bool keepdims = false)

Parameters

a NDArray

Array containing numbers whose mean is desired. If a is not an array, a conversion is attempted.

axis int

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

dtype 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

meshgrid(NDArray, NDArray, Kwargs)

Return coordinate matrices from coordinate vectors. Make N-D coordinate arrays for vectorized evaluations of N-D scalar/vector fields over N-D grids, given one-dimensional coordinate arrays x1, x2,..., xn. .. versionchanged:: 1.9 1-D and 0-D cases are allowed.

public static (NDArray, NDArray) meshgrid(NDArray x1, NDArray x2, Kwargs kwargs = null)

Parameters

x1 NDArray

1-D arrays representing the coordinates of a grid

x2 NDArray

1-D arrays representing the coordinates of a grid

kwargs Kwargs

Returns

(NDArray Lhs, NDArray Rhs)

mgrid(NDArray, 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 static (NDArray, NDArray) mgrid(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

(NDArray Lhs, NDArray Rhs)

mesh-grid ndarrays all of the same dimensions

Remarks

min(in NDArray, int?, bool, Type)

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

public static NDArray min(in NDArray a, int? axis = null, bool keepdims = false, Type dtype = null)

Parameters

a NDArray

Input data.

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

minimum(in NDArray, in NDArray, NDArray)

Element-wise minimum of array elements. Compare two arrays and returns a new array containing the element-wise minima.If one of the elements being compared is a NaN, then that element is returned.If both elements are NaNs then the first is returned.The latter distinction is important for complex NaNs, which are defined as at least one of the real or imaginary parts being a NaN. The net effect is that NaNs are propagated.

public static NDArray minimum(in NDArray x1, in NDArray x2, NDArray @out)

Parameters

x1 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

x2 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

out NDArray

Returns

NDArray

The maximum of x1 and x2, element-wise. This is a scalar if both x1 and x2 are scalars.

minimum(in NDArray, in NDArray, NPTypeCode?)

Element-wise minimum of array elements. Compare two arrays and returns a new array containing the element-wise minima.If one of the elements being compared is a NaN, then that element is returned.If both elements are NaNs then the first is returned.The latter distinction is important for complex NaNs, which are defined as at least one of the real or imaginary parts being a NaN. The net effect is that NaNs are propagated.

public static NDArray minimum(in NDArray x1, in NDArray x2, NPTypeCode? outType = null)

Parameters

x1 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

x2 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

outType NPTypeCode?

Returns

NDArray

The maximum of x1 and x2, element-wise. This is a scalar if both x1 and x2 are scalars.

minimum(in NDArray, in NDArray, Type)

Element-wise minimum of array elements. Compare two arrays and returns a new array containing the element-wise minima.If one of the elements being compared is a NaN, then that element is returned.If both elements are NaNs then the first is returned.The latter distinction is important for complex NaNs, which are defined as at least one of the real or imaginary parts being a NaN. The net effect is that NaNs are propagated.

public static NDArray minimum(in NDArray x1, in NDArray x2, Type outType)

Parameters

x1 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

x2 NDArray

The arrays holding the elements to be compared. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

outType Type

Returns

NDArray

The maximum of x1 and x2, element-wise. This is a scalar if both x1 and x2 are scalars.

mintypecode(char[], string, char)

Return the character for the minimum-size type to which given types can be safely cast. The returned type character must represent the smallest size dtype such that an array of the returned type can handle the data from an array of all types in typechars(or if typechars is an array, then its dtype.char).

public static char mintypecode(char[] typechars, string typeset = "GDFgdf", char @default = 'd')

Parameters

typechars char[]
typeset string

The set of characters that the returned character is chosen from. The default set is ‘GDFgdf’.

default char

The default character, this is returned if none of the characters in typechars matches a character in typeset.

Returns

char

The character representing the minimum-size type that was found.

mintypecode(string, string, char)

Return the character for the minimum-size type to which given types can be safely cast. The returned type character must represent the smallest size dtype such that an array of the returned type can handle the data from an array of all types in typechars(or if typechars is an array, then its dtype.char).

public static char mintypecode(string typechars, string typeset = "GDFgdf", char @default = 'd')

Parameters

typechars string

every character represents a type. see char

typeset string

The set of characters that the returned character is chosen from. The default set is ‘GDFgdf’.

default char

The default character, this is returned if none of the characters in typechars matches a character in typeset.

Returns

char

The character representing the minimum-size type that was found.

mod(in NDArray, in NDArray)

public static NDArray mod(in NDArray x1, in NDArray x2)

Parameters

x1 NDArray
x2 NDArray

Returns

NDArray

Remarks

mod(in NDArray, in float)

public static NDArray mod(in NDArray x1, in float x2)

Parameters

x1 NDArray
x2 float

Returns

NDArray

modf(in NDArray, NPTypeCode?)

Return the fractional and integral parts of an array, element-wise. The fractional and integral parts are negative if the given number is negative.

public static (NDArray Fractional, NDArray Intergral) modf(in NDArray x, NPTypeCode? outType = null)

Parameters

x NDArray

Input array.

outType NPTypeCode?

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

(NDArray Lhs, NDArray Rhs)

Fractional part of x. This is a scalar if x is a scalar.

Remarks

modf(in NDArray, Type)

Return the fractional and integral parts of an array, element-wise. The fractional and integral parts are negative if the given number is negative.

public static (NDArray Fractional, NDArray Intergral) modf(in NDArray x, Type outType)

Parameters

x NDArray

Input array.

outType Type

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

(NDArray Lhs, NDArray Rhs)

Fractional part of x. This is a scalar if x is a scalar.

Remarks

moveaxis(in NDArray, int, int)

Move axes of an array to new positions. Other axes remain in their original order.

public static NDArray moveaxis(in NDArray a, int source, int destination)

Parameters

a NDArray

The array whose axes should be reordered.

source int

Original positions of the axes to move. These must be unique (distinct).

destination int

Destination positions for each of the original axes. These must also be unique (distinct).

Returns

NDArray

Array with moved axes.

Remarks

moveaxis(in NDArray, int, int[])

Move axes of an array to new positions. Other axes remain in their original order.

public static NDArray moveaxis(in NDArray a, int source, int[] destination)

Parameters

a NDArray

The array whose axes should be reordered.

source int

Original positions of the axes to move. These must be unique (distinct).

destination int[]

Destination positions for each of the original axes. These must also be unique (distinct).

Returns

NDArray

Array with moved axes.

Remarks

moveaxis(in NDArray, int[], int)

Move axes of an array to new positions. Other axes remain in their original order.

public static NDArray moveaxis(in NDArray a, int[] source, int destination)

Parameters

a NDArray

The array whose axes should be reordered.

source int[]

Original positions of the axes to move. These must be unique (distinct).

destination int

Destination positions for each of the original axes. These must also be unique (distinct).

Returns

NDArray

Array with moved axes.

Remarks

moveaxis(in NDArray, int[], int[])

Move axes of an array to new positions. Other axes remain in their original order.

public static NDArray moveaxis(in NDArray a, int[] source, int[] destination)

Parameters

a NDArray

The array whose axes should be reordered.

source int[]

Original positions of the axes to move. These must be unique (distinct).

destination int[]

Destination positions for each of the original axes. These must also be unique (distinct).

Returns

NDArray

Array with moved axes.

Remarks

multiply(in NDArray, in NDArray)

public static NDArray multiply(in NDArray x1, in NDArray x2)

Parameters

x1 NDArray
x2 NDArray

Returns

NDArray

Remarks

ndarray(Shape, Type, Array, char)

public static NDArray ndarray(Shape shape, Type dtype = null, Array buffer = null, char order = 'F')

Parameters

shape Shape
dtype Type
buffer Array
order char

Returns

NDArray

negative(in NDArray)

Numerical negative, element-wise.

public static NDArray negative(in NDArray nd)

Parameters

nd NDArray

Returns

NDArray

Remarks

nonzero(in NDArray)

Return the indices of the elements that are non-zero. Returns a tuple of arrays, one for each dimension of a, containing the indices of the non-zero elements in that dimension.The values in a are always tested and returned in row-major, C-style order. To group the indices by element, rather than dimension, use argwhere, which returns a row for each non-zero element.

public static NDArray<int>[] nonzero(in NDArray a)

Parameters

a NDArray

Input array.

Returns

NDArray<int>[]

Indices of elements that are non-zero.

Remarks

ones(Shape)

Return a new array of given shape and type, filled with ones.

public static NDArray ones(Shape shape)

Parameters

shape Shape

Shape of the new array.

Returns

NDArray

Remarks

ones(Shape, NPTypeCode)

Return a new array of given shape and type, filled with ones.

public static NDArray ones(Shape shape, NPTypeCode typeCode)

Parameters

shape Shape

Shape of the new array.

typeCode NPTypeCode

The desired data-type for the array, e.g., uint8. Default is float64 / double.

Returns

NDArray

Remarks

ones(Shape, Type)

Return a new array of given shape and type, filled with ones.

public static NDArray ones(Shape shape, Type dtype)

Parameters

shape Shape

Shape of the new array.

dtype Type

The desired data-type for the array, e.g., uint8. Default is float64 / double.

Returns

NDArray

Remarks

ones(params int[])

Return a new array of given shape and type, filled with ones.

public static NDArray ones(params int[] shapes)

Parameters

shapes int[]

Shape of the new array.

Returns

NDArray

Remarks

ones(Type, params int[])

Return a new array of given shape and type, filled with ones.

public static NDArray ones(Type dtype = null, params int[] shapes)

Parameters

dtype Type

The desired data-type for the array, e.g., uint8. Default is float64 / double.

shapes int[]

Shape of the new array.

Returns

NDArray

Remarks

ones_like(NDArray, Type)

Return an array of ones with the same shape and type as a given array.

public static NDArray ones_like(NDArray a, Type dtype = null)

Parameters

a NDArray

Array of ones with the same shape and type as a.

dtype Type

Overrides the data type of the result.

Returns

NDArray

Array of zeros with the same shape and type as nd.

Remarks

ones<T>(params int[])

Return a new array of given shape and type, filled with ones.

public static NDArray ones<T>(params int[] shapes) where T : unmanaged

Parameters

shapes int[]

Shape of the new array.

Returns

NDArray

Type Parameters

T

The desired data-type for the array, e.g., uint8. Default is float64 / double.

Remarks

outer(in NDArray, in NDArray)

Compute the outer product of two vectors. Given two vectors, a = [a0, a1, ..., aM] and b = [b0, b1, ..., bN], the outer product[R60] is:

public static NDArray outer(in NDArray a, in NDArray b)

Parameters

a NDArray

First input vector. Input is flattened if not already 1-dimensional.

b NDArray

Second input vector. Input is flattened if not already 1-dimensional.

Returns

NDArray

out[i, j] = a[i] * b[j]

Remarks

positive(in NDArray)

Numerical positive, element-wise.

public static NDArray positive(in NDArray nd)

Parameters

nd NDArray

Returns

NDArray

Remarks

power(in NDArray, in ValueType)

First array elements raised to powers from second array, element-wise.

public static NDArray power(in NDArray x1, in ValueType x2)

Parameters

x1 NDArray

The bases.

x2 ValueType

The exponents.

Returns

NDArray

The bases in x1 raised to the exponents in x2. This is a scalar NDArray if both x1 and x2 are scalars.

Remarks

power(in NDArray, in ValueType, NPTypeCode)

First array elements raised to powers from second array, element-wise.

public static NDArray power(in NDArray x1, in ValueType x2, NPTypeCode typeCode)

Parameters

x1 NDArray

The bases.

x2 ValueType

The exponents.

typeCode NPTypeCode

The dtype of the returned NDArray

Returns

NDArray

The bases in x1 raised to the exponents in x2. This is a scalar NDArray if both x1 and x2 are scalars.

Remarks

power(in NDArray, in ValueType, Type)

First array elements raised to powers from second array, element-wise.

public static NDArray power(in NDArray x1, in ValueType x2, Type dtype)

Parameters

x1 NDArray

The bases.

x2 ValueType

The exponents.

dtype Type

The dtype of the returned NDArray

Returns

NDArray

The bases in x1 raised to the exponents in x2. This is a scalar NDArray if both x1 and x2 are scalars.

Remarks

prod(in NDArray, int?, Type, bool)

Return the product of array elements over a given axis.

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

Parameters

a NDArray

Input data.

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

ravel(NDArray)

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

public static NDArray ravel(NDArray a)

Parameters

a NDArray

Input array. The elements in a are read in the order specified by order, and packed as a 1-D array.

Returns

NDArray

Remarks

repeat(NDArray, int)

Repeat elements of an array.

public static NDArray repeat(NDArray a, int repeats)

Parameters

a NDArray

Input array.

repeats int

The number of repetitions for each element. repeats is broadcasted to fit the shape of the given axis.

Returns

NDArray

Remarks

repeat<T>(T, int)

Repeat a scalar.

public static NDArray repeat<T>(T a, int repeats) where T : unmanaged

Parameters

a T

Input scalar.

repeats int

The number of repetitions for each element. repeats is broadcasted to fit the shape of the given axis.

Returns

NDArray

Type Parameters

T

Remarks

reshape(NDArray, Shape)

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

public static NDArray reshape(NDArray nd, Shape shape)

Parameters

nd NDArray

Array to be reshaped.

shape Shape

The new shape should be compatible with the original shape.

Returns

NDArray

original nd reshaped without copying.

Remarks

reshape(NDArray, ref Shape)

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

public static NDArray reshape(NDArray nd, ref Shape shape)

Parameters

nd NDArray

Array to be reshaped.

shape Shape

The new shape should be compatible with the original shape.

Returns

NDArray

original nd reshaped without copying.

Remarks

reshape(NDArray, params int[])

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

public static NDArray reshape(NDArray nd, params int[] shape)

Parameters

nd NDArray

Array to be reshaped.

shape int[]

The new shape should be compatible with the original shape.

Returns

NDArray

original nd reshaped without copying.

Remarks

roll(NDArray, int, int?)

Roll array elements along a given axis.

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

public static NDArray roll(NDArray a, int shift, int? axis = null)

Parameters

a NDArray

Input array.

shift int

The number of places by which elements are shifted.

axis int?

Axis along which elements are shifted. By default, the array is flattened before shifting, after which the original shape is restored.

Returns

NDArray

Output array, with the same shape as a.

Remarks

Matches NumPy's algorithm: empty_like + slice-copy pairs. https://numpy.org/doc/stable/reference/generated/numpy.roll.html

rollaxis(in NDArray, int, int)

Roll the specified axis backwards, until it lies in a given position.
This function continues to be supported for backward compatibility, but you should prefer moveaxis. The moveaxis function was added in NumPy 1.11.

public static NDArray rollaxis(in NDArray a, int axis, int start = 0)

Parameters

a NDArray

Input array.

axis int

The axis to roll backwards. The positions of the other axes do not change relative to one another.

start int

The axis is rolled until it lies before this position. The default, 0, results in a “complete” roll.

Returns

NDArray

Remarks

round_(in NDArray, int, NPTypeCode?)

Evenly round to the given number of decimals.

public static NDArray round_(in NDArray x, int decimals, NPTypeCode? outType = null)

Parameters

x NDArray

Input array

decimals int

Number of decimal places to round to

outType NPTypeCode?

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

An array of the same type as a, containing the rounded values. Unless out was specified, a new array is created. A reference to the result is returned. The real and imaginary parts of complex numbers are rounded separately.The result of rounding a float is a float.

Remarks

round_(in NDArray, int, Type)

Evenly round to the given number of decimals.

public static NDArray round_(in NDArray x, int decimals, Type outType)

Parameters

x NDArray

Input array

decimals int

Number of decimal places to round to

outType Type

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

An array of the same type as a, containing the rounded values. Unless out was specified, a new array is created. A reference to the result is returned. The real and imaginary parts of complex numbers are rounded separately.The result of rounding a float is a float.

Remarks

round_(in NDArray, NPTypeCode?)

Evenly round to the given number of decimals.

public static NDArray round_(in NDArray x, NPTypeCode? outType = null)

Parameters

x NDArray

Input array

outType NPTypeCode?

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

An array of the same type as a, containing the rounded values. Unless out was specified, a new array is created. A reference to the result is returned. The real and imaginary parts of complex numbers are rounded separately.The result of rounding a float is a float.

Remarks

round_(in NDArray, Type)

Evenly round to the given number of decimals.

public static NDArray round_(in NDArray x, Type outType)

Parameters

x NDArray

Input array

outType Type

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

An array of the same type as a, containing the rounded values. Unless out was specified, a new array is created. A reference to the result is returned. The real and imaginary parts of complex numbers are rounded separately.The result of rounding a float is a float.

Remarks

save(string, NDArray)

public static void save(string filepath, NDArray arr)

Parameters

filepath string
arr NDArray

save(string, Array)

public static void save(string filepath, Array arr)

Parameters

filepath string
arr Array

searchsorted(NDArray, NDArray)

Find indices where elements should be inserted to maintain order.

Find the indices into a sorted array a such that, if the corresponding elements in v were inserted before the indices, the order of a would be preserved.

public static NDArray searchsorted(NDArray a, NDArray v)

Parameters

a NDArray

Input array. Must be sorted in ascending order.

v NDArray

Values to insert into a.

Returns

NDArray

Array of insertion points with the same shape as v.

Remarks

sign(in NDArray, NPTypeCode?)

public static NDArray sign(in NDArray x, NPTypeCode? outType = null)

Parameters

x NDArray
outType NPTypeCode?

Returns

NDArray

sign(in NDArray, Type)

public static NDArray sign(in NDArray x, Type outType)

Parameters

x NDArray
outType Type

Returns

NDArray

sin(in NDArray, NPTypeCode?)

Trigonometric sine, element-wise.

public static NDArray sin(in NDArray x, NPTypeCode? outType = null)

Parameters

x NDArray

Angle, in radians (2 \pi rad equals 360 degrees).

outType NPTypeCode?

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

The sine of each element of x. This is a scalar if x is a scalar.

Remarks

sin(in NDArray, Type)

Trigonometric sine, element-wise.

public static NDArray sin(in NDArray x, Type outType)

Parameters

x NDArray

Angle, in radians (2 \pi rad equals 360 degrees).

outType Type

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

The sine of each element of x. This is a scalar if x is a scalar.

Remarks

sinh(in NDArray, NPTypeCode?)

Hyperbolic sine, element-wise.
Equivalent to 1/2 * (np.exp(x) - np.exp(-x)) or -1j * np.sin(1j*x).

public static NDArray sinh(in NDArray x, NPTypeCode? outType = null)

Parameters

x NDArray

Input array.

outType NPTypeCode?

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

The sine of each element of x. This is a scalar if x is a scalar.

Remarks

sinh(in NDArray, Type)

Hyperbolic sine, element-wise.
Equivalent to 1/2 * (np.exp(x) - np.exp(-x)) or -1j * np.sin(1j*x).

public static NDArray sinh(in NDArray x, Type outType)

Parameters

x NDArray

Input array.

outType Type

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

The sine of each element of x. This is a scalar if x is a scalar.

Remarks

size(NDArray, int?)

Return the number of elements along a given axis.

public static int size(NDArray a, int? axis = null)

Parameters

a NDArray

Input data.

axis int?

Axis along which the elements are counted. By default, give the total number of elements.

Returns

int

Number of elements along the specified axis.

Remarks

sqrt(in NDArray, NPTypeCode?)

Return the non-negative square-root of an array, element-wise.

public static NDArray sqrt(in NDArray x, NPTypeCode? outType = null)

Parameters

x NDArray

The values whose square-roots are required.

outType NPTypeCode?

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

An array of the same shape as x, containing the positive square-root of each element in x. If any element in x is complex, a complex array is returned (and the square-roots of negative reals are calculated). If all of the elements in x are real, so is y, with negative elements returning nan. If out was provided, y is a reference to it. This is a scalar if x is a scalar.

Remarks

sqrt(in NDArray, Type)

Return the non-negative square-root of an array, element-wise.

public static NDArray sqrt(in NDArray x, Type outType)

Parameters

x NDArray

The values whose square-roots are required.

outType Type

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

An array of the same shape as x, containing the positive square-root of each element in x. If any element in x is complex, a complex array is returned (and the square-roots of negative reals are calculated). If all of the elements in x are real, so is y, with negative elements returning nan. If out was provided, y is a reference to it. This is a scalar if x is a scalar.

Remarks

square(in NDArray)

Return the element-wise square of the input.

public static NDArray square(in NDArray x)

Parameters

x NDArray

Input data.

Returns

NDArray

Element-wise x*x, of the same shape and dtype as x. Returns scalar if x is a scalar.

Remarks

squeeze(NDArray)

Remove single-dimensional entries from the shape of an array.

public static NDArray squeeze(NDArray a)

Parameters

a NDArray

Input data.

Returns

NDArray

The input array, but with all or a subset of the dimensions of length 1 removed. This is always a itself or a view into a.

Remarks

squeeze(NDArray, int)

Remove single-dimensional entries from the shape of an array.

public static NDArray squeeze(NDArray a, int axis)

Parameters

a NDArray

Input data.

axis int

Selects a subset of the single-dimensional entries in the shape. If an axis is selected with shape entry greater than one, an error is raised.

Returns

NDArray

The input array, but with all or a subset of the dimensions of length 1 removed. This is always a itself or a view into a.

Remarks

Exceptions

IncorrectShapeException

If axis is not None, and an axis being squeezed is not of length 1

squeeze(Shape)

Remove single-dimensional entries from a shape.

public static Shape squeeze(Shape shape)

Parameters

shape Shape

Input shape.

Returns

Shape

The input array, but with all or a subset of the dimensions of length 1 removed. This is always a itself or a view into a.

Remarks

stack(NDArray[], int)

Join a sequence of arrays along a new axis. The axis parameter specifies the index of the new axis in the dimensions of the result. For example, if axis=0 it will be the first dimension and if axis=-1 it will be the last dimension.

public static NDArray stack(NDArray[] arrays, int axis = 0)

Parameters

arrays NDArray[]

Each array must have the same shape.

axis int

The axis in the result array along which the input arrays are stacked.

Returns

NDArray

The stacked array has one more dimension than the input arrays.

Remarks

std(NDArray, 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 static NDArray std(NDArray a, bool keepdims = false, int? ddof = null, NPTypeCode? dtype = null)

Parameters

a NDArray

Calculate the standard deviation of these values.

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(NDArray, 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 static NDArray std(NDArray a, int axis, bool keepdims = false, int? ddof = null, NPTypeCode? dtype = null)

Parameters

a NDArray

Calculate the standard deviation of these values.

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

std(in NDArray, bool, int?)

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 static NDArray std(in NDArray a, bool keepdims, int? ddof = null)

Parameters

a NDArray

Calculate the standard deviation of these values.

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.

Returns

NDArray

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

Remarks

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

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 static NDArray std(in NDArray a, int axis, NPTypeCode type, bool keepdims = false, int? ddof = null)

Parameters

a NDArray

Calculate the standard deviation of these values.

axis int

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

type NPTypeCode
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.

Returns

NDArray

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

Remarks

std(in NDArray, int, bool, int?)

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 static NDArray std(in NDArray a, int axis, bool keepdims, int? ddof = null)

Parameters

a NDArray

Calculate the standard deviation of these values.

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.

Returns

NDArray

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

Remarks

std(in NDArray, int, int?)

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 static NDArray std(in NDArray a, int axis, int? ddof = null)

Parameters

a NDArray

Calculate the standard deviation of these values.

axis int

Axis or axes along which the standard deviation is computed. The default is to compute the standard deviation of the flattened 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.

Returns

NDArray

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

Remarks

std(in NDArray, int, Type, bool, int?)

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 static NDArray std(in NDArray a, int axis, Type dtype, bool keepdims = false, int? ddof = null)

Parameters

a NDArray

Calculate the standard deviation of these values.

axis int

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

dtype Type
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.

Returns

NDArray

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

Remarks

std(in NDArray, int?)

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 static NDArray std(in NDArray a, int? ddof = null)

Parameters

a NDArray

Calculate the standard deviation of these values.

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.

Returns

NDArray

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

Remarks

subtract(in NDArray, in NDArray)

public static NDArray subtract(in NDArray x1, in NDArray x2)

Parameters

x1 NDArray
x2 NDArray

Returns

NDArray

Remarks

sum(in NDArray)

Sum of array elements over a given axis.

public static NDArray sum(in NDArray a)

Parameters

a NDArray

Elements to 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(in NDArray, bool)

Sum of array elements over a given axis.

public static NDArray sum(in NDArray a, bool keepdims)

Parameters

a NDArray

Elements to sum.

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.

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(in NDArray, int)

Sum of array elements over a given axis.

public static NDArray sum(in NDArray a, int axis)

Parameters

a NDArray

Elements to sum.

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(in NDArray, NPTypeCode?)

Sum of array elements over a given axis.

public static NDArray sum(in NDArray a, NPTypeCode? typeCode)

Parameters

a NDArray

Elements to sum.

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(in NDArray, int?, bool)

Sum of array elements over a given axis.

public static NDArray sum(in NDArray a, int? axis, bool keepdims)

Parameters

a NDArray

Elements to sum.

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.

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(in NDArray, int?, bool, NPTypeCode?)

Sum of array elements over a given axis.

public static NDArray sum(in NDArray a, int? axis, bool keepdims, NPTypeCode? typeCode)

Parameters

a NDArray

Elements to sum.

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(in NDArray, int?, bool, Type)

Sum of array elements over a given axis.

public static NDArray sum(in NDArray a, int? axis, bool keepdims, Type dtype)

Parameters

a NDArray

Elements to sum.

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

sum(in NDArray, int?, NPTypeCode?)

Sum of array elements over a given axis.

public static NDArray sum(in NDArray a, int? axis, NPTypeCode? typeCode)

Parameters

a NDArray

Elements to sum.

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.

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(in NDArray, int?, Type)

Sum of array elements over a given axis.

public static NDArray sum(in NDArray a, int? axis, Type dtype)

Parameters

a NDArray

Elements to sum.

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.

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

sum(in NDArray, Type)

Sum of array elements over a given axis.

public static NDArray sum(in NDArray a, Type dtype)

Parameters

a NDArray

Elements to sum.

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

swapaxes(in NDArray, int, int)

Interchange two axes of an array.

public static NDArray swapaxes(in NDArray a, int axis1, int axis2)

Parameters

a NDArray

Input array.

axis1 int

First axis.

axis2 int

Second axis.

Returns

NDArray

Remarks

tan(in NDArray, NPTypeCode?)

Compute tangent element-wise.
Equivalent to np.sin(x)/np.cos(x) element-wise.

public static NDArray tan(in NDArray x, NPTypeCode? outType = null)

Parameters

x NDArray

Angle, in radians (2 \pi rad equals 360 degrees).

outType NPTypeCode?

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

The sine of each element of x. This is a scalar if x is a scalar.

Remarks

tan(in NDArray, Type)

Trigonometric sine, element-wise.

public static NDArray tan(in NDArray x, Type outType)

Parameters

x NDArray

Angle, in radians (2 \pi rad equals 360 degrees).

outType Type

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

The sine of each element of x. This is a scalar if x is a scalar.

Remarks

tanh(in NDArray, NPTypeCode?)

Compute hyperbolic tangent element-wise.
Equivalent to np.sinh(x)/np.cosh(x) or -1j * np.tan(1j*x).

public static NDArray tanh(in NDArray x, NPTypeCode? outType = null)

Parameters

x NDArray

Input array.

outType NPTypeCode?

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

The sine of each element of x. This is a scalar if x is a scalar.

Remarks

tanh(in NDArray, Type)

Compute hyperbolic tangent element-wise.
Equivalent to np.sinh(x)/np.cosh(x) or -1j * np.tan(1j*x).

public static NDArray tanh(in NDArray x, Type outType)

Parameters

x NDArray

Input array.

outType Type

The dtype the returned ndarray should be of, only non integer values are supported.

Returns

NDArray

The sine of each element of x. This is a scalar if x is a scalar.

Remarks

transpose(in NDArray, int[])

Permute the dimensions of an array.

public static NDArray transpose(in NDArray a, int[] premute = null)

Parameters

a NDArray

Input array.

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

true_divide(in NDArray, in NDArray)

public static NDArray true_divide(in NDArray x1, in NDArray x2)

Parameters

x1 NDArray
x2 NDArray

Returns

NDArray

Remarks

unique(in NDArray)

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 static NDArray unique(in NDArray a)

Parameters

a NDArray

Returns

NDArray

The sorted unique values.

Remarks

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

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

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

Parameters

a NDArray

Array containing numbers whose variance is desired. If a is not an array, a conversion is attempted.

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 var values, otherwise a reference to the output array is returned.

Remarks

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

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

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

Parameters

a NDArray

Array containing numbers whose variance is desired. If a is not an array, a conversion is attempted.

axis int

Axis or axes along which the variance is computed. The default is to compute the variance 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 var values, otherwise a reference to the output array is returned.

Remarks

var(in NDArray, bool, int?)

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

public static NDArray var(in NDArray a, bool keepdims, int? ddof = null)

Parameters

a NDArray

Array containing numbers whose variance is desired. If a is not an array, a conversion is attempted.

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.

Returns

NDArray

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

Remarks

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

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

public static NDArray var(in NDArray a, int axis, NPTypeCode type, bool keepdims = false, int? ddof = null)

Parameters

a NDArray

Array containing numbers whose variance is desired. If a is not an array, a conversion is attempted.

axis int

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

type NPTypeCode
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.

Returns

NDArray

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

Remarks

var(in NDArray, int, bool, int?)

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

public static NDArray var(in NDArray a, int axis, bool keepdims, int? ddof = null)

Parameters

a NDArray

Array containing numbers whose variance is desired. If a is not an array, a conversion is attempted.

axis int

Axis or axes along which the variance is computed. The default is to compute the variance 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.

Returns

NDArray

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

Remarks

var(in NDArray, int, int?)

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

public static NDArray var(in NDArray a, int axis, int? ddof = null)

Parameters

a NDArray

Array containing numbers whose variance is desired. If a is not an array, a conversion is attempted.

axis int

Axis or axes along which the variance is computed. The default is to compute the variance of the flattened 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.

Returns

NDArray

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

Remarks

var(in NDArray, int, Type, bool, int?)

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

public static NDArray var(in NDArray a, int axis, Type dtype, bool keepdims = false, int? ddof = null)

Parameters

a NDArray

Array containing numbers whose variance is desired. If a is not an array, a conversion is attempted.

axis int

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

dtype Type
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.

Returns

NDArray

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

Remarks

var(in NDArray, int?)

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

public static NDArray var(in NDArray a, int? ddof = null)

Parameters

a NDArray

Array containing numbers whose variance is desired. If a is not an array, a conversion is attempted.

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.

Returns

NDArray

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

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 static 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

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

Remarks

zeros(Shape)

Return a new double array of given shape, filled with zeros.

public static NDArray zeros(Shape shape)

Parameters

shape Shape

Shape of the new array,

Returns

NDArray

Array of zeros with the given shape, dtype.

Remarks

zeros(Shape, NPTypeCode)

Return a new double array of given shape, filled with zeros.

public static NDArray zeros(Shape shape, NPTypeCode typeCode)

Parameters

shape Shape

Shape of the new array,

typeCode NPTypeCode

The desired data-type for the array, e.g., uint8. Default is float64 / double.

Returns

NDArray

Array of zeros with the given shape, dtype.

Remarks

zeros(Shape, Type)

Return a new double array of given shape, filled with zeros.

public static NDArray zeros(Shape shape, Type dtype)

Parameters

shape Shape

Shape of the new array,

dtype Type

The desired data-type for the array, e.g., uint8. Default is float64 / double.

Returns

NDArray

Array of zeros with the given shape, dtype.

Remarks

zeros(params int[])

Return a new double array of given shape, filled with zeros.

public static NDArray zeros(params int[] shapes)

Parameters

shapes int[]

Shape of the new array,

Returns

NDArray

Array of zeros with the given shape, dtype.

Remarks

zeros_like(NDArray, Type)

Return an array of zeros with the same shape and type as a given array.

public static NDArray zeros_like(NDArray a, Type dtype = null)

Parameters

a NDArray

The shape and data-type of a define these same attributes of the returned array.

dtype Type

Overrides the data type of the result.

Returns

NDArray

Array of zeros with the same shape and type as nd.

Remarks

zeros<T>(params int[])

Return a new double array of given shape, filled with zeros.

public static NDArray zeros<T>(params int[] shapes) where T : unmanaged

Parameters

shapes int[]

Shape of the new array,

Returns

NDArray

Array of zeros with the given shape, type T.

Type Parameters

T

Remarks