MCPcopy Index your code
hub / github.com/ray-project/ray / for_column

Method for_column

python/ray/data/block.py:892–910  ·  view source on GitHub ↗

Create a column accessor for the given column

(col: BlockColumn)

Source from the content-addressed store, hash-verified

890
891 @staticmethod
892 def for_column(col: BlockColumn) -> "BlockColumnAccessor":
893 """Create a column accessor for the given column"""
894 _check_pyarrow_version()
895
896 import pandas as pd
897
898 if isinstance(col, pa.Array) or isinstance(col, pa.ChunkedArray):
899 from ray.data._internal.arrow_block import ArrowBlockColumnAccessor
900
901 return ArrowBlockColumnAccessor(col)
902 elif isinstance(col, pd.Series):
903 from ray.data._internal.pandas_block import PandasBlockColumnAccessor
904
905 return PandasBlockColumnAccessor(col)
906 else:
907 raise TypeError(
908 f"Expected either a pandas.Series or pyarrow.Array "
909 f"(ChunkedArray) (got {type(col)})"
910 )
911
912
913def _get_group_boundaries_sorted_numpy(columns: list[np.ndarray]) -> np.ndarray:

Callers 15

aggregate_blockMethod · 0.80
_compute_uniqueMethod · 0.80
aggregate_blockMethod · 0.80
aggregate_blockMethod · 0.80
aggregate_blockMethod · 0.80
aggregate_blockMethod · 0.80
countMethod · 0.80
sumMethod · 0.80
minMethod · 0.80
maxMethod · 0.80
meanMethod · 0.80

Calls 3

_check_pyarrow_versionFunction · 0.90