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.sparse.dtype.subtype.
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> Freeze for SparseAccessor<'a>
impl<'a> RefUnwindSafe 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>
impl<'a> UnwindSafe 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
Mutably borrows from an owned value. Read more