Interface PyValue
- All Known Implementing Classes:
PyValue.Array, PyValue.Frame, PyValue.None, PyValue.Other, PyValue.PyDict, PyValue.PyList, PyValue.Str
public sealed interface PyValue
permits PyValue.Array, PyValue.Str, PyValue.PyList, PyValue.PyDict, PyValue.Frame, PyValue.None, PyValue.Other
A value exchanged with Python. Numbers are numpy arrays in Python (Python
lists or the array module if numpy isn't installed):
PyValue.Array: a numeric or boolean array with a shape (a scalar has the shape {}): float64, float32, int64, int32, int16, int8, uint8, uint16, uint32, uint64, boolPyValue.Str: strings (a str or a list of str)PyValue.PyList,PyValue.PyDict: list (tuple) and dictPyValue.Frame: a pandas DataFrame (a dict of columns without pandas)PyValue.None,PyValue.Other(any other object: its type and repr)
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordA numeric or boolean array.static final recordA table (a pandas DataFrame): the columns by name (each an Array or Str) and the row labels (null for the default 0..n-1).static final recordNone.static final recordAny other object: its type and repr (not transferable).static final recordA dict (the keys as strings, in their order).static final recordA list or tuple.static final recordStrings (null elements are None in Python). -
Method Summary
Modifier and TypeMethodDescriptionstatic PyValue.ArrayAn array with a shape (the data in row-major order, not copied).intlength()The number of elements.static PyValue.Arraymatrix(double[][] rows) A 2-d float64 array from rows (all rows must have the same length).static PyValue.Arrayof(boolean... values) static PyValue.Arrayof(double... values) static PyValue.Arrayof(int... values) static PyValue.Arrayof(long... values) static PyValue.Strstatic PyValue.ArrayofUnsigned(byte... values) Unsigned bytes (uint8, e.g., 8-bit image data).static PyValue.Arrayscalar(double value) A scalar float.
-
Method Details
-
length
int length()The number of elements. -
of
-
of
-
of
-
of
-
ofUnsigned
Unsigned bytes (uint8, e.g., 8-bit image data). -
of
-
scalar
A scalar float. -
matrix
A 2-d float64 array from rows (all rows must have the same length). -
array
An array with a shape (the data in row-major order, not copied).
-