from pandas.core.accessor import PandasDelegate
from pandas.core.series import Series
from typing_extensions import Self

class BaseAccessor:
    def __init__(self, data=...) -> None: ...

class SparseAccessor(BaseAccessor, PandasDelegate):
    @classmethod
    def from_coo(cls, A, dense_index: bool = False) -> Series: ...
    def to_coo(self, row_levels=..., column_levels=..., sort_labels: bool = False): ...
    def to_dense(self): ...

class SparseFrameAccessor(BaseAccessor, PandasDelegate):
    @classmethod
    def from_spmatrix(cls, data, index=..., columns=...) -> Self: ...
    def to_dense(self): ...
    def to_coo(self): ...
    @property
    def density(self) -> float: ...
