pub struct Series { /* private fields */ }Implementations§
Source§impl Series
impl Series
pub fn new( name: impl Into<String>, index: Index, column: Column, ) -> Result<Self, FrameError>
pub fn from_values( name: impl Into<String>, index_labels: Vec<IndexLabel>, values: Vec<Scalar>, ) -> Result<Self, FrameError>
Sourcepub fn from_pairs(
name: impl Into<String>,
pairs: Vec<(IndexLabel, Scalar)>,
) -> Result<Self, FrameError>
pub fn from_pairs( name: impl Into<String>, pairs: Vec<(IndexLabel, Scalar)>, ) -> Result<Self, FrameError>
Construct a Series from key-value pairs (dict-style).
Keys become the index labels, values become the column.
Matches pd.Series({"a": 1, "b": 2}).
Sourcepub fn from_dict(
name: impl Into<String>,
data: BTreeMap<IndexLabel, Scalar>,
) -> Result<Self, FrameError>
pub fn from_dict( name: impl Into<String>, data: BTreeMap<IndexLabel, Scalar>, ) -> Result<Self, FrameError>
Construct a Series from a dict (BTreeMap) of label → value.
Matches pd.Series({"a": 1, "b": 2}).
Sourcepub fn arange(
name: impl Into<String>,
start: f64,
stop: f64,
step: f64,
) -> Result<Self, FrameError>
pub fn arange( name: impl Into<String>, start: f64, stop: f64, step: f64, ) -> Result<Self, FrameError>
Create a Series with evenly spaced values within a given interval.
Matches np.arange(start, stop, step).
Sourcepub fn linspace(
name: impl Into<String>,
start: f64,
stop: f64,
num: usize,
) -> Result<Self, FrameError>
pub fn linspace( name: impl Into<String>, start: f64, stop: f64, num: usize, ) -> Result<Self, FrameError>
Create a Series with evenly spaced values over [start, stop].
Matches np.linspace(start, stop, num).
Sourcepub fn logspace(
name: impl Into<String>,
start: f64,
stop: f64,
num: usize,
) -> Result<Self, FrameError>
pub fn logspace( name: impl Into<String>, start: f64, stop: f64, num: usize, ) -> Result<Self, FrameError>
Create a Series with evenly spaced values on a log scale.
Matches np.logspace(start, stop, num).
Sourcepub fn geomspace(
name: impl Into<String>,
start: f64,
stop: f64,
num: usize,
) -> Result<Self, FrameError>
pub fn geomspace( name: impl Into<String>, start: f64, stop: f64, num: usize, ) -> Result<Self, FrameError>
Create a Series with values evenly spaced on a log scale (geometric progression).
Matches np.geomspace(start, stop, num).
Sourcepub fn zeros(name: impl Into<String>, n: usize) -> Result<Self, FrameError>
pub fn zeros(name: impl Into<String>, n: usize) -> Result<Self, FrameError>
Create a Series filled with zeros (Float64 by default).
Matches np.zeros(n).
Sourcepub fn zeros_dtype(
name: impl Into<String>,
n: usize,
dtype: DType,
) -> Result<Self, FrameError>
pub fn zeros_dtype( name: impl Into<String>, n: usize, dtype: DType, ) -> Result<Self, FrameError>
Create a Series filled with zeros of specified dtype.
Matches np.zeros(n, dtype=dtype).
Sourcepub fn ones(name: impl Into<String>, n: usize) -> Result<Self, FrameError>
pub fn ones(name: impl Into<String>, n: usize) -> Result<Self, FrameError>
Create a Series filled with ones (Float64 by default).
Matches np.ones(n).
Sourcepub fn ones_dtype(
name: impl Into<String>,
n: usize,
dtype: DType,
) -> Result<Self, FrameError>
pub fn ones_dtype( name: impl Into<String>, n: usize, dtype: DType, ) -> Result<Self, FrameError>
Create a Series filled with ones of specified dtype.
Matches np.ones(n, dtype=dtype).
Sourcepub fn full(
name: impl Into<String>,
n: usize,
fill_value: Scalar,
) -> Result<Self, FrameError>
pub fn full( name: impl Into<String>, n: usize, fill_value: Scalar, ) -> Result<Self, FrameError>
Create a Series filled with a constant value.
Matches np.full(n, fill_value).
Sourcepub fn hanning(name: impl Into<String>, m: usize) -> Result<Self, FrameError>
pub fn hanning(name: impl Into<String>, m: usize) -> Result<Self, FrameError>
Generate a Hann (Hanning) window Series.
Matches np.hanning(M).
Sourcepub fn hamming(name: impl Into<String>, m: usize) -> Result<Self, FrameError>
pub fn hamming(name: impl Into<String>, m: usize) -> Result<Self, FrameError>
Generate a Hamming window Series.
Matches np.hamming(M).
Sourcepub fn blackman(name: impl Into<String>, m: usize) -> Result<Self, FrameError>
pub fn blackman(name: impl Into<String>, m: usize) -> Result<Self, FrameError>
Generate a Blackman window Series.
Matches np.blackman(M).
Sourcepub fn bartlett(name: impl Into<String>, m: usize) -> Result<Self, FrameError>
pub fn bartlett(name: impl Into<String>, m: usize) -> Result<Self, FrameError>
Generate a Bartlett (triangular) window Series.
Matches np.bartlett(M).
Sourcepub fn plot(&self) -> Result<PlotSpec, FrameError>
pub fn plot(&self) -> Result<PlotSpec, FrameError>
Return a backend-neutral pandas-style plotting request.
Sourcepub fn bar(&self) -> Result<PlotSpec, FrameError>
pub fn bar(&self) -> Result<PlotSpec, FrameError>
Return a backend-neutral pandas-style bar plot request.
Sourcepub fn area(&self) -> Result<PlotSpec, FrameError>
pub fn area(&self) -> Result<PlotSpec, FrameError>
Return a backend-neutral pandas-style area plot request.
Sourcepub fn scatter(&self) -> Result<PlotSpec, FrameError>
pub fn scatter(&self) -> Result<PlotSpec, FrameError>
Return a backend-neutral pandas-style scatter plot request.
Sourcepub fn pie(&self) -> Result<PlotSpec, FrameError>
pub fn pie(&self) -> Result<PlotSpec, FrameError>
Return a backend-neutral pandas-style pie plot request.
Sourcepub fn hist(&self) -> Result<HistogramSpec, FrameError>
pub fn hist(&self) -> Result<HistogramSpec, FrameError>
Return a backend-neutral pandas-style histogram request.
Sourcepub fn to_string_repr(&self) -> String
pub fn to_string_repr(&self) -> String
Pretty-print the Series as a string table.
Matches str(series) / series.to_string() in pandas.
Sourcepub fn broadcast(
name: impl Into<String>,
value: Scalar,
index_labels: Vec<IndexLabel>,
) -> Result<Self, FrameError>
pub fn broadcast( name: impl Into<String>, value: Scalar, index_labels: Vec<IndexLabel>, ) -> Result<Self, FrameError>
Broadcast a single scalar value across the given index.
Matches pd.Series(5, index=[0, 1, 2]).
pub fn name(&self) -> &str
pub fn index(&self) -> &Index
pub fn column(&self) -> &Column
pub fn values(&self) -> &[Scalar]
Sourcepub fn typed_values(&self) -> Option<SeriesTypedValues<'_>>
pub fn typed_values(&self) -> Option<SeriesTypedValues<'_>>
Borrow the native numeric buffer and its validity mask when available.
Unlike Self::values, this never allocates or boxes one Scalar per
element. Non-numeric Series deliberately return None so callers retain
the scalar path for heterogeneous and object-like data.
Sourcepub fn array(&self) -> Vec<Scalar>
pub fn array(&self) -> Vec<Scalar>
Object-array-shaped materialization of the Series values.
Matches pd.Series.array at the API-shape level for the current
immutable scalar-vector representation.
Sourcepub fn ravel(&self) -> Vec<Scalar>
pub fn ravel(&self) -> Vec<Scalar>
Flatten Series values to a one-dimensional scalar vector.
Matches pd.Series.ravel() for this already-1D representation.
Sourcepub fn tolist(&self) -> Vec<Scalar>
pub fn tolist(&self) -> Vec<Scalar>
Pandas spelling alias for Self::to_list.
Matches pd.Series.tolist().
Sourcepub fn view(&self) -> Self
pub fn view(&self) -> Self
Return a shallow clone view.
Matches pd.Series.view() for this immutable Rust representation.
Sourcepub fn t(&self) -> Self
pub fn t(&self) -> Self
Lowercase alias for Self::transpose.
Sourcepub fn T(&self) -> Self
pub fn T(&self) -> Self
Uppercase pandas spelling for Self::transpose.
Rust style prefers Self::t, but pandas exposes series.T.
Sourcepub fn swapaxes(&self) -> Self
pub fn swapaxes(&self) -> Self
Swap Series axes.
Matches pd.Series.swapaxes() for a one-dimensional object; the
operation is identity because Series has only axis 0.
Sourcepub fn swaplevel(&self) -> Self
pub fn swaplevel(&self) -> Self
Swap the last two tuple-style index levels.
Matches pd.Series.swaplevel() for the tuple-label MultiIndex
representation currently used by FrankenPandas. Non-tuple labels are
returned unchanged, matching the existing DataFrame fallback shape.
Sourcepub fn reorder_levels(&self, order: &[usize]) -> Result<Self, FrameError>
pub fn reorder_levels(&self, order: &[usize]) -> Result<Self, FrameError>
Reorder tuple-style index levels.
Matches pd.Series.reorder_levels(order) for labels formatted like
(level0, level1, ...). Single-level Series accept [0] as identity.
Sourcepub fn dtype_name(&self) -> String
pub fn dtype_name(&self) -> String
Return the pandas dtype NAME of this Series.
br-frankenpandas-3gxc6. This is not self.dtype().name(): for a sparse
Series pandas reports the parameterized Sparse[int64, 0], and
DType::name can only answer the bare "Sparse" because
DType::Sparse carries no payload. The subtype and fill live in the
SparseDType descriptor this Series is holding, so this is the only
level that can spell the full name.
Every non-sparse dtype is unchanged and delegates to DType::name.
Categorical stays "category": pandas parameterizes CategoricalDtype
in its repr but .dtype.name is plain "category", so there is
nothing to widen there.
Sourcepub fn dtypes(&self) -> DType
pub fn dtypes(&self) -> DType
Plural pandas alias for Self::dtype.
Matches pd.Series.dtypes.
Sourcepub fn copy(&self) -> Self
pub fn copy(&self) -> Self
Return a deep copy of this Series.
Matches pd.Series.copy(deep=True).
Sourcepub fn keys(&self) -> Index
pub fn keys(&self) -> Index
Return the Series index.
Matches pd.Series.keys(). This is an alias for the index.
pub fn add_with_policy( &self, other: &Self, policy: &RuntimePolicy, ledger: &mut EvidenceLedger, ) -> Result<Self, FrameError>
pub fn add(&self, other: &Self) -> Result<Self, FrameError>
pub fn sub_with_policy( &self, other: &Self, policy: &RuntimePolicy, ledger: &mut EvidenceLedger, ) -> Result<Self, FrameError>
pub fn sub(&self, other: &Self) -> Result<Self, FrameError>
pub fn mul_with_policy( &self, other: &Self, policy: &RuntimePolicy, ledger: &mut EvidenceLedger, ) -> Result<Self, FrameError>
pub fn mul(&self, other: &Self) -> Result<Self, FrameError>
pub fn div_with_policy( &self, other: &Self, policy: &RuntimePolicy, ledger: &mut EvidenceLedger, ) -> Result<Self, FrameError>
pub fn div(&self, other: &Self) -> Result<Self, FrameError>
Sourcepub fn add_fill(
&self,
other: &Self,
fill_value: f64,
) -> Result<Self, FrameError>
pub fn add_fill( &self, other: &Self, fill_value: f64, ) -> Result<Self, FrameError>
Add with fill_value for NaN handling.
Matches s1.add(s2, fill_value=0).
Sourcepub fn sub_fill(
&self,
other: &Self,
fill_value: f64,
) -> Result<Self, FrameError>
pub fn sub_fill( &self, other: &Self, fill_value: f64, ) -> Result<Self, FrameError>
Subtract with fill_value for NaN handling.
Sourcepub fn mul_fill(
&self,
other: &Self,
fill_value: f64,
) -> Result<Self, FrameError>
pub fn mul_fill( &self, other: &Self, fill_value: f64, ) -> Result<Self, FrameError>
Multiply with fill_value for NaN handling.
Sourcepub fn div_fill(
&self,
other: &Self,
fill_value: f64,
) -> Result<Self, FrameError>
pub fn div_fill( &self, other: &Self, fill_value: f64, ) -> Result<Self, FrameError>
Divide with fill_value for NaN handling.
Sourcepub fn modulo(&self, other: &Self) -> Result<Self, FrameError>
pub fn modulo(&self, other: &Self) -> Result<Self, FrameError>
Modulo operation (element-wise remainder).
Matches s1.mod(s2) / s1 % s2 in pandas.
pub fn modulo_with_policy( &self, other: &Self, policy: &RuntimePolicy, ledger: &mut EvidenceLedger, ) -> Result<Self, FrameError>
Sourcepub fn floordiv(&self, other: &Self) -> Result<Self, FrameError>
pub fn floordiv(&self, other: &Self) -> Result<Self, FrameError>
Floor-division operation (element-wise).
Matches s1.floordiv(s2) / s1 // s2 in pandas.
pub fn floordiv_with_policy( &self, other: &Self, policy: &RuntimePolicy, ledger: &mut EvidenceLedger, ) -> Result<Self, FrameError>
Sourcepub fn pow(&self, other: &Self) -> Result<Self, FrameError>
pub fn pow(&self, other: &Self) -> Result<Self, FrameError>
Power operation (element-wise exponentiation).
Matches s1.pow(s2) / s1 ** s2 in pandas.
pub fn pow_with_policy( &self, other: &Self, policy: &RuntimePolicy, ledger: &mut EvidenceLedger, ) -> Result<Self, FrameError>
Sourcepub fn subtract(&self, other: &Self) -> Result<Self, FrameError>
pub fn subtract(&self, other: &Self) -> Result<Self, FrameError>
pandas alias for Self::sub. Matches pd.Series.subtract.
Sourcepub fn multiply(&self, other: &Self) -> Result<Self, FrameError>
pub fn multiply(&self, other: &Self) -> Result<Self, FrameError>
pandas alias for Self::mul. Matches pd.Series.multiply.
Sourcepub fn divide(&self, other: &Self) -> Result<Self, FrameError>
pub fn divide(&self, other: &Self) -> Result<Self, FrameError>
pandas alias for Self::div. Matches pd.Series.divide.
Sourcepub fn truediv(&self, other: &Self) -> Result<Self, FrameError>
pub fn truediv(&self, other: &Self) -> Result<Self, FrameError>
pandas alias for Self::div. Matches pd.Series.truediv
(true / floating-point division; same as div since div itself
promotes to Float64).
Sourcepub fn mod(&self, other: &Self) -> Result<Self, FrameError>
pub fn mod(&self, other: &Self) -> Result<Self, FrameError>
Element-wise modulo. Matches pd.Series.mod(other) / s1 % s2.
mod is a Rust keyword; the public name uses the raw-identifier
form. Callers from Rust write series.r#mod(&other). The Python
FFI surface exposes it as bare mod.
Sourcepub fn radd(&self, other: &Self) -> Result<Self, FrameError>
pub fn radd(&self, other: &Self) -> Result<Self, FrameError>
Right-handed addition: s1.radd(s2) ≡ s2.add(s1). Useful for
reverse operator overloading (scalar + series). Matches
pd.Series.radd(other).
Sourcepub fn rsub(&self, other: &Self) -> Result<Self, FrameError>
pub fn rsub(&self, other: &Self) -> Result<Self, FrameError>
Right-handed subtraction: s1.rsub(s2) ≡ s2.sub(s1). Matches
pd.Series.rsub(other).
Sourcepub fn rmul(&self, other: &Self) -> Result<Self, FrameError>
pub fn rmul(&self, other: &Self) -> Result<Self, FrameError>
Right-handed multiplication: s1.rmul(s2) ≡ s2.mul(s1). Matches
pd.Series.rmul(other).
Sourcepub fn rdiv(&self, other: &Self) -> Result<Self, FrameError>
pub fn rdiv(&self, other: &Self) -> Result<Self, FrameError>
Right-handed division: s1.rdiv(s2) ≡ s2.div(s1). Matches
pd.Series.rdiv(other).
Sourcepub fn rtruediv(&self, other: &Self) -> Result<Self, FrameError>
pub fn rtruediv(&self, other: &Self) -> Result<Self, FrameError>
Right-handed true division: s1.rtruediv(s2) ≡ s2.div(s1).
Matches pd.Series.rtruediv(other).
Sourcepub fn rfloordiv(&self, other: &Self) -> Result<Self, FrameError>
pub fn rfloordiv(&self, other: &Self) -> Result<Self, FrameError>
Right-handed floor division: s1.rfloordiv(s2) ≡ s2.floordiv(s1).
Matches pd.Series.rfloordiv(other).
Sourcepub fn rmod(&self, other: &Self) -> Result<Self, FrameError>
pub fn rmod(&self, other: &Self) -> Result<Self, FrameError>
Right-handed modulo: s1.rmod(s2) ≡ s2.modulo(s1). Matches
pd.Series.rmod(other).
Sourcepub fn rpow(&self, other: &Self) -> Result<Self, FrameError>
pub fn rpow(&self, other: &Self) -> Result<Self, FrameError>
Right-handed exponentiation: s1.rpow(s2) ≡ s2.pow(s1).
Matches pd.Series.rpow(other).
Sourcepub fn divmod(&self, other: &Self) -> Result<(Self, Self), FrameError>
pub fn divmod(&self, other: &Self) -> Result<(Self, Self), FrameError>
Element-wise divmod: returns (self // other, self % other).
Matches pd.Series.divmod(other). The two returned Series share the
aligned union index produced by floordiv/modulo; alignment and
null-propagation semantics follow the same rules as those operators.
Sourcepub fn rdivmod(&self, other: &Self) -> Result<(Self, Self), FrameError>
pub fn rdivmod(&self, other: &Self) -> Result<(Self, Self), FrameError>
Reversed element-wise divmod: returns (other // self, other % self).
Matches pd.Series.rdivmod(other).
Sourcepub fn td_add(&self, other: &Self) -> Result<Self, FrameError>
pub fn td_add(&self, other: &Self) -> Result<Self, FrameError>
Add two Timedelta64 Series element-wise.
Matches td1 + td2 in pandas for timedelta Series.
Sourcepub fn td_add_with_policy(
&self,
other: &Self,
policy: &RuntimePolicy,
) -> Result<Self, FrameError>
pub fn td_add_with_policy( &self, other: &Self, policy: &RuntimePolicy, ) -> Result<Self, FrameError>
Add two Timedelta64 Series under an explicit runtime policy.
STRICT surfaces pandas’ OverflowError for an unrepresentable
vectorized addition; HARDENED retains the historical NaT recovery
and records it through OverflowPolicy. A pre-existing NaT is
propagation, not an overflow, under either policy.
Sourcepub fn td_sub(&self, other: &Self) -> Result<Self, FrameError>
pub fn td_sub(&self, other: &Self) -> Result<Self, FrameError>
Subtract Timedelta64 Series element-wise.
Matches td1 - td2 in pandas for timedelta Series.
Sourcepub fn td_sub_with_policy(
&self,
other: &Self,
policy: &RuntimePolicy,
) -> Result<Self, FrameError>
pub fn td_sub_with_policy( &self, other: &Self, policy: &RuntimePolicy, ) -> Result<Self, FrameError>
Subtract two Timedelta64 Series under an explicit runtime policy.
See Self::td_add_with_policy for the strict/hardened split.
Sourcepub fn td_mul_scalar(&self, scalar: f64) -> Result<Self, FrameError>
pub fn td_mul_scalar(&self, scalar: f64) -> Result<Self, FrameError>
Multiply Timedelta64 Series by a numeric scalar.
Matches td * scalar in pandas.
Sourcepub fn td_div_scalar(&self, scalar: f64) -> Result<Self, FrameError>
pub fn td_div_scalar(&self, scalar: f64) -> Result<Self, FrameError>
Divide Timedelta64 Series by a numeric scalar.
Matches td / scalar in pandas.
Sourcepub fn td_floordiv_scalar(&self, scalar: i64) -> Result<Self, FrameError>
pub fn td_floordiv_scalar(&self, scalar: i64) -> Result<Self, FrameError>
Floor-divide Timedelta64 Series by a numeric scalar.
Matches td // scalar in pandas.
Sourcepub fn td_ratio(&self, other: &Self) -> Result<Self, FrameError>
pub fn td_ratio(&self, other: &Self) -> Result<Self, FrameError>
Divide Timedelta64 by Timedelta64 to get a numeric ratio.
Matches td1 / td2 in pandas (returns float).
Sourcepub fn td_mod(&self, other: &Self) -> Result<Self, FrameError>
pub fn td_mod(&self, other: &Self) -> Result<Self, FrameError>
Modulo of Timedelta64 Series by another Timedelta64.
Matches td1 % td2 in pandas.
Sourcepub fn td_neg(&self) -> Result<Self, FrameError>
pub fn td_neg(&self) -> Result<Self, FrameError>
Negate Timedelta64 Series (unary minus).
Matches -td in pandas.
Sourcepub fn td_abs(&self) -> Result<Self, FrameError>
pub fn td_abs(&self) -> Result<Self, FrameError>
Absolute value of Timedelta64 Series.
Matches td.abs() or abs(td) in pandas.
Sourcepub fn td_lt(&self, other: &Self) -> Result<Self, FrameError>
pub fn td_lt(&self, other: &Self) -> Result<Self, FrameError>
Compare Timedelta64 Series: less than.
Sourcepub fn td_le(&self, other: &Self) -> Result<Self, FrameError>
pub fn td_le(&self, other: &Self) -> Result<Self, FrameError>
Compare Timedelta64 Series: less than or equal.
Sourcepub fn td_gt(&self, other: &Self) -> Result<Self, FrameError>
pub fn td_gt(&self, other: &Self) -> Result<Self, FrameError>
Compare Timedelta64 Series: greater than.
Sourcepub fn td_ge(&self, other: &Self) -> Result<Self, FrameError>
pub fn td_ge(&self, other: &Self) -> Result<Self, FrameError>
Compare Timedelta64 Series: greater than or equal.
Sourcepub fn td_eq(&self, other: &Self) -> Result<Self, FrameError>
pub fn td_eq(&self, other: &Self) -> Result<Self, FrameError>
Compare Timedelta64 Series: equality.
Sourcepub fn td_ne(&self, other: &Self) -> Result<Self, FrameError>
pub fn td_ne(&self, other: &Self) -> Result<Self, FrameError>
Compare Timedelta64 Series: inequality.
Sourcepub fn align(
&self,
other: &Self,
mode: AlignMode,
) -> Result<(Self, Self), FrameError>
pub fn align( &self, other: &Self, mode: AlignMode, ) -> Result<(Self, Self), FrameError>
Align two Series by their indexes, returning a pair aligned to a common index.
Matches pd.Series.align(other, join='inner'|'left'|'right'|'outer').
Uses duplicate-aware alignment for outer joins when duplicate labels exist.
Sourcepub fn combine_first(&self, other: &Self) -> Result<Self, FrameError>
pub fn combine_first(&self, other: &Self) -> Result<Self, FrameError>
Fill missing values from other.
Matches pd.Series.combine_first(other): uses outer alignment,
then for each position takes self’s value if non-null, else other’s.
Sourcepub fn append(&self, other: &Self) -> Result<Self, FrameError>
pub fn append(&self, other: &Self) -> Result<Self, FrameError>
Append another Series to this one.
Concatenates values and index labels.
⚠️ REMOVED, not deprecated: pd.Series.append raises AttributeError
on 2.2.3 (deprecated in 1.4, dropped in 2.0) – it does not warn. The
pandas spelling is pd.concat([a, b]). Kept as an FP superset for
migrated callers, not as parity.
Sourcepub fn first_valid_index(&self) -> Option<IndexLabel>
pub fn first_valid_index(&self) -> Option<IndexLabel>
Return the index label of the first non-null value.
Matches pd.Series.first_valid_index().
Sourcepub fn last_valid_index(&self) -> Option<IndexLabel>
pub fn last_valid_index(&self) -> Option<IndexLabel>
Return the index label of the last non-null value.
Matches pd.Series.last_valid_index().
Sourcepub fn update(&self, other: &Self) -> Result<Self, FrameError>
pub fn update(&self, other: &Self) -> Result<Self, FrameError>
Update values using non-null values from another Series.
Analogous to pandas.Series.update(other). Only updates values at
matching index labels where other has non-null values. The result
retains self’s index (no new labels added from other).
Sourcepub fn reindex(&self, new_labels: Vec<IndexLabel>) -> Result<Self, FrameError>
pub fn reindex(&self, new_labels: Vec<IndexLabel>) -> Result<Self, FrameError>
Reindex to a new set of labels, filling missing positions with null.
Matches pd.Series.reindex(new_index).
Sourcepub fn reindex_with_method(
&self,
new_labels: Vec<IndexLabel>,
method: &str,
) -> Result<Self, FrameError>
pub fn reindex_with_method( &self, new_labels: Vec<IndexLabel>, method: &str, ) -> Result<Self, FrameError>
Reindex to new labels with a fill method for introduced NaN.
Matches s.reindex(new_labels, method='ffill'|'bfill').
Single-pass, label-presence driven: only labels ABSENT from the source
are filled from the nearest source label in the fill direction; labels
PRESENT in the source keep their own value, INCLUDING a source NaN. A
two-pass reindex(...).ffill() would instead fill every NaN slot,
overwriting original source NaNs that pandas leaves untouched.
Sourcepub fn gt(&self, other: &Self) -> Result<Self, FrameError>
pub fn gt(&self, other: &Self) -> Result<Self, FrameError>
Element-wise greater-than. Matches series > other.
Sourcepub fn lt(&self, other: &Self) -> Result<Self, FrameError>
pub fn lt(&self, other: &Self) -> Result<Self, FrameError>
Element-wise less-than. Matches series < other.
Sourcepub fn eq_series(&self, other: &Self) -> Result<Self, FrameError>
pub fn eq_series(&self, other: &Self) -> Result<Self, FrameError>
Element-wise equality. Matches series == other.
Sourcepub fn eq(&self, other: &Self) -> Result<Self, FrameError>
pub fn eq(&self, other: &Self) -> Result<Self, FrameError>
pandas method alias for element-wise equality.
Matches pd.Series.eq(other).
Sourcepub fn ne_series(&self, other: &Self) -> Result<Self, FrameError>
pub fn ne_series(&self, other: &Self) -> Result<Self, FrameError>
Element-wise not-equal. Matches series != other.
Sourcepub fn ne(&self, other: &Self) -> Result<Self, FrameError>
pub fn ne(&self, other: &Self) -> Result<Self, FrameError>
pandas method alias for element-wise inequality.
Matches pd.Series.ne(other).
Sourcepub fn ge(&self, other: &Self) -> Result<Self, FrameError>
pub fn ge(&self, other: &Self) -> Result<Self, FrameError>
Element-wise greater-or-equal. Matches series >= other.
Sourcepub fn le(&self, other: &Self) -> Result<Self, FrameError>
pub fn le(&self, other: &Self) -> Result<Self, FrameError>
Element-wise less-or-equal. Matches series <= other.
Sourcepub fn allclose(
&self,
other: &Self,
rtol: f64,
atol: f64,
) -> Result<bool, FrameError>
pub fn allclose( &self, other: &Self, rtol: f64, atol: f64, ) -> Result<bool, FrameError>
Check if two series are element-wise equal within a tolerance.
Matches np.allclose(s1, s2, rtol, atol).
Sourcepub fn compare_scalar(
&self,
scalar: &Scalar,
op: ComparisonOp,
) -> Result<Self, FrameError>
pub fn compare_scalar( &self, scalar: &Scalar, op: ComparisonOp, ) -> Result<Self, FrameError>
Compare each element against a scalar value.
Matches series > 5 (broadcast scalar comparison).
Sourcepub fn eq_scalar(&self, scalar: &Scalar) -> Result<Self, FrameError>
pub fn eq_scalar(&self, scalar: &Scalar) -> Result<Self, FrameError>
Element-wise == scalar.
Sourcepub fn ne_scalar(&self, scalar: &Scalar) -> Result<Self, FrameError>
pub fn ne_scalar(&self, scalar: &Scalar) -> Result<Self, FrameError>
Element-wise != scalar.
Sourcepub fn gt_scalar(&self, scalar: &Scalar) -> Result<Self, FrameError>
pub fn gt_scalar(&self, scalar: &Scalar) -> Result<Self, FrameError>
Element-wise > scalar.
Sourcepub fn ge_scalar(&self, scalar: &Scalar) -> Result<Self, FrameError>
pub fn ge_scalar(&self, scalar: &Scalar) -> Result<Self, FrameError>
Element-wise >= scalar.
Sourcepub fn lt_scalar(&self, scalar: &Scalar) -> Result<Self, FrameError>
pub fn lt_scalar(&self, scalar: &Scalar) -> Result<Self, FrameError>
Element-wise < scalar.
Sourcepub fn le_scalar(&self, scalar: &Scalar) -> Result<Self, FrameError>
pub fn le_scalar(&self, scalar: &Scalar) -> Result<Self, FrameError>
Element-wise <= scalar.
Sourcepub fn equals(&self, other: &Self) -> bool
pub fn equals(&self, other: &Self) -> bool
Test whether two Series are equal (same name, index, and values).
Analogous to pandas.Series.equals(other). Returns true only if
both Series have identical names, index labels, and values (including
NaN == NaN semantics for null positions).
Sourcepub fn and(&self, other: &Self) -> Result<Self, FrameError>
pub fn and(&self, other: &Self) -> Result<Self, FrameError>
Element-wise boolean AND with outer index alignment.
Uses three-valued logic compatible with nullable boolean semantics:
false & x == falsetrue & true == truetrue & null == null,null & null == null
Sourcepub fn or(&self, other: &Self) -> Result<Self, FrameError>
pub fn or(&self, other: &Self) -> Result<Self, FrameError>
Element-wise boolean OR with outer index alignment.
Uses three-valued logic compatible with nullable boolean semantics:
true | x == truefalse | false == falsefalse | null == null,null | null == null
Sourcepub fn not(&self) -> Result<Self, FrameError>
pub fn not(&self) -> Result<Self, FrameError>
Element-wise boolean NOT.
Missing values remain missing.
Sourcepub fn filter(&self, mask: &Self) -> Result<Self, FrameError>
pub fn filter(&self, mask: &Self) -> Result<Self, FrameError>
Select elements where mask is True.
Matches series[bool_series] boolean indexing in pandas. Indexes are
aligned before applying the mask, and missing values in the mask are
treated as False.
A NON-boolean mask is NOT an error: pandas’ [] silently stops
filtering and does a LABEL TAKE instead, and so do we — see
Self::take_by_label_selector for the measurements.
(br-frankenpandas-75i7h)
Sourcepub fn loc(&self, labels: &[IndexLabel]) -> Result<Self, FrameError>
pub fn loc(&self, labels: &[IndexLabel]) -> Result<Self, FrameError>
Label-based selection for a list of labels.
Matches series.loc[[...]] for list-like selectors. Labels are returned
in selector order and duplicate labels in the selector are preserved.
If a requested label does not exist, this fails closed.
Sourcepub fn iloc(&self, positions: &[i64]) -> Result<Self, FrameError>
pub fn iloc(&self, positions: &[i64]) -> Result<Self, FrameError>
Position-based selection for a list of integer positions.
Matches series.iloc[[...]] for list-like selectors.
Positions are returned in selector order and duplicates are preserved.
Negative positions are resolved from the end of the Series.
Sourcepub fn loc_bool(&self, mask: &[bool]) -> Result<Self, FrameError>
pub fn loc_bool(&self, mask: &[bool]) -> Result<Self, FrameError>
Label-based boolean mask selection.
Matches series.loc[bool_array] in pandas. The boolean mask must have
the same length as the Series. Rows where the mask is True are kept;
False and Null mask entries are excluded.
Sourcepub fn iloc_bool(&self, mask: &[bool]) -> Result<Self, FrameError>
pub fn iloc_bool(&self, mask: &[bool]) -> Result<Self, FrameError>
Position-based boolean mask selection.
Matches series.iloc[bool_array] in pandas. The boolean mask must have
the same length as the Series. Semantically identical to loc_bool for
Series (position and label filtering coincide on the same axis).
Sourcepub fn loc_bool_series(&self, mask: &Self) -> Result<Self, FrameError>
pub fn loc_bool_series(&self, mask: &Self) -> Result<Self, FrameError>
Label-based boolean Series mask selection with index alignment.
Matches series.loc[bool_series] in pandas, which is the most common
usage pattern (e.g., s.loc[s > 5]). The mask Series is aligned with
this Series by index before filtering. Missing mask values are treated
as False. This is an alias for Series::filter.
Sourcepub fn iloc_bool_series(&self, mask: &Self) -> Result<Self, FrameError>
pub fn iloc_bool_series(&self, mask: &Self) -> Result<Self, FrameError>
Position-based boolean Series mask selection with index alignment.
Matches series.iloc[bool_series] in pandas. Semantically identical
to loc_bool_series (delegates to filter).
Sourcepub fn loc_slice(
&self,
start: Option<&IndexLabel>,
stop: Option<&IndexLabel>,
) -> Result<Self, FrameError>
pub fn loc_slice( &self, start: Option<&IndexLabel>, stop: Option<&IndexLabel>, ) -> Result<Self, FrameError>
Label-based slice selection (inclusive on both ends).
Matches series.loc[start:stop] in pandas. Both start and stop are
optional. When present, the slice is inclusive on both endpoints (pandas
semantics for label-based slicing). Returns rows in their original order.
Sourcepub fn iloc_slice(
&self,
start: Option<i64>,
stop: Option<i64>,
) -> Result<Self, FrameError>
pub fn iloc_slice( &self, start: Option<i64>, stop: Option<i64>, ) -> Result<Self, FrameError>
Position-based slice selection (exclusive end, like Python range).
Matches series.iloc[start:stop] in pandas. The start is inclusive
and stop is exclusive (standard Python slice semantics). Negative
values are resolved from the end. Both are optional.
Sourcepub fn sort_index(&self, ascending: bool) -> Result<Self, FrameError>
pub fn sort_index(&self, ascending: bool) -> Result<Self, FrameError>
Return a new Series sorted by index labels.
Matches s.sort_index(ascending=...) for the current 1D IndexLabel
model.
Sourcepub fn sort_values(&self, ascending: bool) -> Result<Self, FrameError>
pub fn sort_values(&self, ascending: bool) -> Result<Self, FrameError>
Return a new Series sorted by values.
Matches s.sort_values(ascending=...) with na_position='last'.
Sourcepub fn sort_values_na(
&self,
ascending: bool,
na_position: &str,
) -> Result<Self, FrameError>
pub fn sort_values_na( &self, ascending: bool, na_position: &str, ) -> Result<Self, FrameError>
Return a new Series sorted by values with explicit NA position.
Matches s.sort_values(ascending=..., na_position='first'|'last').
Sourcepub fn head(&self, n: i64) -> Result<Self, FrameError>
pub fn head(&self, n: i64) -> Result<Self, FrameError>
Return the first n rows.
Matches s.head(n). If n is negative, this returns all rows except
the last -n rows.
Sourcepub fn tail(&self, n: i64) -> Result<Self, FrameError>
pub fn tail(&self, n: i64) -> Result<Self, FrameError>
Return the last n rows.
Matches s.tail(n). If n is negative, this returns all rows except
the first -n rows.
Sourcepub fn fillna(&self, fill_value: &Scalar) -> Result<Self, FrameError>
pub fn fillna(&self, fill_value: &Scalar) -> Result<Self, FrameError>
Fill missing values with a scalar.
Matches pd.Series.fillna(value).
Sourcepub fn fillna_limit(
&self,
fill_value: &Scalar,
limit: usize,
) -> Result<Self, FrameError>
pub fn fillna_limit( &self, fill_value: &Scalar, limit: usize, ) -> Result<Self, FrameError>
Fill missing values with fill_value, filling at most limit
consecutive NaN positions.
Matches series.fillna(value, limit=N).
Sourcepub fn ffill(&self, limit: Option<usize>) -> Result<Self, FrameError>
pub fn ffill(&self, limit: Option<usize>) -> Result<Self, FrameError>
Forward-fill missing values (propagate last valid observation forward).
Matches pd.Series.ffill() / pd.Series.fillna(method='ffill').
An optional limit caps the maximum number of consecutive NaNs to fill.
Sourcepub fn bfill(&self, limit: Option<usize>) -> Result<Self, FrameError>
pub fn bfill(&self, limit: Option<usize>) -> Result<Self, FrameError>
Back-fill missing values (propagate next valid observation backward).
Matches pd.Series.bfill() / pd.Series.fillna(method='bfill').
An optional limit caps the maximum number of consecutive NaNs to fill.
Sourcepub fn pad(&self, limit: Option<usize>) -> Result<Self, FrameError>
pub fn pad(&self, limit: Option<usize>) -> Result<Self, FrameError>
Deprecated pandas alias for Self::ffill. Matches
pd.Series.pad(limit=None). Per br-frankenpandas-qn0bj — pandas
kept pad for backwards compatibility after promoting ffill.
Sourcepub fn backfill(&self, limit: Option<usize>) -> Result<Self, FrameError>
pub fn backfill(&self, limit: Option<usize>) -> Result<Self, FrameError>
Deprecated pandas alias for Self::bfill. Matches
pd.Series.backfill(limit=None). Per br-frankenpandas-qn0bj.
Sourcepub fn bool(&self) -> Result<bool, FrameError>
pub fn bool(&self) -> Result<bool, FrameError>
pandas-named alias for Self::bool_. Matches pd.Series.bool().
Per br-frankenpandas-qn0bj. bool is a Rust keyword; the public
name uses the raw-identifier form. Callers from Rust write
series.r#bool(); the Python FFI surface exposes bare bool.
Sourcepub fn interpolate(&self) -> Result<Self, FrameError>
pub fn interpolate(&self) -> Result<Self, FrameError>
Linearly interpolate missing values.
Matches pd.Series.interpolate(method='linear'). Non-numeric values
and leading/trailing NaNs are left as NaN. Only interior NaN gaps
between two valid numeric values are filled.
Sourcepub fn interpolate_with_limit(
&self,
method: &str,
limit: usize,
) -> Result<Self, FrameError>
pub fn interpolate_with_limit( &self, method: &str, limit: usize, ) -> Result<Self, FrameError>
Interpolate with a limit on the number of consecutive missing values
filled, matching pd.Series.interpolate(method, limit=...) under the
default forward limit_direction. method is forwarded to
interpolate_method; the limit is then applied as a forward cap: within
each run of originally-missing values, only the first limit (counted
from the preceding valid anchor) keep their interpolated value and the
rest revert to missing. Leading gaps (no left anchor) are never filled
under forward direction, exactly as pandas. limit_direction=
backward/both and limit_area= remain a follow-up (br-frankenpandas-su1dm).
Sourcepub fn interpolate_with_direction(
&self,
limit: Option<usize>,
limit_direction: &str,
) -> Result<Self, FrameError>
pub fn interpolate_with_direction( &self, limit: Option<usize>, limit_direction: &str, ) -> Result<Self, FrameError>
Linear interpolation with an explicit limit_direction (and optional
limit), matching pd.Series.interpolate(method='linear', limit=..., limit_direction='forward'|'backward'|'both').
Each missing position is filled from its bounding valid anchors: linear
between a left and right anchor, or a constant carry of the single anchor
at a trailing gap (left only) / leading gap (right only). A filled
position is then kept only if it is reachable under the chosen direction
— forward requires a left anchor within limit steps, backward a
right anchor within limit, both either — otherwise it stays missing.
forward with no limit reproduces interpolate exactly; backward
additionally fills leading gaps and both fills every bounded gap
(br-frankenpandas-su1dm).
Sourcepub fn interpolate_with_options(
&self,
limit: Option<usize>,
limit_direction: &str,
limit_area: Option<&str>,
) -> Result<Self, FrameError>
pub fn interpolate_with_options( &self, limit: Option<usize>, limit_direction: &str, limit_area: Option<&str>, ) -> Result<Self, FrameError>
Linear interpolation with limit, limit_direction, and limit_area,
matching pd.Series.interpolate(method='linear', limit=..., limit_direction=..., limit_area=...). limit_area restricts which gaps
are eligible: None = all, "inside" = only interior gaps (bounded by a
valid value on both sides), "outside" = only edge gaps (leading/trailing,
bounded on exactly one side). Applied on top of the direction/limit
reachability test (br-frankenpandas-su1dm).
Sourcepub fn interpolate_method(&self, method: &str) -> Result<Self, FrameError>
pub fn interpolate_method(&self, method: &str) -> Result<Self, FrameError>
Interpolate missing values using the specified method.
Matches s.interpolate(method='linear'|'nearest'|'zero').
linear: linear interpolation between bounding valid values (default)nearest: use the nearest valid valuezero: use the left bounding value (step function / zero-order hold)
Sourcepub fn dropna(&self) -> Result<Self, FrameError>
pub fn dropna(&self) -> Result<Self, FrameError>
Remove entries with missing values.
Matches pd.Series.dropna().
Sourcepub fn drop(&self, labels: &[IndexLabel]) -> Result<Self, FrameError>
pub fn drop(&self, labels: &[IndexLabel]) -> Result<Self, FrameError>
Drop entries by index label.
Matches pd.Series.drop(labels). Returns a new Series excluding
the specified index labels.
Sourcepub fn asof(&self, label: &IndexLabel) -> Option<&Scalar>
pub fn asof(&self, label: &IndexLabel) -> Option<&Scalar>
Find the last non-NaN value at or before the given label.
Matches pd.Series.asof(where). The index must be sorted.
Scans backwards from the position of where (or the last position
before it) for the first non-missing value.
Sourcepub fn asof_value(&self, label: &IndexLabel) -> Scalar
pub fn asof_value(&self, label: &IndexLabel) -> Scalar
Self::asof as pandas observes it: the scalar pd.Series.asof(label)
returns, with no Option for the caller to interpret.
When nothing is at or before label, pandas returns a plain float
nan — and it does so REGARDLESS OF DTYPE, which is the part worth
pinning. MEASURED, live pandas 2.2.3, both series indexed [1, 2, 3]
and asked for label 0:
pd.Series(['alpha','beta','gamma']).asof(0) -> nan (float)
pd.to_datetime([...]) as a Series .asof(0) -> nan (float)
NOT NaTA datetime64 series still answers nan, not NaT, because the return
is a bare scalar rather than an element of the column — so the column’s
dtype does not get to choose the missing marker. That makes this Rule 1
(an INVENTED missing is always a float nan) in its purest form.
This lives here rather than in the conformance harness deliberately: the
harness previously decided the marker itself, complete with a
“does this Utf8 column look datetime-like” heuristic that produced NaT.
That is the shadow-reimplementation pattern of
br-frankenpandas-oxodo — FrankenPandas must own its own observable
semantics. (br-frankenpandas-nywa8)
Sourcepub fn isna(&self) -> Result<Self, FrameError>
pub fn isna(&self) -> Result<Self, FrameError>
Return a boolean mask where missing values are true.
Matches pd.Series.isna().
Sourcepub fn isnull(&self) -> Result<Self, FrameError>
pub fn isnull(&self) -> Result<Self, FrameError>
Alias for isna.
Matches pd.Series.isnull().
Sourcepub fn notna(&self) -> Result<Self, FrameError>
pub fn notna(&self) -> Result<Self, FrameError>
Return a boolean mask where non-missing values are true.
Matches pd.Series.notna().
Sourcepub fn notnull(&self) -> Result<Self, FrameError>
pub fn notnull(&self) -> Result<Self, FrameError>
Alias for notna.
Matches pd.Series.notnull().
Sourcepub fn count(&self) -> usize
pub fn count(&self) -> usize
Return the number of non-null elements.
Matches pd.Series.count().
Sourcepub fn count_nonzero(&self) -> usize
pub fn count_nonzero(&self) -> usize
Return the number of non-zero elements.
Matches np.count_nonzero(series).
pub fn value_counts(&self) -> Result<Self, FrameError>
Sourcepub fn value_counts_with_options(
&self,
normalize: bool,
sort: bool,
ascending: bool,
dropna: bool,
) -> Result<Self, FrameError>
pub fn value_counts_with_options( &self, normalize: bool, sort: bool, ascending: bool, dropna: bool, ) -> Result<Self, FrameError>
Value counts with full pandas parameter support.
Matches pd.Series.value_counts(normalize, sort, ascending, dropna).
Sourcepub fn value_counts_bins(&self, bins: usize) -> Result<Self, FrameError>
pub fn value_counts_bins(&self, bins: usize) -> Result<Self, FrameError>
Count values binned into equal-width intervals.
Matches pd.Series.value_counts(bins=n). Divides the numeric range
into bins equal-width intervals using cut, then counts values
per interval. Returns a Series indexed by interval labels, sorted
descending by count.
Sourcepub fn is_unique(&self) -> bool
pub fn is_unique(&self) -> bool
Check if all values in the Series are unique (no duplicates).
Matches pd.Series.is_unique.
Sourcepub fn has_duplicates(&self) -> bool
pub fn has_duplicates(&self) -> bool
Return whether the Series contains any duplicated values.
Semantically the complement of is_unique: multiple null entries count
as duplicates, consistent with is_unique’s null_count <= 1 rule.
⚠️ pd.Series.has_duplicates does NOT exist (measured 2.2.3:
AttributeError) – has_duplicates is an Index property, and
s.index.has_duplicates asks about the LABELS, not the values. The
pandas spelling for values is s.duplicated().any().
Sourcepub fn is_monotonic_increasing(&self) -> bool
pub fn is_monotonic_increasing(&self) -> bool
Check if values are monotonically increasing (non-decreasing).
Matches pd.Series.is_monotonic_increasing.
Sourcepub fn is_monotonic(&self) -> bool
pub fn is_monotonic(&self) -> bool
Alias for is_monotonic_increasing.
Sourcepub fn is_monotonic_decreasing(&self) -> bool
pub fn is_monotonic_decreasing(&self) -> bool
Check if values are monotonically decreasing (non-increasing).
Matches pd.Series.is_monotonic_decreasing.
Source§impl Series
impl Series
Sourcepub fn apply<F>(&self, func: F) -> Result<Series, FrameError>
pub fn apply<F>(&self, func: F) -> Result<Series, FrameError>
Apply a custom function to each element of the Series.
Matches pd.Series.apply(func).
Sourcepub fn map_func<F>(&self, func: F) -> Result<Series, FrameError>
pub fn map_func<F>(&self, func: F) -> Result<Series, FrameError>
Map values of a Series using an input mapping or function.
Matches pd.Series.map(arg).
Sourcepub fn unique(&self) -> Vec<Scalar>
pub fn unique(&self) -> Vec<Scalar>
Return unique non-null values in first-seen order.
Matches pd.Series.unique().
Values are returned in first-seen order (pandas preserves
appearance order, not sort order). A single missing marker is
retained: pandas’ Series([1, NaN, 2, NaN, 1]).unique()
returns [1, NaN, 2], not [1, 2] — NaN counts as one
distinct category.
Sourcepub fn nunique_with_dropna(&self, dropna: bool) -> usize
pub fn nunique_with_dropna(&self, dropna: bool) -> usize
Count of unique values with explicit null counting control.
Matches pd.Series.nunique(dropna=...).
pub fn map(&self, mapping: &[(Scalar, Scalar)]) -> Result<Self, FrameError>
Sourcepub fn map_callable<F>(&self, func: F) -> Result<Self, FrameError>
pub fn map_callable<F>(&self, func: F) -> Result<Self, FrameError>
Map values by applying a user function element-wise.
Matches pd.Series.map(callable) — the function form rather
than the dict form of map. Missing values pass through as
Null(NaN) without invoking func (matches pandas
na_action='ignore' default).
Sourcepub fn map_with_default(
&self,
mapping: &[(Scalar, Scalar)],
default: &Scalar,
) -> Result<Self, FrameError>
pub fn map_with_default( &self, mapping: &[(Scalar, Scalar)], default: &Scalar, ) -> Result<Self, FrameError>
Map values using a lookup table with a default for unmapped keys.
Matches pd.Series.map(dict, na_action=None) where unmapped values
use the provided default instead of NaN.
Sourcepub fn map_series(&self, mapper: &Series) -> Result<Self, FrameError>
pub fn map_series(&self, mapper: &Series) -> Result<Self, FrameError>
Map values using another Series as a lookup table.
Matches pd.Series.map(other_series). The mapper series’ index
labels are matched against self’s values. For each value in self,
if it matches a label in mapper’s index, the corresponding mapper
value is used; otherwise NaN.
Sourcepub fn replace(
&self,
replacements: &[(Scalar, Scalar)],
) -> Result<Self, FrameError>
pub fn replace( &self, replacements: &[(Scalar, Scalar)], ) -> Result<Self, FrameError>
Replace specific values with substitutions.
Matches pd.Series.replace(to_replace, value) for scalar pairs.
Sourcepub fn replace_map(
&self,
mapping: &HashMap<String, Scalar>,
) -> Result<Self, FrameError>
pub fn replace_map( &self, mapping: &HashMap<String, Scalar>, ) -> Result<Self, FrameError>
Replace values using a HashMap mapping.
Matches series.replace({old1: new1, old2: new2}).
Sourcepub fn replace_regex(&self, pat: &str, repl: &str) -> Result<Self, FrameError>
pub fn replace_regex(&self, pat: &str, repl: &str) -> Result<Self, FrameError>
Replace string values matching a regex pattern.
Matches series.replace(regex=True) or series.str.replace(pat, repl, regex=True).
Non-Utf8 values pass through unchanged.
Sourcepub fn quantile(&self, q: f64) -> Result<Scalar, FrameError>
pub fn quantile(&self, q: f64) -> Result<Scalar, FrameError>
Compute the q-th quantile (0.0 to 1.0) using linear interpolation.
Matches pd.Series.quantile(q).
Sourcepub fn quantile_with_interpolation(
&self,
q: f64,
interpolation: &str,
) -> Result<Scalar, FrameError>
pub fn quantile_with_interpolation( &self, q: f64, interpolation: &str, ) -> Result<Scalar, FrameError>
Compute the q-th quantile with explicit interpolation mode.
Per br-frankenpandas-a56003: matches pd.Series.quantile(q, interpolation).
Modes: “linear” (default), “lower”, “higher”, “nearest”, “midpoint”.
Sourcepub fn quantile_list(
&self,
quantiles: &[f64],
interpolation: &str,
) -> Result<Self, FrameError>
pub fn quantile_list( &self, quantiles: &[f64], interpolation: &str, ) -> Result<Self, FrameError>
Compute several quantiles at once, returning a Series indexed by the requested probabilities.
Matches pd.Series.quantile([q1, q2, ...], interpolation=...): the
result is a Series whose Float64 index is the quantiles and whose
values are the corresponding quantiles, carrying the source name
(br-frankenpandas-i10en made the Float64 index possible).
Sourcepub fn astype(&self, dtype: DType) -> Result<Self, FrameError>
pub fn astype(&self, dtype: DType) -> Result<Self, FrameError>
Cast values to a target dtype.
Matches series.astype(dtype) for scalar dtypes.
Sourcepub fn astype_safe(
&self,
dtype: DType,
errors: &str,
) -> Result<Self, FrameError>
pub fn astype_safe( &self, dtype: DType, errors: &str, ) -> Result<Self, FrameError>
Cast with error handling.
Matches pd.Series.astype(dtype, errors='coerce'|'raise').
errors="raise"(default): same asastype()errors="coerce": values that fail conversion become NaN
Sourcepub fn clip(
&self,
lower: Option<f64>,
upper: Option<f64>,
) -> Result<Self, FrameError>
pub fn clip( &self, lower: Option<f64>, upper: Option<f64>, ) -> Result<Self, FrameError>
Clip values to [lower, upper].
Matches pd.Series.clip(lower, upper). NaN values pass through unchanged.
Sourcepub fn clip_lower(&self, threshold: f64) -> Result<Self, FrameError>
pub fn clip_lower(&self, threshold: f64) -> Result<Self, FrameError>
Clip values below a threshold.
Sourcepub fn clip_upper(&self, threshold: f64) -> Result<Self, FrameError>
pub fn clip_upper(&self, threshold: f64) -> Result<Self, FrameError>
Clip values above a threshold.
Sourcepub fn clip_with_series(
&self,
lower: Option<&Self>,
upper: Option<&Self>,
) -> Result<Self, FrameError>
pub fn clip_with_series( &self, lower: Option<&Self>, upper: Option<&Self>, ) -> Result<Self, FrameError>
Clip values using element-wise Series bounds.
Matches series.clip(lower=series, upper=series). Each element is
clipped independently using the corresponding bound.
Sourcepub fn add_prefix(&self, prefix: &str) -> Result<Self, FrameError>
pub fn add_prefix(&self, prefix: &str) -> Result<Self, FrameError>
Return a new Series with prefixed index labels.
Matches pd.Series.add_prefix(prefix): the index labels are
stringified and prefixed; the Series name and values are unchanged.
Sourcepub fn add_suffix(&self, suffix: &str) -> Result<Self, FrameError>
pub fn add_suffix(&self, suffix: &str) -> Result<Self, FrameError>
Return a new Series with suffixed index labels.
Matches pd.Series.add_suffix(suffix): the index labels are
stringified and suffixed; the Series name and values are unchanged.
Sourcepub fn abs(&self) -> Result<Self, FrameError>
pub fn abs(&self) -> Result<Self, FrameError>
Absolute value of each element.
Matches pd.Series.abs(). Numeric, boolean, and timedelta dtypes
retain their pandas-observable dtype; missing values pass through.
Sourcepub fn absolute(&self) -> Result<Self, FrameError>
pub fn absolute(&self) -> Result<Self, FrameError>
Alias for abs. Matches np.absolute.
Sourcepub fn fabs(&self) -> Result<Self, FrameError>
pub fn fabs(&self) -> Result<Self, FrameError>
Absolute value of floating-point elements.
Matches np.fabs(series). Same as abs() but explicitly for floats.
Sourcepub fn round(&self, decimals: i32) -> Result<Self, FrameError>
pub fn round(&self, decimals: i32) -> Result<Self, FrameError>
Round each element to decimals decimal places.
Matches pd.Series.round(decimals). NaN values pass through.
Sourcepub fn around(&self, decimals: i32) -> Result<Self, FrameError>
pub fn around(&self, decimals: i32) -> Result<Self, FrameError>
Alias for round. Matches np.around.
Sourcepub fn floor(&self) -> Result<Self, FrameError>
pub fn floor(&self) -> Result<Self, FrameError>
Floor each element (round toward negative infinity).
Matches np.floor(series). NaN values pass through.
Sourcepub fn ceil(&self) -> Result<Self, FrameError>
pub fn ceil(&self) -> Result<Self, FrameError>
Ceiling of each element (round toward positive infinity).
Matches np.ceil(series). NaN values pass through.
Sourcepub fn trunc(&self) -> Result<Self, FrameError>
pub fn trunc(&self) -> Result<Self, FrameError>
Truncate each element toward zero.
Matches np.trunc(series). NaN values pass through.
Sourcepub fn sqrt(&self) -> Result<Self, FrameError>
pub fn sqrt(&self) -> Result<Self, FrameError>
Element-wise square root.
Matches np.sqrt(series). NaN values pass through.
Sourcepub fn exp(&self) -> Result<Self, FrameError>
pub fn exp(&self) -> Result<Self, FrameError>
Element-wise exponential (e^x).
Matches np.exp(series). NaN values pass through.
Sourcepub fn log(&self) -> Result<Self, FrameError>
pub fn log(&self) -> Result<Self, FrameError>
Element-wise natural logarithm.
Matches np.log(series). NaN values pass through.
Sourcepub fn log10(&self) -> Result<Self, FrameError>
pub fn log10(&self) -> Result<Self, FrameError>
Element-wise base-10 logarithm.
Matches np.log10(series). NaN values pass through.
Sourcepub fn log2(&self) -> Result<Self, FrameError>
pub fn log2(&self) -> Result<Self, FrameError>
Element-wise base-2 logarithm.
Matches np.log2(series). NaN values pass through.
Sourcepub fn sin(&self) -> Result<Self, FrameError>
pub fn sin(&self) -> Result<Self, FrameError>
Element-wise sine.
Matches np.sin(series). NaN values pass through.
Sourcepub fn cos(&self) -> Result<Self, FrameError>
pub fn cos(&self) -> Result<Self, FrameError>
Element-wise cosine.
Matches np.cos(series). NaN values pass through.
Sourcepub fn tan(&self) -> Result<Self, FrameError>
pub fn tan(&self) -> Result<Self, FrameError>
Element-wise tangent.
Matches np.tan(series). NaN values pass through.
Sourcepub fn sinh(&self) -> Result<Self, FrameError>
pub fn sinh(&self) -> Result<Self, FrameError>
Element-wise hyperbolic sine.
Matches np.sinh(series). NaN values pass through.
Sourcepub fn cosh(&self) -> Result<Self, FrameError>
pub fn cosh(&self) -> Result<Self, FrameError>
Element-wise hyperbolic cosine.
Matches np.cosh(series). NaN values pass through.
Sourcepub fn tanh(&self) -> Result<Self, FrameError>
pub fn tanh(&self) -> Result<Self, FrameError>
Element-wise hyperbolic tangent.
Matches np.tanh(series). NaN values pass through.
Sourcepub fn arcsin(&self) -> Result<Self, FrameError>
pub fn arcsin(&self) -> Result<Self, FrameError>
Element-wise inverse sine.
Matches np.arcsin(series). NaN values pass through.
Sourcepub fn arccos(&self) -> Result<Self, FrameError>
pub fn arccos(&self) -> Result<Self, FrameError>
Element-wise inverse cosine.
Matches np.arccos(series). NaN values pass through.
Sourcepub fn arctan(&self) -> Result<Self, FrameError>
pub fn arctan(&self) -> Result<Self, FrameError>
Element-wise inverse tangent.
Matches np.arctan(series). NaN values pass through.
Sourcepub fn arcsinh(&self) -> Result<Self, FrameError>
pub fn arcsinh(&self) -> Result<Self, FrameError>
Element-wise inverse hyperbolic sine.
Matches np.arcsinh(series). NaN values pass through.
Sourcepub fn arccosh(&self) -> Result<Self, FrameError>
pub fn arccosh(&self) -> Result<Self, FrameError>
Element-wise inverse hyperbolic cosine.
Matches np.arccosh(series). NaN values pass through.
Sourcepub fn arctanh(&self) -> Result<Self, FrameError>
pub fn arctanh(&self) -> Result<Self, FrameError>
Element-wise inverse hyperbolic tangent.
Matches np.arctanh(series). NaN values pass through.
Sourcepub fn asin(&self) -> Result<Self, FrameError>
pub fn asin(&self) -> Result<Self, FrameError>
Alias for arcsin. Matches Rust/math convention.
Sourcepub fn acos(&self) -> Result<Self, FrameError>
pub fn acos(&self) -> Result<Self, FrameError>
Alias for arccos. Matches Rust/math convention.
Sourcepub fn atan(&self) -> Result<Self, FrameError>
pub fn atan(&self) -> Result<Self, FrameError>
Alias for arctan. Matches Rust/math convention.
Sourcepub fn asinh(&self) -> Result<Self, FrameError>
pub fn asinh(&self) -> Result<Self, FrameError>
Alias for arcsinh. Matches Rust/math convention.
Sourcepub fn acosh(&self) -> Result<Self, FrameError>
pub fn acosh(&self) -> Result<Self, FrameError>
Alias for arccosh. Matches Rust/math convention.
Sourcepub fn atanh(&self) -> Result<Self, FrameError>
pub fn atanh(&self) -> Result<Self, FrameError>
Alias for arctanh. Matches Rust/math convention.
Sourcepub fn expm1(&self) -> Result<Self, FrameError>
pub fn expm1(&self) -> Result<Self, FrameError>
Element-wise exp(x) - 1 with improved precision for small x.
Matches np.expm1(series). NaN values pass through.
Sourcepub fn log1p(&self) -> Result<Self, FrameError>
pub fn log1p(&self) -> Result<Self, FrameError>
Element-wise log(1 + x) with improved precision for small x.
Matches np.log1p(series). NaN values pass through.
Sourcepub fn cbrt(&self) -> Result<Self, FrameError>
pub fn cbrt(&self) -> Result<Self, FrameError>
Element-wise cube root.
Matches np.cbrt(series). NaN values pass through.
Sourcepub fn sign(&self) -> Result<Self, FrameError>
pub fn sign(&self) -> Result<Self, FrameError>
Element-wise sign (-1, 0, or 1).
Matches np.sign(series). NaN values pass through.
Sourcepub fn signbit(&self) -> Result<Self, FrameError>
pub fn signbit(&self) -> Result<Self, FrameError>
Element-wise sign bit (true if negative).
Matches np.signbit(series). NaN values pass through.
Sourcepub fn radians(&self) -> Result<Self, FrameError>
pub fn radians(&self) -> Result<Self, FrameError>
Convert angles from degrees to radians.
Matches np.radians(series) / np.deg2rad(series).
Sourcepub fn deg2rad(&self) -> Result<Self, FrameError>
pub fn deg2rad(&self) -> Result<Self, FrameError>
Alias for radians(). Matches np.deg2rad(series).
Sourcepub fn degrees(&self) -> Result<Self, FrameError>
pub fn degrees(&self) -> Result<Self, FrameError>
Convert angles from radians to degrees.
Matches np.degrees(series) / np.rad2deg(series).
Sourcepub fn rad2deg(&self) -> Result<Self, FrameError>
pub fn rad2deg(&self) -> Result<Self, FrameError>
Alias for degrees(). Matches np.rad2deg(series).
Sourcepub fn reciprocal(&self) -> Result<Self, FrameError>
pub fn reciprocal(&self) -> Result<Self, FrameError>
Element-wise reciprocal (1/x).
Matches np.reciprocal(series). NaN values pass through.
Sourcepub fn square(&self) -> Result<Self, FrameError>
pub fn square(&self) -> Result<Self, FrameError>
Element-wise square (x^2).
Matches np.square(series). NaN values pass through.
Sourcepub fn rint(&self) -> Result<Self, FrameError>
pub fn rint(&self) -> Result<Self, FrameError>
Round to nearest integer (banker’s rounding).
Matches np.rint(series). NaN values pass through.
Sourcepub fn fix(&self) -> Result<Self, FrameError>
pub fn fix(&self) -> Result<Self, FrameError>
Round toward zero (alias for trunc).
Matches np.fix(series). NaN values pass through.
Sourcepub fn isfinite(&self) -> Result<Self, FrameError>
pub fn isfinite(&self) -> Result<Self, FrameError>
Element-wise check for finite values.
Matches np.isfinite(series). Returns boolean Series.
Sourcepub fn isinf(&self) -> Result<Self, FrameError>
pub fn isinf(&self) -> Result<Self, FrameError>
Element-wise check for infinite values.
Matches np.isinf(series). Returns boolean Series.
Sourcepub fn isnan(&self) -> Result<Self, FrameError>
pub fn isnan(&self) -> Result<Self, FrameError>
Element-wise check for NaN values.
Matches np.isnan(series). Returns boolean Series.
Sourcepub fn isneginf(&self) -> Result<Self, FrameError>
pub fn isneginf(&self) -> Result<Self, FrameError>
Element-wise check for negative infinity.
Matches np.isneginf(series). Returns boolean Series.
Sourcepub fn isposinf(&self) -> Result<Self, FrameError>
pub fn isposinf(&self) -> Result<Self, FrameError>
Element-wise check for positive infinity.
Matches np.isposinf(series). Returns boolean Series.
Sourcepub fn nan_to_num(&self) -> Result<Self, FrameError>
pub fn nan_to_num(&self) -> Result<Self, FrameError>
Replace NaN with zero and infinity with large finite numbers.
Matches np.nan_to_num(series).
Sourcepub fn neg(&self) -> Result<Self, FrameError>
pub fn neg(&self) -> Result<Self, FrameError>
Element-wise negation (-x).
Matches np.negative(series) / -series.
Sourcepub fn negative(&self) -> Result<Self, FrameError>
pub fn negative(&self) -> Result<Self, FrameError>
Alias for neg(). Matches np.negative(series).
Sourcepub fn positive(&self) -> Result<Self, FrameError>
pub fn positive(&self) -> Result<Self, FrameError>
Element-wise identity (+x, no-op for numeric).
Matches np.positive(series) / +series.
Sourcepub fn reverse(&self) -> Result<Self, FrameError>
pub fn reverse(&self) -> Result<Self, FrameError>
Reverse the order of elements.
Matches series[::-1] / np.flip(series).
Sourcepub fn flip(&self) -> Result<Self, FrameError>
pub fn flip(&self) -> Result<Self, FrameError>
Alias for reverse(). Matches np.flip(series).
Sourcepub fn roll(&self, shift: i64) -> Result<Self, FrameError>
pub fn roll(&self, shift: i64) -> Result<Self, FrameError>
Roll elements along the axis by shift positions.
Matches np.roll(series, shift). Elements shifted off
one end wrap around to the other.
Sourcepub fn tile(&self, reps: usize) -> Result<Self, FrameError>
pub fn tile(&self, reps: usize) -> Result<Self, FrameError>
Tile (repeat) the series a given number of times.
Matches np.tile(series, reps).
Sourcepub fn maximum(&self, other: &Self) -> Result<Self, FrameError>
pub fn maximum(&self, other: &Self) -> Result<Self, FrameError>
Element-wise maximum of two Series.
Matches np.maximum(s1, s2). NaN propagates.
Sourcepub fn minimum(&self, other: &Self) -> Result<Self, FrameError>
pub fn minimum(&self, other: &Self) -> Result<Self, FrameError>
Element-wise minimum of two Series.
Matches np.minimum(s1, s2). NaN propagates.
Sourcepub fn fmax(&self, other: &Self) -> Result<Self, FrameError>
pub fn fmax(&self, other: &Self) -> Result<Self, FrameError>
Element-wise maximum ignoring NaN.
Matches np.fmax(s1, s2). Ignores NaN.
Sourcepub fn fmin(&self, other: &Self) -> Result<Self, FrameError>
pub fn fmin(&self, other: &Self) -> Result<Self, FrameError>
Element-wise minimum ignoring NaN.
Matches np.fmin(s1, s2). Ignores NaN.
Sourcepub fn hypot(&self, other: &Self) -> Result<Self, FrameError>
pub fn hypot(&self, other: &Self) -> Result<Self, FrameError>
Element-wise hypotenuse: sqrt(x2 + y2).
Matches np.hypot(s1, s2).
Sourcepub fn atan2(&self, other: &Self) -> Result<Self, FrameError>
pub fn atan2(&self, other: &Self) -> Result<Self, FrameError>
Element-wise arc tangent of y/x (choosing quadrant correctly).
Matches np.arctan2(y, x).
Sourcepub fn arctan2(&self, other: &Self) -> Result<Self, FrameError>
pub fn arctan2(&self, other: &Self) -> Result<Self, FrameError>
Alias for atan2. Matches np.arctan2.
Sourcepub fn copysign(&self, other: &Self) -> Result<Self, FrameError>
pub fn copysign(&self, other: &Self) -> Result<Self, FrameError>
Element-wise copy sign from other to self.
Matches np.copysign(s1, s2).
Sourcepub fn bitwise_and(&self, other: &Self) -> Result<Self, FrameError>
pub fn bitwise_and(&self, other: &Self) -> Result<Self, FrameError>
Element-wise bitwise AND.
Matches np.bitwise_and(s1, s2).
Sourcepub fn bitwise_or(&self, other: &Self) -> Result<Self, FrameError>
pub fn bitwise_or(&self, other: &Self) -> Result<Self, FrameError>
Element-wise bitwise OR.
Matches np.bitwise_or(s1, s2).
Sourcepub fn bitwise_xor(&self, other: &Self) -> Result<Self, FrameError>
pub fn bitwise_xor(&self, other: &Self) -> Result<Self, FrameError>
Element-wise bitwise XOR.
Matches np.bitwise_xor(s1, s2).
Sourcepub fn bitwise_not(&self) -> Result<Self, FrameError>
pub fn bitwise_not(&self) -> Result<Self, FrameError>
Element-wise bitwise NOT.
Matches np.bitwise_not(s) / np.invert(s).
Sourcepub fn invert(&self) -> Result<Self, FrameError>
pub fn invert(&self) -> Result<Self, FrameError>
Alias for bitwise_not. Matches np.invert.
Sourcepub fn float_power(&self, other: &Self) -> Result<Self, FrameError>
pub fn float_power(&self, other: &Self) -> Result<Self, FrameError>
Element-wise float power.
Matches np.float_power(s1, s2).
Sourcepub fn floor_divide(&self, other: &Self) -> Result<Self, FrameError>
pub fn floor_divide(&self, other: &Self) -> Result<Self, FrameError>
Element-wise floor division.
Matches np.floor_divide(s1, s2) / s1 // s2.
Sourcepub fn fmod(&self, other: &Self) -> Result<Self, FrameError>
pub fn fmod(&self, other: &Self) -> Result<Self, FrameError>
Element-wise float modulo.
Matches np.fmod(s1, s2).
Sourcepub fn power(&self, other: &Self) -> Result<Self, FrameError>
pub fn power(&self, other: &Self) -> Result<Self, FrameError>
Element-wise power.
Matches np.power(s1, s2) / s1 ** s2.
Sourcepub fn remainder(&self, other: &Self) -> Result<Self, FrameError>
pub fn remainder(&self, other: &Self) -> Result<Self, FrameError>
Element-wise remainder.
Matches np.remainder(s1, s2) / s1 % s2.
Sourcepub fn heaviside(&self, h0: f64) -> Result<Self, FrameError>
pub fn heaviside(&self, h0: f64) -> Result<Self, FrameError>
Heaviside step function.
Matches np.heaviside(s, h0). Returns 0 where x < 0, h0 where x == 0, 1 where x > 0.
Sourcepub fn ldexp(&self, exp: i32) -> Result<Self, FrameError>
pub fn ldexp(&self, exp: i32) -> Result<Self, FrameError>
Multiply by 2^exp.
Matches np.ldexp(s, exp).
Sourcepub fn logaddexp(&self, other: &Self) -> Result<Self, FrameError>
pub fn logaddexp(&self, other: &Self) -> Result<Self, FrameError>
Log of sum of exponentials: log(exp(s1) + exp(s2)).
Matches np.logaddexp(s1, s2).
Sourcepub fn logaddexp2(&self, other: &Self) -> Result<Self, FrameError>
pub fn logaddexp2(&self, other: &Self) -> Result<Self, FrameError>
Log base 2 of sum of exponentials: log2(2^s1 + 2^s2).
Matches np.logaddexp2(s1, s2).
Sourcepub fn spacing(&self) -> Result<Self, FrameError>
pub fn spacing(&self) -> Result<Self, FrameError>
Spacing to next representable float.
Matches np.spacing(s). Returns ULP (unit in last place) for each element.
Sourcepub fn digitize(&self, bins: &Self, right: bool) -> Result<Self, FrameError>
pub fn digitize(&self, bins: &Self, right: bool) -> Result<Self, FrameError>
Digitize: bin indices for each element.
Matches np.digitize(s, bins, right). Returns index of bin each element
falls into.
Sourcepub fn interpolate_linear(&self) -> Result<Self, FrameError>
pub fn interpolate_linear(&self) -> Result<Self, FrameError>
Linear interpolation to fill missing values.
Matches pd.Series.interpolate(method='linear').
Sourcepub fn gcd(&self, other: &Self) -> Result<Self, FrameError>
pub fn gcd(&self, other: &Self) -> Result<Self, FrameError>
Element-wise greatest common divisor.
Matches np.gcd(s1, s2).
Sourcepub fn gradient(&self) -> Result<Self, FrameError>
pub fn gradient(&self) -> Result<Self, FrameError>
Numerical gradient (forward/central/backward differences).
Matches np.gradient(s).
Sourcepub fn convolve(&self, kernel: &Self, mode: &str) -> Result<Self, FrameError>
pub fn convolve(&self, kernel: &Self, mode: &str) -> Result<Self, FrameError>
Discrete convolution of the series with a kernel.
Matches np.convolve(s, kernel, mode). Mode: “full”, “same”, “valid”.
Returns a Series with a RangeIndex matching the output length.
Sourcepub fn correlate(&self, other: &Self, mode: &str) -> Result<Self, FrameError>
pub fn correlate(&self, other: &Self, mode: &str) -> Result<Self, FrameError>
Cross-correlation of the series with another.
Matches np.correlate(s1, s2, mode). Mode: “full”, “same”, “valid”.
Returns a Series with a RangeIndex matching the output length.
Sourcepub fn compress(&self, condition: &Self) -> Result<Self, FrameError>
pub fn compress(&self, condition: &Self) -> Result<Self, FrameError>
Compress series using a boolean condition.
Matches np.compress(condition, s). Returns elements where condition is true.
Returns a Series with a RangeIndex matching the output length.
Sourcepub fn bincount(&self, minlength: usize) -> Result<Self, FrameError>
pub fn bincount(&self, minlength: usize) -> Result<Self, FrameError>
Bin count for non-negative integer values.
Matches np.bincount(s, minlength). Returns counts for each integer bin.
Sourcepub fn flatnonzero(&self) -> Result<Self, FrameError>
pub fn flatnonzero(&self) -> Result<Self, FrameError>
Indices of non-zero elements.
Matches np.flatnonzero(s). Returns indices where values are non-zero.
Sourcepub fn fillna_with_series(&self, other: &Self) -> Result<Self, FrameError>
pub fn fillna_with_series(&self, other: &Self) -> Result<Self, FrameError>
Fill null values using values from another series.
Matches pd.Series.fillna(other) when other is a Series.
Sourcepub fn ediff1d(
&self,
to_begin: Option<Scalar>,
to_end: Option<Scalar>,
) -> Result<Self, FrameError>
pub fn ediff1d( &self, to_begin: Option<Scalar>, to_end: Option<Scalar>, ) -> Result<Self, FrameError>
Differences between consecutive elements.
Matches np.ediff1d(s, to_begin, to_end). Prepends to_begin and appends to_end.
Sourcepub fn cov_ddof(&self, other: &Self, ddof: usize) -> Scalar
pub fn cov_ddof(&self, other: &Self, ddof: usize) -> Scalar
Covariance with degrees of freedom adjustment.
Matches np.cov / pd.DataFrame.cov(ddof). Returns scalar covariance value.
Sourcepub fn frexp(&self) -> Result<(Self, Self), FrameError>
pub fn frexp(&self) -> Result<(Self, Self), FrameError>
Decompose float into mantissa and exponent.
Matches np.frexp(x). Returns (mantissa, exponent) where:
- mantissa is in
[0.5, 1.0)or exactly0.0 - exponent is an integer
x = mantissa * 2^exponent
Sourcepub fn histogram(&self, bin_edges: &[f64]) -> Result<Self, FrameError>
pub fn histogram(&self, bin_edges: &[f64]) -> Result<Self, FrameError>
Compute histogram using provided bin edges.
Matches np.histogram(a, bins=edges). Returns counts for each bin.
Bins are [edges[i], edges[i+1]) except the last which is [edges[n-1], edges[n]].
Sourcepub fn histogram_auto(
&self,
n_bins: usize,
) -> Result<(Self, Vec<f64>), FrameError>
pub fn histogram_auto( &self, n_bins: usize, ) -> Result<(Self, Vec<f64>), FrameError>
Compute histogram with auto-generated bins.
Matches np.histogram(a, bins=n_bins). Returns (counts, bin_edges).
Bins are evenly spaced between min and max of the data.
Sourcepub fn hist_counts(&self, bins: usize) -> Vec<usize>
pub fn hist_counts(&self, bins: usize) -> Vec<usize>
Compute histogram counts.
Matches the bins=n histogram path behind pd.Series.hist.
Sourcepub fn argpartition(&self, kth: usize) -> Result<Vec<usize>, FrameError>
pub fn argpartition(&self, kth: usize) -> Result<Vec<usize>, FrameError>
Return indices that partition the array around kth element.
Matches np.argpartition(). After partition, element at kth position
is in its sorted position, elements before are <= kth element,
elements after are >= kth element.
Sourcepub fn partition(&self, kth: usize) -> Result<Self, FrameError>
pub fn partition(&self, kth: usize) -> Result<Self, FrameError>
Partition array around kth smallest element.
Matches np.partition(). Returns a partially sorted Series where
element at kth position is in its final sorted position.
Sourcepub fn array_split(&self, n: usize) -> Result<Vec<Self>, FrameError>
pub fn array_split(&self, n: usize) -> Result<Vec<Self>, FrameError>
Split Series into n equal-ish parts.
Matches np.array_split(). Returns Vec of Series.
Sourcepub fn zeros_like(&self) -> Result<Self, FrameError>
pub fn zeros_like(&self) -> Result<Self, FrameError>
Create a zeros Series with same shape and dtype as self.
Matches np.zeros_like().
Sourcepub fn ones_like(&self) -> Result<Self, FrameError>
pub fn ones_like(&self) -> Result<Self, FrameError>
Create a ones Series with same shape and dtype as self.
Matches np.ones_like().
Sourcepub fn full_like(&self, fill_value: Scalar) -> Result<Self, FrameError>
pub fn full_like(&self, fill_value: Scalar) -> Result<Self, FrameError>
Create a Series filled with fill_value with same shape as self.
Matches np.full_like().
Sourcepub fn logical_and(&self, other: &Self) -> Result<Self, FrameError>
pub fn logical_and(&self, other: &Self) -> Result<Self, FrameError>
Logical AND between two Series.
Matches np.logical_and().
Sourcepub fn logical_or(&self, other: &Self) -> Result<Self, FrameError>
pub fn logical_or(&self, other: &Self) -> Result<Self, FrameError>
Logical OR between two Series.
Matches np.logical_or().
Sourcepub fn logical_xor(&self, other: &Self) -> Result<Self, FrameError>
pub fn logical_xor(&self, other: &Self) -> Result<Self, FrameError>
Logical XOR between two Series.
Matches np.logical_xor().
Sourcepub fn logical_not(&self) -> Result<Self, FrameError>
pub fn logical_not(&self) -> Result<Self, FrameError>
Logical NOT (element-wise negation to boolean).
Matches np.logical_not().
Sourcepub fn left_shift(&self, other: &Self) -> Result<Self, FrameError>
pub fn left_shift(&self, other: &Self) -> Result<Self, FrameError>
Left bit shift.
Matches np.left_shift().
Sourcepub fn modf(&self) -> Result<(Self, Self), FrameError>
pub fn modf(&self) -> Result<(Self, Self), FrameError>
Split into integer and fractional parts.
Matches np.modf(x). Returns (fractional_part, integer_part) as two Series.
Sourcepub fn try_sum_timedelta_ns(&self) -> Option<Result<i64, TemporalFailure>>
pub fn try_sum_timedelta_ns(&self) -> Option<Result<i64, TemporalFailure>>
Fallible sibling of Self::sum for a Timedelta64 column: reports a
reduction overflow instead of surfacing it as NaT.
Some(Ok(ns)) for a timedelta64 column that folds without overflowing,
Some(Err(failure)) when it overflows, and None when the column is not
Timedelta64 — so the caller can tell “no overflow” from “this reduction
has no timedelta overflow contract at all” without a second dtype match.
MEASURED, live pandas 2.2.3 — the reduction does NOT raise the scalar additive class, it raises its own:
pd.Series([pd.Timedelta.max, pd.Timedelta.max]).sum()
-> ValueError: overflow in timedelta operation
pd.Timedelta.max + pd.Timedelta('1ns')
-> OverflowErrorso the failure carries PandasTemporalError::OverflowInTimedeltaOperation
rather than the Overflow that Timedelta::try_add attaches — the
taxonomy reserves that variant for exactly Series.sum() / Series.std().
The operands recorded are the running total and the element that could
not be folded into it, which is what a caller needs to report the row.
⚠ THIS CHANGES NO EXISTING BEHAVIOUR. Self::sum still folds with the
saturating Timedelta::add and still yields NaT. This is the
vectorized counterpart of the pattern the scalar half of
br-frankenpandas-fyr1z-strict-raise-arms-t7ht2 already landed, where
Timedelta::try_div_scalar was added beside an unchanged div_scalar:
the fallible sibling makes the failure available to a policy, and
nothing routes through it until a mode carrier does. Feed it to
OverflowPolicy::resolve — STRICT surfaces the failure, HARDENED
recovers as NaT and writes the audit entry, SurfaceNat reproduces
today’s answer bit-for-bit.
NaT elements are skipped exactly as Self::sum skips them, so the two
agree element-for-element on every input that does not overflow.
Sourcepub fn sum(&self) -> Result<Scalar, FrameError>
pub fn sum(&self) -> Result<Scalar, FrameError>
Sum of non-null numeric values. Returns Scalar::Float64(0.0) for empty.
Matches pd.Series.sum().
Sourcepub fn mean(&self) -> Result<Scalar, FrameError>
pub fn mean(&self) -> Result<Scalar, FrameError>
Mean of non-null numeric values. Returns NaN for empty.
Matches pd.Series.mean().
Sourcepub fn average(&self, weights: &Self) -> Scalar
pub fn average(&self, weights: &Self) -> Scalar
Weighted average of non-null numeric values.
Matches np.average(s, weights=w). Returns NaN if all weights are zero
or the series is empty.
Sourcepub fn min(&self) -> Result<Scalar, FrameError>
pub fn min(&self) -> Result<Scalar, FrameError>
Min of non-null numeric values. Returns NaN for empty.
Matches pd.Series.min().
Sourcepub fn max(&self) -> Result<Scalar, FrameError>
pub fn max(&self) -> Result<Scalar, FrameError>
Max of non-null numeric values. Returns NaN for empty.
Matches pd.Series.max().
Sourcepub fn std(&self) -> Result<Scalar, FrameError>
pub fn std(&self) -> Result<Scalar, FrameError>
Standard deviation of non-null numeric values (ddof=1, sample std).
Matches pd.Series.std().
Sourcepub fn var(&self) -> Result<Scalar, FrameError>
pub fn var(&self) -> Result<Scalar, FrameError>
Variance of non-null numeric values (ddof=1, sample variance).
Matches pd.Series.var().
Sourcepub fn var_ddof(&self, ddof: usize) -> Result<Scalar, FrameError>
pub fn var_ddof(&self, ddof: usize) -> Result<Scalar, FrameError>
Variance with configurable degrees of freedom.
Matches pd.Series.var(ddof=n). ddof=0 gives population variance,
ddof=1 (default in pandas) gives sample variance.
Sourcepub fn std_ddof(&self, ddof: usize) -> Result<Scalar, FrameError>
pub fn std_ddof(&self, ddof: usize) -> Result<Scalar, FrameError>
Standard deviation with configurable degrees of freedom.
Matches pd.Series.std(ddof=n).
Sourcepub fn median(&self) -> Result<Scalar, FrameError>
pub fn median(&self) -> Result<Scalar, FrameError>
Median of non-null numeric values. Returns NaN for empty.
Matches pd.Series.median().
Sourcepub fn any(&self) -> Result<bool, FrameError>
pub fn any(&self) -> Result<bool, FrameError>
Whether any non-missing value is truthy.
Matches pd.Series.any() with default skipna=True.
Sourcepub fn all(&self) -> Result<bool, FrameError>
pub fn all(&self) -> Result<bool, FrameError>
Whether all non-missing values are truthy.
Matches pd.Series.all() with default skipna=True.
Sourcepub fn prod(&self) -> Result<Scalar, FrameError>
pub fn prod(&self) -> Result<Scalar, FrameError>
Product of non-null numeric values. Returns 1.0 for empty.
Matches pd.Series.prod().
Sourcepub fn product(&self) -> Result<Scalar, FrameError>
pub fn product(&self) -> Result<Scalar, FrameError>
pandas alias for Self::prod. Matches pd.Series.product().
Per br-frankenpandas-az1pt.
Sourcepub fn sum_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>
pub fn sum_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>
Sum with skipna control.
Matches pd.Series.sum(skipna=True|False). When skipna=False,
returns NaN if any value is missing.
Sourcepub fn mean_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>
pub fn mean_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>
Mean with skipna control.
Sourcepub fn min_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>
pub fn min_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>
Min with skipna control.
Sourcepub fn max_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>
pub fn max_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>
Max with skipna control.
Sourcepub fn std_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>
pub fn std_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>
Std with skipna control.
Sourcepub fn var_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>
pub fn var_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>
Var with skipna control.
Sourcepub fn median_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>
pub fn median_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>
Median with skipna control.
Sourcepub fn prod_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>
pub fn prod_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>
Prod with skipna control.
Sourcepub fn nansum(&self) -> Result<Scalar, FrameError>
pub fn nansum(&self) -> Result<Scalar, FrameError>
Alias for sum, matching np.nansum.
Sourcepub fn nanmean(&self) -> Result<Scalar, FrameError>
pub fn nanmean(&self) -> Result<Scalar, FrameError>
Alias for mean, matching np.nanmean.
Sourcepub fn nanmin(&self) -> Result<Scalar, FrameError>
pub fn nanmin(&self) -> Result<Scalar, FrameError>
Alias for min, matching np.nanmin.
Sourcepub fn nanmax(&self) -> Result<Scalar, FrameError>
pub fn nanmax(&self) -> Result<Scalar, FrameError>
Alias for max, matching np.nanmax.
Sourcepub fn nanprod(&self) -> Result<Scalar, FrameError>
pub fn nanprod(&self) -> Result<Scalar, FrameError>
Alias for prod, matching np.nanprod.
Sourcepub fn nanstd(&self, ddof: usize) -> Result<Scalar, FrameError>
pub fn nanstd(&self, ddof: usize) -> Result<Scalar, FrameError>
Alias for std_ddof, matching np.nanstd.
Sourcepub fn nanvar(&self, ddof: usize) -> Result<Scalar, FrameError>
pub fn nanvar(&self, ddof: usize) -> Result<Scalar, FrameError>
Alias for var_ddof, matching np.nanvar.
Sourcepub fn nanmedian(&self) -> Result<Scalar, FrameError>
pub fn nanmedian(&self) -> Result<Scalar, FrameError>
Alias for median, matching np.nanmedian.
Sourcepub fn lcm(&self, other: &Self) -> Result<Self, FrameError>
pub fn lcm(&self, other: &Self) -> Result<Self, FrameError>
Element-wise least common multiple.
Matches np.lcm(x, y).
Sourcepub fn ptp(&self) -> Scalar
pub fn ptp(&self) -> Scalar
Peak-to-peak range (max − min) over non-missing values.
Matches np.ptp.
Sourcepub fn nextafter(&self, other: &Self) -> Result<Self, FrameError>
pub fn nextafter(&self, other: &Self) -> Result<Self, FrameError>
Return the next representable floating-point value after x toward y.
Matches np.nextafter(x, y).
Sourcepub fn percentile(&self, p: f64) -> Scalar
pub fn percentile(&self, p: f64) -> Scalar
Percentile of non-missing values.
Matches np.percentile(). Takes percentile p in [0, 100].
Sourcepub fn nanquantile(&self, q: f64) -> Result<Scalar, FrameError>
pub fn nanquantile(&self, q: f64) -> Result<Scalar, FrameError>
Alias for quantile, matching np.nanquantile.
Sourcepub fn nanpercentile(&self, p: f64) -> Scalar
pub fn nanpercentile(&self, p: f64) -> Scalar
Alias for percentile, matching np.nanpercentile.
Sourcepub fn put(
&self,
indices: &[usize],
values: &[Scalar],
) -> Result<Self, FrameError>
pub fn put( &self, indices: &[usize], values: &[Scalar], ) -> Result<Self, FrameError>
Replace elements at specified indices with given values.
Matches np.put(). Returns a new Series with values replaced at indices.
Sourcepub fn sinc(&self) -> Result<Self, FrameError>
pub fn sinc(&self) -> Result<Self, FrameError>
Compute the sinc function.
Matches np.sinc(x). Returns sin(pi*x) / (pi*x), with sinc(0) = 1.
Sourcepub fn trapz(&self, dx: f64) -> Result<Scalar, FrameError>
pub fn trapz(&self, dx: f64) -> Result<Scalar, FrameError>
Trapezoidal numerical integration.
Matches np.trapz(). Returns scalar result of integral.
Sourcepub fn trim_zeros(&self, trim: &str) -> Result<Self, FrameError>
pub fn trim_zeros(&self, trim: &str) -> Result<Self, FrameError>
Trim leading and/or trailing zeros.
Matches np.trim_zeros(). The trim parameter specifies:
"f": trim leading zeros"b": trim trailing zeros"fb"(default): trim both
Sourcepub fn weighted_mean(&self, weights: &Self) -> Scalar
pub fn weighted_mean(&self, weights: &Self) -> Scalar
Weighted average of non-missing values.
Matches np.average(a, weights=w). Returns NaN if weights sum to zero.
Sourcepub fn resize(&self, new_size: usize) -> Result<Self, FrameError>
pub fn resize(&self, new_size: usize) -> Result<Self, FrameError>
Resize Series to new size, padding or truncating as needed.
Matches np.resize(). If new size is larger, values cycle from beginning.
Sourcepub fn true_divide(&self, other: &Self) -> Result<Self, FrameError>
pub fn true_divide(&self, other: &Self) -> Result<Self, FrameError>
Alias for div, matching NumPy naming.
Sourcepub fn right_shift(&self, other: &Self) -> Result<Self, FrameError>
pub fn right_shift(&self, other: &Self) -> Result<Self, FrameError>
Right bit shift.
Matches np.right_shift().
Sourcepub fn diff_valid(&self) -> Result<Self, FrameError>
pub fn diff_valid(&self) -> Result<Self, FrameError>
Difference computed only over valid (non-missing) values.
Matches the pandas idiom s.dropna().diff().reindex(s.index).
Missing values propagate; the first valid value yields NaN.
Sourcepub fn nanargmin(&self) -> Result<i64, FrameError>
pub fn nanargmin(&self) -> Result<i64, FrameError>
Alias for argmin, matching np.nanargmin.
Sourcepub fn nanargmax(&self) -> Result<i64, FrameError>
pub fn nanargmax(&self) -> Result<i64, FrameError>
Alias for argmax, matching np.nanargmax.
Sourcepub fn nan_to_num_with_values(
&self,
nan: f64,
posinf: f64,
neginf: f64,
) -> Result<Self, FrameError>
pub fn nan_to_num_with_values( &self, nan: f64, posinf: f64, neginf: f64, ) -> Result<Self, FrameError>
Replace NaN and infinity with specified values.
Matches np.nan_to_num(x, nan=nan, posinf=posinf, neginf=neginf).
Sourcepub fn isclose(
&self,
other: &Self,
rtol: f64,
atol: f64,
) -> Result<Self, FrameError>
pub fn isclose( &self, other: &Self, rtol: f64, atol: f64, ) -> Result<Self, FrameError>
Element-wise comparison for approximate equality.
Matches np.isclose(). Returns True where |a - b| <= atol + rtol * |b|.
Sourcepub fn mode(&self) -> Result<Self, FrameError>
pub fn mode(&self) -> Result<Self, FrameError>
Most frequently occurring value(s).
Matches pd.Series.mode(). Returns a new Series containing
all values tied for the highest frequency, sorted ascending.
Sourcepub fn mode_with_dropna(&self, dropna: bool) -> Result<Self, FrameError>
pub fn mode_with_dropna(&self, dropna: bool) -> Result<Self, FrameError>
Most frequently occurring value(s) with explicit null counting control.
Matches pd.Series.mode(dropna=...).
Sourcepub fn shift(&self, periods: i64) -> Result<Self, FrameError>
pub fn shift(&self, periods: i64) -> Result<Self, FrameError>
Shift values by periods positions, filling with NaN.
Matches pd.Series.shift(periods). Positive shifts move values
downward (earlier positions become NaN); negative shifts move
values upward (later positions become NaN).
Sourcepub fn shift_with_fill_value(
&self,
periods: i64,
fill_value: Scalar,
) -> Result<Self, FrameError>
pub fn shift_with_fill_value( &self, periods: i64, fill_value: Scalar, ) -> Result<Self, FrameError>
Shift index by periods, filling the vacated positions with fill_value
instead of NaN. Matches pd.Series.shift(periods, fill_value=...). When
fill_value shares the column’s dtype (e.g. an Int64 fill on an Int64
column), no missing value is introduced, so the result keeps that dtype
rather than widening to Float64 — exactly as pandas does.
Sourcepub fn diff(&self, periods: i64) -> Result<Self, FrameError>
pub fn diff(&self, periods: i64) -> Result<Self, FrameError>
Element-wise difference with the previous element.
Matches pd.Series.diff(periods). Computes value[i] - value[i - periods].
Produces NaN for positions without a valid predecessor and for nulls.
Sourcepub fn cumsum(&self) -> Result<Self, FrameError>
pub fn cumsum(&self) -> Result<Self, FrameError>
Cumulative sum, skipping NaN.
Matches pd.Series.cumsum(skipna=True).
Sourcepub fn cumsum_with_skipna(&self, skipna: bool) -> Result<Self, FrameError>
pub fn cumsum_with_skipna(&self, skipna: bool) -> Result<Self, FrameError>
Cumulative sum with an explicit skipna, matching
pd.Series.cumsum(skipna=...). skipna=false propagates the first
NaN/NaT through every later position.
Sourcepub fn cumprod_with_skipna(&self, skipna: bool) -> Result<Self, FrameError>
pub fn cumprod_with_skipna(&self, skipna: bool) -> Result<Self, FrameError>
Cumulative product with an explicit skipna (see cumsum_with_skipna).
Sourcepub fn cummax_with_skipna(&self, skipna: bool) -> Result<Self, FrameError>
pub fn cummax_with_skipna(&self, skipna: bool) -> Result<Self, FrameError>
Cumulative maximum with an explicit skipna (see cumsum_with_skipna).
Sourcepub fn cummin_with_skipna(&self, skipna: bool) -> Result<Self, FrameError>
pub fn cummin_with_skipna(&self, skipna: bool) -> Result<Self, FrameError>
Cumulative minimum with an explicit skipna (see cumsum_with_skipna).
Sourcepub fn cumprod(&self) -> Result<Self, FrameError>
pub fn cumprod(&self) -> Result<Self, FrameError>
Cumulative product, skipping NaN.
Matches pd.Series.cumprod(skipna=True).
Sourcepub fn cummin(&self) -> Result<Self, FrameError>
pub fn cummin(&self) -> Result<Self, FrameError>
Cumulative minimum, skipping NaN.
Matches pd.Series.cummin(skipna=True).
Sourcepub fn cummax(&self) -> Result<Self, FrameError>
pub fn cummax(&self) -> Result<Self, FrameError>
Cumulative maximum, skipping NaN.
Matches pd.Series.cummax(skipna=True).
Sourcepub fn where_cond(
&self,
cond: &Self,
other: Option<&Scalar>,
) -> Result<Self, FrameError>
pub fn where_cond( &self, cond: &Self, other: Option<&Scalar>, ) -> Result<Self, FrameError>
Keep values where cond is True; replace others with other.
Matches series.where(cond, other). If other is None, replaced
values become NaN. The condition Series is aligned to self via
left-index alignment before masking.
Sourcepub fn where(
&self,
cond: &Self,
other: Option<&Scalar>,
) -> Result<Self, FrameError>
pub fn where( &self, cond: &Self, other: Option<&Scalar>, ) -> Result<Self, FrameError>
Pandas-named alias for Self::where_cond.
Matches pd.Series.where(cond, other). Raw identifier syntax keeps
the pandas spelling available despite Rust’s where keyword.
Sourcepub fn where_cond_series(
&self,
cond: &Self,
other: &Self,
) -> Result<Self, FrameError>
pub fn where_cond_series( &self, cond: &Self, other: &Self, ) -> Result<Self, FrameError>
Keep values where cond is True, replacing False positions with
corresponding values from other Series.
Matches series.where(cond, other=series).
Sourcepub fn where_series(
&self,
cond: &Self,
other: &Self,
) -> Result<Self, FrameError>
pub fn where_series( &self, cond: &Self, other: &Self, ) -> Result<Self, FrameError>
Pandas-named Series replacement alias for Self::where_cond_series.
Sourcepub fn mask_series(&self, cond: &Self, other: &Self) -> Result<Self, FrameError>
pub fn mask_series(&self, cond: &Self, other: &Self) -> Result<Self, FrameError>
Replace values where cond is True with corresponding values from
other Series.
Matches series.mask(cond, other=series).
Sourcepub fn mask(
&self,
cond: &Self,
other: Option<&Scalar>,
) -> Result<Self, FrameError>
pub fn mask( &self, cond: &Self, other: Option<&Scalar>, ) -> Result<Self, FrameError>
Replace values where cond is True with other.
Matches series.mask(cond, other). This is the inverse of where:
values are replaced where the condition IS True, not where it is False.
pub fn isin(&self, test_values: &[Scalar]) -> Result<Self, FrameError>
Sourcepub fn between(
&self,
left: &Scalar,
right: &Scalar,
inclusive: &str,
) -> Result<Self, FrameError>
pub fn between( &self, left: &Scalar, right: &Scalar, inclusive: &str, ) -> Result<Self, FrameError>
Test whether each element falls within a range.
Matches series.between(left, right, inclusive='both'). Returns a
boolean Series. The inclusive parameter controls boundary behavior:
"both":left <= x <= right"neither":left < x < right"left":left <= x < right"right":left < x <= right
Null elements produce false.
Sourcepub fn idxmin(&self) -> Result<IndexLabel, FrameError>
pub fn idxmin(&self) -> Result<IndexLabel, FrameError>
Return the label of the minimum value.
Matches series.idxmin(). Skips missing values. Returns an error
if the series is empty or all-null.
Sourcepub fn idxmax(&self) -> Result<IndexLabel, FrameError>
pub fn idxmax(&self) -> Result<IndexLabel, FrameError>
Return the label of the maximum value.
Matches series.idxmax(). Skips missing values.
Sourcepub fn nlargest(&self, n: usize) -> Result<Self, FrameError>
pub fn nlargest(&self, n: usize) -> Result<Self, FrameError>
Return the n largest values as a new Series, sorted descending.
Matches series.nlargest(n). Missing values are excluded.
Sourcepub fn nsmallest(&self, n: usize) -> Result<Self, FrameError>
pub fn nsmallest(&self, n: usize) -> Result<Self, FrameError>
Return the n smallest values as a new Series, sorted ascending.
Matches series.nsmallest(n). Missing values are excluded.
Sourcepub fn nsmallest_keep(&self, n: usize, keep: &str) -> Result<Self, FrameError>
pub fn nsmallest_keep(&self, n: usize, keep: &str) -> Result<Self, FrameError>
Return the n smallest values with keep parameter.
Matches series.nsmallest(n, keep='first'|'last'|'all').
first: keep first occurrence of duplicateslast: keep last occurrence of duplicatesall: keep all occurrences (may return more than n rows)
Sourcepub fn nlargest_keep(&self, n: usize, keep: &str) -> Result<Self, FrameError>
pub fn nlargest_keep(&self, n: usize, keep: &str) -> Result<Self, FrameError>
Return the n largest values with keep parameter.
Matches series.nlargest(n, keep='first'|'last'|'all').
Sourcepub fn argsort(&self, ascending: bool) -> Result<Self, FrameError>
pub fn argsort(&self, ascending: bool) -> Result<Self, FrameError>
Return the integer indices that would sort the Series.
Matches pd.Series.argsort() for the default ascending path.
Current pandas maps missing positions to -1; descending argsort is a
FrankenPandas extension and keeps missing values last.
Sourcepub fn argmin(&self) -> Result<i64, FrameError>
pub fn argmin(&self) -> Result<i64, FrameError>
Return the integer position of the minimum value.
Matches pd.Series.argmin(). Skips missing values.
Sourcepub fn argmin_skipna(&self, skipna: bool) -> Result<i64, FrameError>
pub fn argmin_skipna(&self, skipna: bool) -> Result<i64, FrameError>
Return the integer position of the minimum value with explicit NA handling.
Matches pd.Series.argmin(skipna=...). Current pandas returns -1 for
all-NA inputs and for skipna=false inputs containing any NA.
Sourcepub fn argmax(&self) -> Result<i64, FrameError>
pub fn argmax(&self) -> Result<i64, FrameError>
Return the integer position of the maximum value.
Matches pd.Series.argmax(). Skips missing values.
Sourcepub fn argmax_skipna(&self, skipna: bool) -> Result<i64, FrameError>
pub fn argmax_skipna(&self, skipna: bool) -> Result<i64, FrameError>
Return the integer position of the maximum value with explicit NA handling.
Matches pd.Series.argmax(skipna=...). Current pandas returns -1 for
all-NA inputs and for skipna=false inputs containing any NA.
Sourcepub fn take(&self, indices: &[i64]) -> Result<Self, FrameError>
pub fn take(&self, indices: &[i64]) -> Result<Self, FrameError>
Select elements by integer positions.
Matches pd.Series.take(indices), including negative indices from the end.
Sourcepub fn searchsorted(
&self,
value: &Scalar,
side: &str,
) -> Result<usize, FrameError>
pub fn searchsorted( &self, value: &Scalar, side: &str, ) -> Result<usize, FrameError>
Find insertion points to maintain sorted order.
Matches pd.Series.searchsorted(value, side='left'|'right').
The Series must be sorted. Returns integer positions.
Works for any ordered Scalar type — numeric (Int64/Float64/ Timedelta64), textual (Utf8), and Bool. Previously the implementation coerced the needle to f64 unconditionally, which rejected Utf8 needles with a non-numeric type error even though pandas supports string searchsorted on string-sorted Series.
Sourcepub fn searchsorted_values(
&self,
values: &[Scalar],
side: &str,
) -> Result<Vec<usize>, FrameError>
pub fn searchsorted_values( &self, values: &[Scalar], side: &str, ) -> Result<Vec<usize>, FrameError>
Find insertion points for array-like values to maintain sorted order.
Matches pd.Series.searchsorted(values, side='left'|'right')
for array-like inputs. The Series must be sorted. Returns
integer positions in the same order as the input slice.
Sourcepub fn searchsorted_with_sorter(
&self,
value: &Scalar,
side: &str,
sorter: &[i64],
) -> Result<usize, FrameError>
pub fn searchsorted_with_sorter( &self, value: &Scalar, side: &str, sorter: &[i64], ) -> Result<usize, FrameError>
Find an insertion point using an explicit sorter permutation.
Matches pd.Series.searchsorted(value, side='left'|'right', sorter=...).
sorter must have the same length as the Series and describe the
integer positions that would sort the Series.
Sourcepub fn searchsorted_values_with_sorter(
&self,
values: &[Scalar],
side: &str,
sorter: &[i64],
) -> Result<Vec<usize>, FrameError>
pub fn searchsorted_values_with_sorter( &self, values: &[Scalar], side: &str, sorter: &[i64], ) -> Result<Vec<usize>, FrameError>
Find insertion points for array-like values using an explicit sorter.
Matches pd.Series.searchsorted(values, side='left'|'right', sorter=...).
Sourcepub fn factorize_with_options(
&self,
sort: bool,
use_na_sentinel: bool,
) -> Result<(Self, Self), FrameError>
pub fn factorize_with_options( &self, sort: bool, use_na_sentinel: bool, ) -> Result<(Self, Self), FrameError>
Encode the Series as an enumerated type.
Matches pd.Series.factorize(). Returns (codes, uniques) where
codes is an Int64 Series of category indices (-1 for NaN) and
uniques is a Series of the unique values in order of appearance.
Factorize with sort + use_na_sentinel options.
Per br-frankenpandas-ca5bc2: matches pd.Series.factorize(sort, use_na_sentinel).
sort=true: uniques are returned in sorted order; codes are remapped accordingly.use_na_sentinel=false: missing values become a regular unique bucket with their own code instead of-1.
Delegates to fp-columnar’s Column::factorize_with_options (br-9433f).
pub fn factorize(&self) -> Result<(Self, Self), FrameError>
Sourcepub fn sample(
&self,
n: Option<usize>,
frac: Option<f64>,
replace: bool,
seed: Option<u64>,
) -> Result<Self, FrameError>
pub fn sample( &self, n: Option<usize>, frac: Option<f64>, replace: bool, seed: Option<u64>, ) -> Result<Self, FrameError>
Randomly sample elements from the Series.
Matches pd.Series.sample(n, frac, replace, random_state).
Sourcepub fn sem(&self) -> Result<f64, FrameError>
pub fn sem(&self) -> Result<f64, FrameError>
Standard error of the mean.
Matches pd.Series.sem(). Computes std / sqrt(n).
Sourcepub fn skew(&self) -> Result<f64, FrameError>
pub fn skew(&self) -> Result<f64, FrameError>
Skewness (Fisher’s definition, bias=False).
Matches pd.Series.skew().
Sourcepub fn kurtosis(&self) -> Result<f64, FrameError>
pub fn kurtosis(&self) -> Result<f64, FrameError>
Excess kurtosis (Fisher’s definition, bias=False).
Matches pd.Series.kurtosis() / pd.Series.kurt().
Sourcepub fn kurt(&self) -> Result<f64, FrameError>
pub fn kurt(&self) -> Result<f64, FrameError>
Alias for kurtosis().
Sourcepub fn squeeze(&self) -> Result<Scalar, Box<Self>>
pub fn squeeze(&self) -> Result<Scalar, Box<Self>>
Squeeze a single-element Series to a Scalar.
Matches pd.Series.squeeze(). Returns the single value if length is 1,
otherwise returns self unchanged wrapped in Err.
Sourcepub fn item(&self) -> Result<Scalar, FrameError>
pub fn item(&self) -> Result<Scalar, FrameError>
Extract scalar value from a single-element Series.
Matches pd.Series.item(). Returns an error if the Series does
not have exactly one element.
Sourcepub fn repeat(&self, repeats: usize) -> Result<Self, FrameError>
pub fn repeat(&self, repeats: usize) -> Result<Self, FrameError>
Repeat each element a constant number of times.
Matches the scalar repeats form of pd.Series.repeat(repeats).
Sourcepub fn repeat_by(&self, repeats: &[usize]) -> Result<Self, FrameError>
pub fn repeat_by(&self, repeats: &[usize]) -> Result<Self, FrameError>
Repeat each element according to the corresponding repeat count.
Matches the array-like repeats form of pd.Series.repeat(repeats).
Sourcepub fn bool_(&self) -> Result<bool, FrameError>
pub fn bool_(&self) -> Result<bool, FrameError>
Extract the single boolean value from a single-element Series.
Matches pd.Series.bool(). Raises an error unless the Series has
exactly one element and that element is a boolean scalar.
Sourcepub fn memory_usage(&self) -> usize
pub fn memory_usage(&self) -> usize
Approximate memory usage in bytes.
Matches pd.Series.memory_usage(). Includes index and values.
Sourcepub fn hasnans(&self) -> bool
pub fn hasnans(&self) -> bool
Return true if the Series contains any NaN or null values.
Matches pd.Series.hasnans.
Sourcepub fn nbytes(&self) -> usize
pub fn nbytes(&self) -> usize
Return the approximate number of bytes used by the Series values.
Matches pd.Series.nbytes. Does not include the index.
Sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
Number of elements in the Series.
Matches pd.Series.size. Equivalent to len() but follows the
pandas property naming so callers can write size-generic code
that works on both Series and DataFrame.
Sourcepub fn shape(&self) -> (usize,)
pub fn shape(&self) -> (usize,)
Shape of the Series.
Matches pd.Series.shape as a one-element tuple.
Sourcepub fn axes(&self) -> Vec<Vec<IndexLabel>>
pub fn axes(&self) -> Vec<Vec<IndexLabel>>
Axes of the Series — a single-entry Vec containing the index
labels (pandas returns [self.index]).
Matches pd.Series.axes.
Sourcepub fn attrs(&self) -> BTreeMap<String, Scalar>
pub fn attrs(&self) -> BTreeMap<String, Scalar>
User metadata mapping.
Matches pd.Series.attrs shape. FrankenPandas does not yet persist
mutable attrs on the Series storage object, so the current accessor
returns the default empty metadata map.
Sourcepub fn info(&self) -> String
pub fn info(&self) -> String
Human-readable Series summary.
Matches pd.Series.info() at the API-shape level for the current
scalar-backed Series model.
Sourcepub fn flags(&self) -> DataFrameFlags
pub fn flags(&self) -> DataFrameFlags
Series flags metadata.
Matches pd.Series.flags for the duplicate-label flag currently
represented by FrankenPandas.
Sourcepub fn set_flags(
&self,
allows_duplicate_labels: Option<bool>,
) -> Result<Self, FrameError>
pub fn set_flags( &self, allows_duplicate_labels: Option<bool>, ) -> Result<Self, FrameError>
Return a Series with updated flags.
Matches pd.Series.set_flags(allows_duplicate_labels=...) for the
duplicate-label flag.
Sourcepub fn reset_index(
&self,
drop: bool,
) -> Result<SeriesResetIndexResult, FrameError>
pub fn reset_index( &self, drop: bool, ) -> Result<SeriesResetIndexResult, FrameError>
Reset the Series index to a default RangeIndex.
Matches pd.Series.reset_index(drop=...):
drop=true: keep only the values; replace the index with0..lenand return a Series.drop=false: widen to a two-column DataFrame with the materialized index first and the value column second.
Sourcepub fn reset_index_with_name(
&self,
drop: bool,
name: Option<&str>,
) -> Result<SeriesResetIndexResult, FrameError>
pub fn reset_index_with_name( &self, drop: bool, name: Option<&str>, ) -> Result<SeriesResetIndexResult, FrameError>
Matches pd.Series.reset_index(drop=..., name=...) for the
single-index Series model.
Sourcepub fn pipe<F>(&self, func: F) -> Result<Self, FrameError>
pub fn pipe<F>(&self, func: F) -> Result<Self, FrameError>
Pass the Series through a function.
Matches pd.Series.pipe(func). Useful for method chaining.
Sourcepub fn items(&self) -> Vec<(IndexLabel, Scalar)>
pub fn items(&self) -> Vec<(IndexLabel, Scalar)>
Return an iterator over (index_label, value) pairs.
Matches pd.Series.items().
Sourcepub fn iteritems(&self) -> Vec<(IndexLabel, Scalar)>
👎Deprecated: use items() instead
pub fn iteritems(&self) -> Vec<(IndexLabel, Scalar)>
use items() instead
Alias for items (deprecated in pandas but kept for compatibility).
Sourcepub fn iat(&self, pos: i64) -> Result<Scalar, FrameError>
pub fn iat(&self, pos: i64) -> Result<Scalar, FrameError>
Access a scalar value by integer position.
Matches pd.Series.iat[i].
Sourcepub fn at(&self, label: &IndexLabel) -> Result<Scalar, FrameError>
pub fn at(&self, label: &IndexLabel) -> Result<Scalar, FrameError>
Access a scalar value by label.
Matches pd.Series.at[label].
Sourcepub fn get(&self, label: &IndexLabel) -> Option<Scalar>
pub fn get(&self, label: &IndexLabel) -> Option<Scalar>
Dict-like scalar lookup by label.
Matches pd.Series.get(key) by returning None instead of an
error for a missing label.
Sourcepub fn get_or(&self, label: &IndexLabel, default: Scalar) -> Scalar
pub fn get_or(&self, label: &IndexLabel, default: Scalar) -> Scalar
Dict-like scalar lookup with a fallback value.
Matches pd.Series.get(key, default=...).
Sourcepub fn pop(&self, label: &IndexLabel) -> Result<(Scalar, Self), FrameError>
pub fn pop(&self, label: &IndexLabel) -> Result<(Scalar, Self), FrameError>
Return a value and a Series with its first matching label removed.
Matches pd.Series.pop(item) in an immutable form.
Sourcepub fn transform<F>(&self, func: F) -> Result<Self, FrameError>
pub fn transform<F>(&self, func: F) -> Result<Self, FrameError>
Apply a function element-wise, returning a Series of the same shape.
Matches pd.Series.transform(func).
Sourcepub fn pct_change(&self, periods: i64) -> Result<Self, FrameError>
pub fn pct_change(&self, periods: i64) -> Result<Self, FrameError>
Percentage change between current and prior element.
Matches series.pct_change(periods=1). pandas 2.2.3 applies the default
fill_method='pad' (forward-fill) BEFORE computing — so an interior
missing value uses the last valid observation, e.g.
[1.0, nan, 4.0].pct_change() is [NaN, 0.0, 3.0], not all-NaN.
(br-frankenpandas-5ioai) Use pct_change_with_fill with
fill_method=None for the no-fill variant.
Sourcepub fn pct_change_with_fill(
&self,
periods: i64,
fill_method: Option<&str>,
limit: Option<usize>,
) -> Result<Self, FrameError>
pub fn pct_change_with_fill( &self, periods: i64, fill_method: Option<&str>, limit: Option<usize>, ) -> Result<Self, FrameError>
Percentage change with optional null fill before computation.
Matches series.pct_change(periods, fill_method=..., limit=...).
fill_method is "ffill" / "pad" (forward-fill missing values, the
pandas 2.2.3 default used by pct_change), "bfill" / "backfill"
(backward-fill), or None (no fill — interior NaN propagates). limit
caps consecutive fills; it is ignored when fill_method is None.
Sourcepub fn to_frame(&self, name: Option<&str>) -> Result<DataFrame, FrameError>
pub fn to_frame(&self, name: Option<&str>) -> Result<DataFrame, FrameError>
Convert Series to a single-column DataFrame.
Matches series.to_frame(name=None). Uses the series name as the
column name by default.
Sourcepub fn asfreq(&self, freq: &str) -> Result<Self, FrameError>
pub fn asfreq(&self, freq: &str) -> Result<Self, FrameError>
Conform the index to a datetime frequency.
Matches pd.Series.asfreq(freq) for datetime-like indexes.
Missing rows introduced by the new frequency are filled with NaN.
Sourcepub fn asfreq_with_options(
&self,
freq: &str,
method: Option<&str>,
fill_value: Option<Scalar>,
) -> Result<Self, FrameError>
pub fn asfreq_with_options( &self, freq: &str, method: Option<&str>, fill_value: Option<Scalar>, ) -> Result<Self, FrameError>
Conform the index to a datetime frequency with optional fill.
Matches pd.Series.asfreq(freq, method=..., fill_value=...).
Sourcepub fn to_period(&self, freq: &str) -> Result<Self, FrameError>
pub fn to_period(&self, freq: &str) -> Result<Self, FrameError>
Convert datetime-like index to period-string representation.
Matches pd.Series.to_period(freq) for the supported frequencies.
Sourcepub fn to_xarray(&self) -> Result<SeriesXArrayDataArray, FrameError>
pub fn to_xarray(&self) -> Result<SeriesXArrayDataArray, FrameError>
Convert Series to xarray DataArray representation.
Matches the practical pd.Series.to_xarray() shape: the index
becomes the single coordinate/dimension, and the Series values
become the data array.
Sourcepub fn describe(&self) -> Result<Self, FrameError>
pub fn describe(&self) -> Result<Self, FrameError>
Generate descriptive statistics for a numeric Series.
Matches pd.Series.describe(). Returns a Series with index
[count, mean, std, min, 25%, 50%, 75%, max].
Sourcepub fn describe_with_percentiles(
&self,
percentiles: &[f64],
) -> Result<Self, FrameError>
pub fn describe_with_percentiles( &self, percentiles: &[f64], ) -> Result<Self, FrameError>
Generate descriptive statistics with custom percentiles.
Matches pd.Series.describe(percentiles=[...]).
Sourcepub fn agg(&self, funcs: &[&str]) -> Result<Self, FrameError>
pub fn agg(&self, funcs: &[&str]) -> Result<Self, FrameError>
Aggregate using one or more reduction functions.
Matches pd.Series.agg(["sum", "mean", "std"]). Returns a Series
whose index contains the function names and values contain the results.
Sourcepub fn aggregate(&self, funcs: &[&str]) -> Result<Self, FrameError>
pub fn aggregate(&self, funcs: &[&str]) -> Result<Self, FrameError>
pandas alias for Self::agg (pd.Series.aggregate(...)).
br-frankenpandas-f7c9o.
Sourcepub fn xs(&self, key: &IndexLabel) -> Result<Self, FrameError>
pub fn xs(&self, key: &IndexLabel) -> Result<Self, FrameError>
Select rows matching the given index key.
Matches s.xs(key). Returns all rows whose index matches key.
Sourcepub fn droplevel(&self) -> Result<Self, FrameError>
pub fn droplevel(&self) -> Result<Self, FrameError>
Return Series with dropped index level(s).
Matches s.droplevel(0) for single-level index.
Sourcepub fn unstack(&self) -> Result<DataFrame, FrameError>
pub fn unstack(&self) -> Result<DataFrame, FrameError>
Unstack a Series with string-composite index into a DataFrame.
Matches pd.Series.unstack(). Expects index labels in the format
“row_key, col_key” (comma-separated composite keys). The first part
becomes the row index, the second part becomes column names.
Sourcepub fn to_list(&self) -> Vec<Scalar>
pub fn to_list(&self) -> Vec<Scalar>
Convert Series to a vector of scalars.
Matches series.to_list().
Sourcepub fn to_numpy(&self) -> Vec<f64>
pub fn to_numpy(&self) -> Vec<f64>
Return the underlying values as a flat vector of f64 (numeric coercion).
Matches pd.Series.to_numpy(). Non-numeric values become NaN.
Sourcepub fn to_dict(&self) -> Vec<(IndexLabel, Scalar)>
pub fn to_dict(&self) -> Vec<(IndexLabel, Scalar)>
Convert Series to a vector of (label, scalar) pairs.
Matches series.to_dict().
Sourcepub fn to_csv(&self, sep: char, include_index: bool) -> String
pub fn to_csv(&self, sep: char, include_index: bool) -> String
Serialize the Series to a CSV string.
Matches pd.Series.to_csv().
Sourcepub fn to_csv_with_quoting(
&self,
sep: char,
include_index: bool,
na_rep: &str,
quoting: CsvQuoting,
) -> String
pub fn to_csv_with_quoting( &self, sep: char, include_index: bool, na_rep: &str, quoting: CsvQuoting, ) -> String
Serialize the Series to a CSV string with quoting control.
Matches pd.Series.to_csv(..., quoting=csv.QUOTE_*).
Sourcepub fn to_csv_with_header(
&self,
sep: char,
include_index: bool,
na_rep: &str,
quoting: CsvQuoting,
header: bool,
) -> String
pub fn to_csv_with_header( &self, sep: char, include_index: bool, na_rep: &str, quoting: CsvQuoting, header: bool, ) -> String
Serialize the Series to a CSV string with quoting and header control.
header: if true, write series name as first row; if false, omit header
Sourcepub fn to_csv_full(
&self,
sep: char,
include_index: bool,
na_rep: &str,
quoting: CsvQuoting,
header: bool,
escapechar: Option<char>,
) -> String
pub fn to_csv_full( &self, sep: char, include_index: bool, na_rep: &str, quoting: CsvQuoting, header: bool, escapechar: Option<char>, ) -> String
Serialize the Series to a CSV string with full control over all options.
escapechar: when using CsvQuoting::None, escape special characters with this
Sourcepub fn to_json(&self, orient: &str) -> Result<String, FrameError>
pub fn to_json(&self, orient: &str) -> Result<String, FrameError>
Serialize the Series to a JSON string.
Matches pd.Series.to_json(orient).
"split":{"name":"...","index":[...],"data":[...]}"records"/"values":[val1, val2, ...]"index":{"label1": val1, "label2": val2, ...}
Sourcepub fn to_string_repr_full(
&self,
include_index: bool,
) -> Result<String, FrameError>
pub fn to_string_repr_full( &self, include_index: bool, ) -> Result<String, FrameError>
Render the Series as a tabular string. Matches pd.Series.to_string().
Default (no truncation) form. The include_index parameter mirrors
the DataFrame counterpart and lets callers omit the index column.
Sourcepub fn to_markdown(
&self,
include_index: bool,
tablefmt: Option<&str>,
) -> Result<String, FrameError>
pub fn to_markdown( &self, include_index: bool, tablefmt: Option<&str>, ) -> Result<String, FrameError>
Render the Series as a Markdown table. Matches
pd.Series.to_markdown(tablefmt=None) (Phase A). include_index
mirrors the DataFrame counterpart; tablefmt is forwarded to the
DataFrame impl which currently supports the pandas defaults.
Sourcepub fn to_latex(&self, include_index: bool) -> Result<String, FrameError>
pub fn to_latex(&self, include_index: bool) -> Result<String, FrameError>
Render the Series as a LaTeX tabular block. Matches
pd.Series.to_latex() (Phase A — no escaping/styling options yet).
Sourcepub fn to_html(&self, include_index: bool) -> Result<String, FrameError>
pub fn to_html(&self, include_index: bool) -> Result<String, FrameError>
Render the Series as an HTML <table> block. Delegates to the
DataFrame counterpart with a single-column frame.
⚠️ pd.Series.to_html() does NOT exist (measured 2.2.3:
AttributeError); to_html is DataFrame-only. The pandas spelling is
s.to_frame().to_html() – which is exactly what this delegates to, so
the OUTPUT was never in question, only the cited name.
pub fn duplicated(&self) -> Result<Self, FrameError>
Sourcepub fn duplicated_keep(&self, keep: DuplicateKeep) -> Result<Self, FrameError>
pub fn duplicated_keep(&self, keep: DuplicateKeep) -> Result<Self, FrameError>
Mark duplicate values with control over which occurrence to keep.
Matches pd.Series.duplicated(keep=...).
First: mark all but the first occurrence as TrueLast: mark all but the last occurrence as TrueNone: mark all duplicated values as True
Sourcepub fn drop_duplicates(&self) -> Result<Self, FrameError>
pub fn drop_duplicates(&self) -> Result<Self, FrameError>
Remove duplicate values, keeping the first occurrence.
Matches pd.Series.drop_duplicates(keep='first').
Sourcepub fn drop_duplicates_keep(
&self,
keep: DuplicateKeep,
) -> Result<Self, FrameError>
pub fn drop_duplicates_keep( &self, keep: DuplicateKeep, ) -> Result<Self, FrameError>
Remove duplicate values with control over which occurrence to keep.
Matches pd.Series.drop_duplicates(keep=...).
First: keep the first occurrence of each valueLast: keep the last occurrence of each valueNone: drop all duplicated values entirely
Sourcepub fn compare_with(&self, other: &Self) -> Result<DataFrame, FrameError>
pub fn compare_with(&self, other: &Self) -> Result<DataFrame, FrameError>
Compare this Series with another, showing only differing values.
Matches pd.Series.compare(other). Returns a DataFrame with columns
“self” and “other” containing only the rows where the values differ.
Equal values are shown as NaN.
Sourcepub fn compare(&self, other: &Self) -> Result<DataFrame, FrameError>
pub fn compare(&self, other: &Self) -> Result<DataFrame, FrameError>
Pandas spelling alias for Self::compare_with.
Matches pd.Series.compare(other).
Sourcepub fn reindex_like(&self, other: &Self) -> Result<Self, FrameError>
pub fn reindex_like(&self, other: &Self) -> Result<Self, FrameError>
Reindex to match another Series’ index.
Matches pd.Series.reindex_like(other).
Sourcepub fn convert_dtypes(&self) -> Result<Self, FrameError>
pub fn convert_dtypes(&self) -> Result<Self, FrameError>
Convert dtypes to best-possible types.
Matches pd.Series.convert_dtypes(). For Utf8 Series, attempts to
parse all values as integers or floats. If all values can be parsed,
returns a numeric Series; otherwise returns the original.
Sourcepub fn infer_objects(&self) -> Result<Self, FrameError>
pub fn infer_objects(&self) -> Result<Self, FrameError>
Infer object dtypes to best-possible scalar dtypes.
Matches pd.Series.infer_objects() for the current Utf8-backed
object representation.
Sourcepub fn map_with_na_action(
&self,
mapping: &[(Scalar, Scalar)],
na_action_ignore: bool,
) -> Result<Self, FrameError>
pub fn map_with_na_action( &self, mapping: &[(Scalar, Scalar)], na_action_ignore: bool, ) -> Result<Self, FrameError>
Map values with optional NaN skipping.
Matches pd.Series.map(mapping, na_action='ignore'). When
na_action_ignore is true, NaN/Null values are passed through
without being looked up in the mapping.
Sourcepub fn case_when(&self, cases: &[(Self, Self)]) -> Result<Self, FrameError>
pub fn case_when(&self, cases: &[(Self, Self)]) -> Result<Self, FrameError>
Conditional value assignment.
Matches pd.Series.case_when(caselist). Each case is a pair of
(condition_series, value_series). Conditions are evaluated in order;
the first matching condition sets the value. Unmatched positions
retain the original value.
Sourcepub fn rename(&self, name: &str) -> Result<Self, FrameError>
pub fn rename(&self, name: &str) -> Result<Self, FrameError>
Rename the Series (return a copy with a new name).
Matches pd.Series.rename(name).
Sourcepub fn rename_axis(&self, name: &str) -> Result<Self, FrameError>
pub fn rename_axis(&self, name: &str) -> Result<Self, FrameError>
Rename the index axis (return a copy with a renamed index).
Matches pd.Series.rename_axis(mapper, axis='index'). Distinct from
Self::rename which renames the Series itself: rename_axis
renames the index AXIS (the label that appears above the index column
in Series.info() / Series.to_frame()). Per br-frankenpandas-17c2d
(skill /porting-to-rust).
Sourcepub fn set_axis(&self, labels: Vec<IndexLabel>) -> Result<Self, FrameError>
pub fn set_axis(&self, labels: Vec<IndexLabel>) -> Result<Self, FrameError>
Replace the index labels.
Matches pd.Series.set_axis(labels).
Sourcepub fn truncate(
&self,
before: Option<&IndexLabel>,
after: Option<&IndexLabel>,
) -> Result<Self, FrameError>
pub fn truncate( &self, before: Option<&IndexLabel>, after: Option<&IndexLabel>, ) -> Result<Self, FrameError>
Truncate the Series to rows between before and after labels (inclusive).
Matches pd.Series.truncate(before, after).
Sourcepub fn at_time(&self, time: &str) -> Result<Self, FrameError>
pub fn at_time(&self, time: &str) -> Result<Self, FrameError>
Select rows where the time component exactly matches the given time.
Matches s.at_time(time).
Sourcepub fn between_time(&self, start: &str, end: &str) -> Result<Self, FrameError>
pub fn between_time(&self, start: &str, end: &str) -> Result<Self, FrameError>
Select rows where the time component is between start and end.
Matches s.between_time(start_time, end_time).
Sourcepub fn first_offset(&self, offset: &str) -> Result<Self, FrameError>
pub fn first_offset(&self, offset: &str) -> Result<Self, FrameError>
Select initial rows from a DatetimeIndex up to an offset.
Matches pd.Series.first(offset).
Sourcepub fn last_offset(&self, offset: &str) -> Result<Self, FrameError>
pub fn last_offset(&self, offset: &str) -> Result<Self, FrameError>
Select final rows from a DatetimeIndex backward by an offset.
Matches pd.Series.last(offset).
Per br-frankenpandas-a79h9: the missing-last-label case is reported as a CompatibilityRejected error rather than a panic, so callers can recover from inconsistent series state instead of crashing.
Sourcepub fn combine<F>(&self, other: &Self, func: F) -> Result<Self, FrameError>
pub fn combine<F>(&self, other: &Self, func: F) -> Result<Self, FrameError>
Combine two Series element-wise using a function.
Matches pd.Series.combine(other, func). Aligns on the union of
index labels before applying the function element-wise.
The function receives two scalars (one from self, one from other)
and returns a scalar.
Sourcepub fn explode(&self, sep: &str) -> Result<Self, FrameError>
pub fn explode(&self, sep: &str) -> Result<Self, FrameError>
Explode a Series of string values by splitting on a separator.
Matches pd.Series.explode() for list-like string values.
Each string is split by sep and each piece becomes its own row.
The index label is repeated for each piece.
Sourcepub fn rolling(&self, window: usize, min_periods: Option<usize>) -> Rolling<'_>
pub fn rolling(&self, window: usize, min_periods: Option<usize>) -> Rolling<'_>
Create a rolling window view of this Series.
Matches series.rolling(window, min_periods=None).
Sourcepub fn rolling_offset(
&self,
window: &str,
min_periods: Option<usize>,
) -> Result<Rolling<'_>, FrameError>
pub fn rolling_offset( &self, window: &str, min_periods: Option<usize>, ) -> Result<Rolling<'_>, FrameError>
Create a time-based/offset rolling window view of this Series (issue #20).
Matches series.rolling("180D") over a datetime-like index: for each
row i the window is every row whose index timestamp lies in the
left-open right-closed interval (t_i - offset, t_i] — pandas’
default closed='right' for offset windows — and, matching pandas,
min_periods defaults to 1 (not the window size) for offset
windows. window accepts the timedelta strings
fp_types::Timedelta::parse understands ("180D", "12h",
"90min", ISO-8601 durations, …).
Errors (as CompatibilityRejected) when the offset string does not
parse or is not strictly positive, when the index is not entirely
datetime-like (Datetime64/Timedelta64, NaT rejected) — pandas
raises ValueError: window must be an integer 0 or greater — or when
the index is not monotonic non-decreasing (pandas:
ValueError: index values must be monotonic).
Sourcepub fn rolling_with_center(
&self,
window: usize,
min_periods: Option<usize>,
center: bool,
) -> Rolling<'_>
pub fn rolling_with_center( &self, window: usize, min_periods: Option<usize>, center: bool, ) -> Rolling<'_>
Create a rolling window with explicit center parameter.
Matches pd.Series.rolling(window, min_periods, center).
Sourcepub fn rolling_center(
&self,
window: usize,
min_periods: Option<usize>,
) -> Rolling<'_>
pub fn rolling_center( &self, window: usize, min_periods: Option<usize>, ) -> Rolling<'_>
Create a centered rolling window over this Series.
Matches pd.Series.rolling(window, center=True).
Sourcepub fn expanding(&self, min_periods: Option<usize>) -> Expanding<'_>
pub fn expanding(&self, min_periods: Option<usize>) -> Expanding<'_>
Create an expanding window view of this Series.
Matches series.expanding(min_periods=1).
Sourcepub fn ewm(&self, span: Option<f64>, alpha: Option<f64>) -> Ewm<'_>
pub fn ewm(&self, span: Option<f64>, alpha: Option<f64>) -> Ewm<'_>
Create an exponentially weighted moving window view of this Series.
Matches series.ewm(span=...) with pandas’ DEFAULT adjust=True and
min_periods=0. Either span or alpha must be provided.
- span: Specify decay in terms of span.
alpha = 2 / (span + 1). - alpha: Specify smoothing factor directly, 0 < alpha <= 1.
Sourcepub fn ewm_with_options(
&self,
span: Option<f64>,
alpha: Option<f64>,
adjust: bool,
min_periods: usize,
) -> Ewm<'_>
pub fn ewm_with_options( &self, span: Option<f64>, alpha: Option<f64>, adjust: bool, min_periods: usize, ) -> Ewm<'_>
Create an exponentially weighted moving window view with explicit
adjust and min_periods parameters.
Matches series.ewm(span=, alpha=, adjust=, min_periods=) (issue #19):
adjust=true(pandas default): the smoothed value is the normalized weighted averagesum_i (1-a)^i x_{t-i} / sum_i (1-a)^i.adjust=false: the recursive formy_0 = x_0; y_t = (1-a)*y_{t-1} + a*x_t(withignore_na=Falserenormalization across internal NaN gaps, exactly as pandas’_libs/window/aggregations.pyx::ewmkernel: new observations enter with weightalphaand the prior weight resets to 1 after every observation).min_periods=k: outputs are NaN until at leastmax(min_periods, 1)non-NaN observations have been seen — pandas’ExponentialMovingWindowclampsmin_periodsto at least 1.
Sourcepub fn resample(&self, freq: &str) -> Resample<'_>
pub fn resample(&self, freq: &str) -> Resample<'_>
Create a resampler view for time-based downsampling.
Matches series.resample(freq) where freq is one of:
- “Y” or “A”: yearly (bucket by YYYY)
- “M”: monthly (bucket by YYYY-MM)
- “D”: daily (bucket by YYYY-MM-DD)
The Series index must contain Utf8 datetime-like labels (ISO format).
pub fn resample_ext( &self, freq: &str, closed: Option<&str>, label: Option<&str>, origin: Option<&str>, ) -> Resample<'_>
Sourcepub fn autocorr(&self, lag: usize) -> Result<f64, FrameError>
pub fn autocorr(&self, lag: usize) -> Result<f64, FrameError>
Compute autocorrelation at the specified lag.
Matches series.autocorr(lag=1). Computes the Pearson correlation
between the Series and its lagged copy.
pub fn dot(&self, other: &Self) -> Result<f64, FrameError>
Sourcepub fn rank(
&self,
method: &str,
ascending: bool,
na_option: &str,
) -> Result<Self, FrameError>
pub fn rank( &self, method: &str, ascending: bool, na_option: &str, ) -> Result<Self, FrameError>
Rank values in the Series.
method: “average” (default), “min”, “max”, “first”, “dense”
ascending: rank direction (default true = smallest gets rank 1)
na_option: “keep” (NaN stays NaN), “top” (NaN gets lowest ranks), “bottom” (NaN gets highest ranks)
pub fn rank_with_pct( &self, method: &str, ascending: bool, na_option: &str, pct: bool, ) -> Result<Self, FrameError>
Sourcepub fn corr(&self, other: &Self) -> Result<f64, FrameError>
pub fn corr(&self, other: &Self) -> Result<f64, FrameError>
Compute the Pearson correlation with another Series.
Sourcepub fn cov_with(&self, other: &Self) -> Result<f64, FrameError>
pub fn cov_with(&self, other: &Self) -> Result<f64, FrameError>
Compute the sample covariance with another Series.
Sourcepub fn cov(&self, other: &Self) -> Result<f64, FrameError>
pub fn cov(&self, other: &Self) -> Result<f64, FrameError>
Pandas spelling alias for Self::cov_with.
Matches pd.Series.cov(other).
Sourcepub fn cov_with_options(
&self,
other: &Self,
min_periods: Option<usize>,
ddof: usize,
) -> Result<f64, FrameError>
pub fn cov_with_options( &self, other: &Self, min_periods: Option<usize>, ddof: usize, ) -> Result<f64, FrameError>
Compute covariance with explicit min_periods + ddof, matching
pd.Series.cov(other, min_periods=, ddof=).
Per br-frankenpandas-9ac700:
min_periods: minimum count of valid (both non-null) pairs; below this, returns NaN.ddof: delta degrees of freedom; divisor iscount - ddof. Defaults map:ddof=0population,ddof=1sample (pandas default).
Sourcepub fn corr_spearman(&self, other: &Self) -> Result<f64, FrameError>
pub fn corr_spearman(&self, other: &Self) -> Result<f64, FrameError>
Compute the Spearman rank correlation with another Series.
Ranks both Series and then computes Pearson correlation on the ranks.
Sourcepub fn corr_kendall(&self, other: &Self) -> Result<f64, FrameError>
pub fn corr_kendall(&self, other: &Self) -> Result<f64, FrameError>
Compute the Kendall tau-b correlation with another Series.
Sourcepub fn groupby<'a>(
&'a self,
by: &'a Series,
) -> Result<SeriesGroupBy<'a>, FrameError>
pub fn groupby<'a>( &'a self, by: &'a Series, ) -> Result<SeriesGroupBy<'a>, FrameError>
Group the Series by another Series of the same length.
Matches pd.Series.groupby(by). Returns a SeriesGroupBy which
supports aggregation methods (sum, mean, count, min, max, etc.).
Sourcepub fn str(&self) -> StringAccessor<'_>
pub fn str(&self) -> StringAccessor<'_>
Access string methods on a Utf8 Series (analogous to pandas.Series.str).
Sourcepub fn dt(&self) -> DatetimeAccessor<'_>
pub fn dt(&self) -> DatetimeAccessor<'_>
Access datetime components of this Series.
Matches pd.Series.dt. Extracts components from ISO 8601
formatted string values.
Sourcepub fn cat(&self) -> Option<CategoricalAccessor<'_>>
pub fn cat(&self) -> Option<CategoricalAccessor<'_>>
Access categorical methods on this Series.
Matches pd.Series.cat. Returns None if the Series is not categorical.
Sourcepub fn sparse(&self) -> Option<SparseAccessor<'_>>
pub fn sparse(&self) -> Option<SparseAccessor<'_>>
Access sparse methods on this Series.
Matches the pd.Series.sparse namespace for dense-backed sparse
descriptors. Returns None if the Series is not sparse.
Sourcepub fn list(&self) -> ListAccessor<'_>
pub fn list(&self) -> ListAccessor<'_>
Access list-array methods on this Series.
Matches the pandas Series.list namespace shape. Until fp-types grows
a first-class list scalar, FrankenPandas supports a concrete
JSON-array-backed slice for UTF-8 object values plus missing values.
Sourcepub fn struct(&self) -> StructAccessor<'_>
pub fn struct(&self) -> StructAccessor<'_>
Access struct-array methods on this Series.
Matches the pandas Series.struct namespace shape. Until fp-types
grows a first-class struct scalar, FrankenPandas supports a concrete
JSON-object-backed slice for UTF-8 object values plus missing values.
Rust callers use raw identifier syntax: series.r#struct().
Sourcepub fn is_categorical(&self) -> bool
pub fn is_categorical(&self) -> bool
Returns true if this Series has categorical metadata.
Sourcepub fn from_categorical(
name: impl Into<String>,
values: Vec<Scalar>,
ordered: bool,
) -> Result<Self, FrameError>
pub fn from_categorical( name: impl Into<String>, values: Vec<Scalar>, ordered: bool, ) -> Result<Self, FrameError>
Create a categorical Series from values.
Matches pd.Categorical(values). Infers categories from unique values.
Stores integer codes as the column data.
Sourcepub fn from_categorical_codes(
name: impl Into<String>,
codes: Vec<i64>,
categories: Vec<Scalar>,
ordered: bool,
) -> Result<Self, FrameError>
pub fn from_categorical_codes( name: impl Into<String>, codes: Vec<i64>, categories: Vec<Scalar>, ordered: bool, ) -> Result<Self, FrameError>
Create a categorical Series from explicit codes and categories.
Matches pd.Categorical.from_codes(codes, categories).
Sourcepub fn from_sparse_dense(
name: impl Into<String>,
index_labels: Vec<IndexLabel>,
values: Vec<Scalar>,
value_dtype: DType,
fill_value: Scalar,
) -> Result<Self, FrameError>
pub fn from_sparse_dense( name: impl Into<String>, index_labels: Vec<IndexLabel>, values: Vec<Scalar>, value_dtype: DType, fill_value: Scalar, ) -> Result<Self, FrameError>
Create a sparse Series from dense values.
Matches the pandas SparseDtype(value_dtype, fill_value) contract for
the Series-level dtype/accessor surface. The current storage remains
dense; compressed sparse storage is tracked separately in fp-columnar.
Sourcepub fn apply_fn<F>(&self, func: F) -> Result<Self, FrameError>
pub fn apply_fn<F>(&self, func: F) -> Result<Self, FrameError>
Apply a closure element-wise to produce a new Series.
Sourcepub fn apply_fn_na<F>(&self, func: F) -> Result<Self, FrameError>
pub fn apply_fn_na<F>(&self, func: F) -> Result<Self, FrameError>
Apply a function with na_action='ignore'.
Matches series.apply(func, na_action='ignore'). Skips NaN/null values,
preserving them in the output unchanged.
Sourcepub fn map_fn<F>(&self, func: F) -> Result<Self, FrameError>
pub fn map_fn<F>(&self, func: F) -> Result<Self, FrameError>
Map values using a failable closure.
Like apply_fn but the closure returns Result<Scalar, FrameError>,
enabling transformations that may fail (type conversion, parsing, etc.).
Matches the general pattern of pandas Series.map(func).
pub fn map_dict( &self, mapping: &BTreeMap<Scalar, Scalar>, ) -> Result<Self, FrameError>
Sourcepub fn map_values(
&self,
mapping: &HashMap<String, Scalar>,
) -> Result<Self, FrameError>
pub fn map_values( &self, mapping: &HashMap<String, Scalar>, ) -> Result<Self, FrameError>
Map values using a dictionary (HashMap).
Values not found in the map become NaN (like pandas Series.map(dict)).