Table of Contents

Class NumpyHelper

Namespace
Bonsai.ML.Python
Assembly
Bonsai.ML.Python.dll

Provides a set of static methods for working with NumPy arrays.

public static class NumpyHelper
Inheritance
NumpyHelper
Inherited Members

Methods

GetCSharpDataType(string)

Gets the C# data type for the specified NumPy data type.

public static Type GetCSharpDataType(string str)

Parameters

str string

Returns

Type

GetNumpyDataType(Type)

Gets the NumPy data type for the specified C# type.

public static PyObject GetNumpyDataType(Type type)

Parameters

type Type

Returns

PyObject

InitializeNumpy()

Initializes the NumPy module and returns a reference to the module.

public static PyObject InitializeNumpy()

Returns

PyObject

IsNumPyArray(PyObject)

Checks if the Python.Runtime.PyObject is a type of NumPy array.

public static bool IsNumPyArray(PyObject obj)

Parameters

obj PyObject

Returns

bool

PyObjectToArray(PyObject)

Converts a Python.Runtime.PyObject representing a NumPy array to a C# Array.

public static Array PyObjectToArray(PyObject array)

Parameters

array PyObject

Returns

Array