pub struct SparseAccessor<'a> { /* private fields */ }Expand description
Accessor for sparse operations on a Series.
Created by Series::sparse(). Provides the pandas Series.sparse
namespace over the current dense-backed sparse dtype descriptor.
Implementations§
Source§impl SparseAccessor<'_>
impl SparseAccessor<'_>
Sourcepub fn value_dtype(&self) -> DType
pub fn value_dtype(&self) -> DType
Return the logical sparse value dtype.
Matches pd.Series.dtype.subtype (measured 2.2.3: float64 for a
Sparse[float64] Series).
⚠️ The path cited before, pd.Series.sparse.dtype, does not exist. The
.sparse accessor carries density/fill_value/sp_values/to_dense;
the dtype, and its subtype, hangs off the Series itself.
Sourcepub fn fill_value(&self) -> &Scalar
pub fn fill_value(&self) -> &Scalar
Return the sparse fill value.
Matches pd.Series.sparse.fill_value.
Sourcepub fn npoints(&self) -> usize
pub fn npoints(&self) -> usize
Count stored non-fill values.
Matches the SparseArray.sp_values cardinality used by pandas density.
Sourcepub fn sp_values(&self) -> Vec<Scalar>
pub fn sp_values(&self) -> Vec<Scalar>
Return the non-fill values as a Vec.
Matches pd.Series.sparse.sp_values (returns underlying non-fill data).
Sourcepub fn sp_index(&self) -> Vec<usize>
pub fn sp_index(&self) -> Vec<usize>
Return the indices of non-fill values.
Returns position indices (0-based) where values differ from fill_value.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for SparseAccessor<'a>
impl<'a> !UnwindSafe for SparseAccessor<'a>
impl<'a> Freeze for SparseAccessor<'a>
impl<'a> Send for SparseAccessor<'a>
impl<'a> Sync for SparseAccessor<'a>
impl<'a> Unpin for SparseAccessor<'a>
impl<'a> UnsafeUnpin for SparseAccessor<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more