deephaven.dtypes

This module defines the data types supported by the Deephaven engine.

Each data type is represented by a DType class which supports creating arrays of the same type and more.

BigDecimal = java.math.BigDecimal

Java BigDecimal type

class DType(j_name, j_type=None, qst_type=None, is_primitive=False, np_type=<class 'numpy.object_'>)[source]

Bases: object

A class representing a data type in Deephaven.

DateTime = io.deephaven.time.DateTime

Deephaven DateTime type

JObject = java.lang.Object

Java Object type

Period = io.deephaven.time.Period

Deephaven time period type

PyObject = org.jpy.PyObject

Python object type

StringSet = io.deephaven.stringset.StringSet

Deephaven StringSet type

array(dtype, seq, remap=None)[source]

Creates a Java array of the specified data type populated with values from a sequence.

Note

this method does unsafe casting, meaning precision and values might be lost with down cast

Parameters
  • dtype (DType) – the component type of the array

  • seq (Sequence) – a sequence of compatible data, e.g. list, tuple, numpy array, Pandas series, etc.

  • remap (optional) – a callable that takes one value and maps it to another, for handling the translation of special DH values such as NULL_INT, NAN_INT between Python and the DH engine

Return type

JType

Returns

a Java array

Raises

DHError

bool_ = java.lang.Boolean

Boolean type

byte = byte

Signed byte integer type

byte_array = [B

Byte array type

char = char

Character type

datetime_array = [Lio.deephaven.time.DateTime;

Deephaven DateTime array type

double = double

Double-precision floating-point number type

double_array = [D

Double-precision floating-point array type

float32 = float

Single-precision floating-point number type

float32_array = [S

Single-precision floating-point array type

float64 = double

Double-precision floating-point number type

float64_array = [D

Double-precision floating-point array type

float_ = double

Double-precision floating-point number type

float_array = [D

Double-precision floating-point array type

from_jtype(j_class)[source]

looks up a DType that matches the java type, if not found, creates a DType for it.

Return type

DType

from_np_dtype(np_dtype)[source]

Looks up a DType that matches the provided numpy dtype or Pandas’s nullable equivalent; if not found, returns PyObject.

Return type

DType

int16 = short

Signed short integer type

int16_array = [S

Short array type

int32 = int

Signed 32bit integer type

int32_array = [I

32bit integer array type

int64 = long

Signed 64bit integer type

int64_array = [J

64bit integer array type

int8 = byte

Signed byte integer type

int8_array = [B

Byte array type

int_ = long

Signed 64bit integer type

int_array = [J

64bit integer array type

long = long

Signed 64bit integer type

long_array = [J

64bit integer array type

short = short

Signed short integer type

short_array = [S

Short array type

single = float

Single-precision floating-point number type

single_array = [S

Single-precision floating-point array type

string = java.lang.String

String type

string_array = [Ljava.lang.String;

Java String array type