MCPcopy Create free account
hub / github.com/apache/arrow / scalar

Function scalar

python/pyarrow/compute.py:751–778  ·  view source on GitHub ↗

Expression representing a scalar value. Creates an Expression object representing a scalar value that can be used in compute expressions and predicates. Parameters ---------- value : bool, int, float or string Python value of the scalar. This function accepts any value

(value)

Source from the content-addressed store, hash-verified

749
750
751def scalar(value):
752 """Expression representing a scalar value.
753
754 Creates an Expression object representing a scalar value that can be used
755 in compute expressions and predicates.
756
757 Parameters
758 ----------
759 value : bool, int, float or string
760 Python value of the scalar. This function accepts any value that can be
761 converted to a ``pyarrow.Scalar`` using ``pa.scalar()``.
762
763 Notes
764 -----
765 This function differs from ``pyarrow.scalar()`` in the following way:
766
767 * ``pyarrow.scalar()`` creates a ``pyarrow.Scalar`` object that represents
768 a single value in Arrow's memory model.
769 * ``pyarrow.compute.scalar()`` creates an ``Expression`` object representing
770 a scalar value that can be used in compute expressions, predicates, and
771 dataset filtering operations.
772
773 Returns
774 -------
775 scalar_expr : Expression
776 An Expression representing the scalar value
777 """
778 return Expression._scalar(value)

Callers 1

ToStringMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected