Scalar#

class cudf._lib.pylibcudf.scalar.Scalar(Scalar value=None)#

A scalar value in device memory.

This is the Cython representation of cudf::scalar.

Methods

from_arrow(Scalar value, DataType data_type=None)

Create a Scalar from a pyarrow Scalar.

is_valid(self)

True if the scalar is valid, false if not

to_arrow(self, ColumnMetadata metadata)

Convert to a pyarrow scalar.

type(self)

The type of data in the column.

static from_arrow(Scalar value, DataType data_type=None)#

Create a Scalar from a pyarrow Scalar.

Parameters:
valuepyarrow.Scalar

The pyarrow scalar to construct from

data_typeDataType, optional

The data type of the scalar. If not passed, the data type will be inferred from the pyarrow scalar.

is_valid(self) bool#

True if the scalar is valid, false if not

to_arrow(self, ColumnMetadata metadata) Scalar#

Convert to a pyarrow scalar.

Parameters:
metadataColumnMetadata

The metadata for the column the scalar is being used in.

type(self) DataType#

The type of data in the column.