abracudabra.conversion.cframe ============================= .. py:module:: abracudabra.conversion.cframe .. autoapi-nested-parse:: Convert to a pandas/cudf series or dataframe. Functions --------- .. autoapisummary:: abracudabra.conversion.cframe._guess_dataframe_device abracudabra.conversion.cframe.to_series abracudabra.conversion.cframe.to_dataframe Module Contents --------------- .. py:function:: _guess_dataframe_device(sequences: collections.abc.Iterable[torch.Tensor | abracudabra.annotations.Array], /, device: str | abracudabra.device.base.Device | None = None) -> abracudabra.device.base.Device Guess the device of a dataframe. .. py:function:: to_series(sequence: object, /, index: abracudabra.annotations.Array | torch.Tensor | None = None, device: str | abracudabra.device.base.Device | None = None, *, strict: bool = False, **kwargs: Any) -> abracudabra.annotations.Series Convert an array or tensor to a pandas/cudf series. :param sequence: The array or tensor to convert. :param index: The optional index for the series. :param device: The device to use for the series. :param strict: Whether to raise an error for unknown data types. :param kwargs: Additional keyword arguments for the series. :returns: The converted series. .. py:function:: to_dataframe(data: collections.abc.Mapping[str, abracudabra.annotations.Array | torch.Tensor] | torch.Tensor | abracudabra.annotations.Array, /, index: abracudabra.annotations.Array | torch.Tensor | None = None, device: str | abracudabra.device.base.Device | None = None, *, strict: bool = False, **kwargs: Any) -> abracudabra.annotations.DataFrame Convert to a pandas/cudf dataframe. :param data: The data to convert. If a mapping, the keys will be used as column names. :param index: The optional index for the dataframe. :param device: The device to use for the dataframe. :param strict: Whether to raise an error for unknown data types. :param kwargs: Additional keyword arguments for the dataframe. :returns: The converted dataframe.