lenskit.data.matrix.SparseRowType ================================= .. py:class:: lenskit.data.matrix.SparseRowType(dimension, value_type = pa.float32(), large = False) Bases: :py:obj:`pyarrow.ExtensionType` Data type for sparse rows stored in Arrow. Sparse rows are stored as lists of structs with ``index`` and ``column`` fields. .. stability:: internal .. py:attribute:: value_type :type: pyarrow.DataType | None .. py:attribute:: index_type :type: SparseIndexType .. py:method:: from_type(data_type, dimension = None) :classmethod: Create a sparse row type from an Arrow data type, handling legacy struct layouts without the extension types. :param data_type: The Arrow data type to interpret as a row type. :param dimension: The row dimension, if known from an external source. If provided and the data type also includes the dimensionality, both dimensions must match. :raises TypeError: If the data type is not a valid sparse row type. :raises ValueError: If there is another error, such as mismatched dimensions. .. py:property:: dimension :type: int .. py:method:: __arrow_ext_serialize__() .. py:method:: __arrow_ext_deserialize__(storage_type, serialized) :classmethod: .. py:method:: __arrow_ext_class__()