Shortcuts

torcharrow.Column.transform

Column.transform(func: Callable, dtype: Optional[DType] = None, format: str = 'column', columns: Optional[List[str]] = None)

类似于 map(),但每次调用时都会对一小批行进行调用。 默认情况下,列作为 TorchArrow 列传递给可调用对象。 如果 format=’python’,输入将转换为 Python 类型。 如果 format=’torch’,输入将转换为 PyTorch 类型。 如果结果类型 != 项目类型且可调用对象上缺少类型提示,则需要 dtype。