Table of Contents

Class DType

Namespace
NumSharp
Assembly
NumSharp.dll
public class DType
Inheritance
DType
Inherited Members
Extension Methods

Remarks

Constructors

DType(Type)

Initializes a new instance of the object class.

public DType(Type type)

Parameters

type Type

Fields

_kind_list_map

protected static readonly FrozenDictionary<NPTypeCode, char> _kind_list_map

Field Value

FrozenDictionary<NPTypeCode, char>

byteorder

A character indicating the byte-order of this data-type object.
One of:

'=' native
'&lt;' little-endian
'>' big-endian
'|' not applicable

public char byteorder

Field Value

char

itemsize

The size of the dtype in bytes.

public int itemsize

Field Value

int

kind

A character code (one of ‘biufcmMOSUV’) identifying the general kind of data.

b boolean
i signed integer
u unsigned integer
f floating-point
c complex floating-point
m timedelta
M datetime
O object
S(byte-)string
U Unicode
V void

public char kind

Field Value

char

name

The name of this dtype.

public string name

Field Value

string

type

The actual type this dtype represents.

public Type type

Field Value

Type

typecode

The NumSharp type code.

public NPTypeCode typecode

Field Value

NPTypeCode

Properties

char

A unique character code for each of the 21 different built-in types.

public char @char { get; }

Property Value

char

Methods

newbyteorder(char)

Return a new dtype with a different byte order. Changes are also made in all fields and sub-arrays of the data type.

public DType newbyteorder(char new_order = 'S')

Parameters

new_order char

Byte order to force; a value from the byte order specifications below.
The default value (‘S’) results in swapping the current byte order.
new_order codes can be any of:
‘S’ - swap dtype from current to opposite endian
'=' - native order
'&lt;' - little-endian
'>' - big-endian
'|' - ignore(no change to byte order)
The code does a case-insensitive check on the first letter of new_order for these alternatives.
For example, any of ‘>’ or ‘B’ or ‘b’ or ‘brian’ are valid to specify big-endian.

Returns

DType

New dtype object with the given change to the byte order.