Scalar#

class pylibcudf.scalar.Scalar(*args, **kwargs)#

A scalar value in device memory.

This is the Cython representation of cudf::scalar.

Methods

from_numpy(cls, np_val)

Convert a NumPy scalar to a Scalar.

from_py(cls, py_val)

Convert a Python standard library object to a Scalar.

is_valid(self)

True if the scalar is valid, false if not

type(self)

The type of data in the column.

classmethod from_numpy(cls, np_val)#

Convert a NumPy scalar to a Scalar.

Parameters:
np_val: numpy.generic

Value to convert to a pylibcudf.Scalar

Returns:
Scalar

New pylibcudf.Scalar

classmethod from_py(cls, py_val)#

Convert a Python standard library object to a Scalar.

Parameters:
py_val: bool, int, float, str, datetime.datetime, datetime.timedelta, list, dict

Value to convert to a pylibcudf.Scalar

Returns:
Scalar

New pylibcudf.Scalar

is_valid(self) bool#

True if the scalar is valid, false if not

type(self) DataType#

The type of data in the column.