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

Function scalar

python/pyarrow/compute.py:750–777  ·  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

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

Callers 1

ToStringMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected