MCPcopy
hub / github.com/ray-project/ray / list

Method list

python/ray/data/expressions.py:806–826  ·  view source on GitHub ↗

Access list operations for this expression. Returns: A _ListNamespace that provides list-specific operations for both PyArrow ``List`` and ``FixedSizeList`` columns. Example: >>> from ray.data.expressions import col >>> import ray

(self)

Source from the content-addressed store, hash-verified

804
805 @property
806 def list(self) -> "_ListNamespace":
807 """Access list operations for this expression.
808
809 Returns:
810 A _ListNamespace that provides list-specific operations for both
811 PyArrow ``List`` and ``FixedSizeList`` columns.
812
813 Example:
814 >>> from ray.data.expressions import col
815 >>> import ray
816 >>> ds = ray.data.from_items([
817 ... {"items": [1, 2, 3]},
818 ... {"items": [4, 5]}
819 ... ])
820 >>> ds = ds.with_column("num_items", col("items").list.len())
821 >>> ds = ds.with_column("first_item", col("items").list[0])
822 >>> ds = ds.with_column("slice", col("items").list[1:3])
823 """
824 from ray.data.namespace_expressions.list_namespace import _ListNamespace
825
826 return _ListNamespace(self)
827
828 @property
829 def str(self) -> "_StringNamespace":

Callers 15

get_rayllm_testing_modelFunction · 0.45
testing_multiple_modelsFunction · 0.45
test_modelsMethod · 0.45
_list_subnetsFunction · 0.45
list_instancesMethod · 0.45
list_instancesMethod · 0.45
_get_filtered_nodesMethod · 0.45
list_tasksFunction · 0.45
_task_node_filterFunction · 0.45

Calls 1

_ListNamespaceClass · 0.90

Tested by 6

get_rayllm_testing_modelFunction · 0.36
testing_multiple_modelsFunction · 0.36
test_modelsMethod · 0.36
list_tasksFunction · 0.36