Skip to main content

Series

Struct Series 

Source
pub struct Series { /* private fields */ }

Implementations§

Source§

impl Series

Source

pub fn new( name: impl Into<LabelName>, index: Index, column: Column, ) -> Result<Self, FrameError>

Source

pub fn from_values( name: impl Into<LabelName>, index_labels: Vec<IndexLabel>, values: Vec<Scalar>, ) -> Result<Self, FrameError>

Source

pub fn from_pairs( name: impl Into<LabelName>, 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}).

Source

pub fn from_dict( name: impl Into<LabelName>, data: BTreeMap<IndexLabel, Scalar>, ) -> Result<Self, FrameError>

Construct a Series from a dict (BTreeMap) of label → value.

Matches pd.Series({"a": 1, "b": 2}).

Source

pub fn arange( name: impl Into<LabelName>, 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).

Source

pub fn linspace( name: impl Into<LabelName>, 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).

Source

pub fn logspace( name: impl Into<LabelName>, 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).

Source

pub fn geomspace( name: impl Into<LabelName>, 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).

Source

pub fn zeros(name: impl Into<LabelName>, n: usize) -> Result<Self, FrameError>

Create a Series filled with zeros (Float64 by default).

Matches np.zeros(n).

Source

pub fn zeros_dtype( name: impl Into<LabelName>, n: usize, dtype: DType, ) -> Result<Self, FrameError>

Create a Series filled with zeros of specified dtype.

Matches np.zeros(n, dtype=dtype).

Source

pub fn ones(name: impl Into<LabelName>, n: usize) -> Result<Self, FrameError>

Create a Series filled with ones (Float64 by default).

Matches np.ones(n).

Source

pub fn ones_dtype( name: impl Into<LabelName>, n: usize, dtype: DType, ) -> Result<Self, FrameError>

Create a Series filled with ones of specified dtype.

Matches np.ones(n, dtype=dtype).

Source

pub fn full( name: impl Into<LabelName>, n: usize, fill_value: Scalar, ) -> Result<Self, FrameError>

Create a Series filled with a constant value.

Matches np.full(n, fill_value).

Source

pub fn hanning(name: impl Into<LabelName>, m: usize) -> Result<Self, FrameError>

Generate a Hann (Hanning) window Series.

Matches np.hanning(M).

Source

pub fn hamming(name: impl Into<LabelName>, m: usize) -> Result<Self, FrameError>

Generate a Hamming window Series.

Matches np.hamming(M).

Source

pub fn blackman( name: impl Into<LabelName>, m: usize, ) -> Result<Self, FrameError>

Generate a Blackman window Series.

Matches np.blackman(M).

Source

pub fn bartlett( name: impl Into<LabelName>, m: usize, ) -> Result<Self, FrameError>

Generate a Bartlett (triangular) window Series.

Matches np.bartlett(M).

Source

pub fn plot(&self) -> Result<PlotSpec, FrameError>

Return a backend-neutral pandas-style plotting request.

Source

pub fn plot_to_svg(&self) -> Result<String, FrameError>

Convenience helper: render series plot directly to deterministic SVG string.

Source

pub fn plot_to_html(&self) -> Result<String, FrameError>

Convenience helper: render series plot directly to HTML figure snippet.

Source

pub fn plot_to_file<P: AsRef<Path>>(&self, path: P) -> Result<(), FrameError>

Convenience helper: save rendered series plot directly to disk.

Source

pub fn bar(&self) -> Result<PlotSpec, FrameError>

Return a backend-neutral pandas-style bar plot request.

Source

pub fn area(&self) -> Result<PlotSpec, FrameError>

Return a backend-neutral pandas-style area plot request.

Source

pub fn scatter(&self) -> Result<PlotSpec, FrameError>

Return a backend-neutral pandas-style scatter plot request.

Source

pub fn pie(&self) -> Result<PlotSpec, FrameError>

Return a backend-neutral pandas-style pie plot request.

Source

pub fn hist(&self) -> Result<HistogramSpec, FrameError>

Return a backend-neutral pandas-style histogram request.

Source

pub fn hist_to_svg(&self) -> Result<String, FrameError>

Convenience helper: render series histogram directly to deterministic SVG string.

Source

pub fn hist_to_html(&self) -> Result<String, FrameError>

Convenience helper: render series histogram directly to HTML figure snippet.

Source

pub fn hist_to_file<P: AsRef<Path>>(&self, path: P) -> Result<(), FrameError>

Convenience helper: save rendered series histogram directly to disk.

Source

pub fn hist_with_bins(&self, bins: usize) -> Result<HistogramSpec, FrameError>

Return a backend-neutral histogram request with a custom number of bins.

Source

pub fn hist_with_bins_to_svg(&self, bins: usize) -> Result<String, FrameError>

Convenience helper: render series histogram with custom bins directly to deterministic SVG string.

Source

pub fn hist_with_bins_to_html(&self, bins: usize) -> Result<String, FrameError>

Convenience helper: render series histogram with custom bins directly to HTML figure snippet.

Source

pub fn hist_with_bins_to_file<P: AsRef<Path>>( &self, bins: usize, path: P, ) -> Result<(), FrameError>

Convenience helper: save rendered series histogram with custom bins directly to disk.

Source

pub fn hist_by( &self, by: &Series, bins: usize, ) -> Result<HistogramSpec, FrameError>

Return a backend-neutral histogram request grouping values by another Series (pandas Series.hist(by=...)).

Source

pub fn hist_by_to_svg( &self, by: &Series, bins: usize, ) -> Result<String, FrameError>

Convenience helper: render grouped series histogram directly to deterministic SVG string.

Source

pub fn hist_by_to_html( &self, by: &Series, bins: usize, ) -> Result<String, FrameError>

Convenience helper: render grouped series histogram directly to HTML figure snippet.

Source

pub fn hist_by_to_file<P: AsRef<Path>>( &self, by: &Series, bins: usize, path: P, ) -> Result<(), FrameError>

Convenience helper: save rendered grouped series histogram directly to disk.

Source

pub fn boxplot(&self) -> Result<BoxPlotSpec, FrameError>

Return a backend-neutral pandas-style boxplot request.

Source

pub fn box_plot(&self) -> Result<BoxPlotSpec, FrameError>

Return a backend-neutral pandas-style boxplot request (alias for Series::boxplot).

Source

pub fn box(&self) -> Result<BoxPlotSpec, FrameError>

Return a backend-neutral pandas-style boxplot request (alias for Series::boxplot).

Source

pub fn boxplot_to_svg(&self) -> Result<String, FrameError>

Convenience helper: render series boxplot directly to deterministic SVG string.

Source

pub fn boxplot_to_html(&self) -> Result<String, FrameError>

Convenience helper: render series boxplot directly to HTML figure snippet.

Source

pub fn boxplot_to_file<P: AsRef<Path>>(&self, path: P) -> Result<(), FrameError>

Convenience helper: save rendered series boxplot directly to disk.

Source

pub fn boxplot_by(&self, by: &Series) -> Result<BoxPlotSpec, FrameError>

Return a backend-neutral boxplot request grouping values by another Series (pandas Series.boxplot(by=...)).

Source

pub fn boxplot_by_to_svg(&self, by: &Series) -> Result<String, FrameError>

Convenience helper: render grouped series boxplot directly to deterministic SVG string.

Source

pub fn boxplot_by_to_html(&self, by: &Series) -> Result<String, FrameError>

Convenience helper: render grouped series boxplot directly to HTML figure snippet.

Source

pub fn boxplot_by_to_file<P: AsRef<Path>>( &self, by: &Series, path: P, ) -> Result<(), FrameError>

Convenience helper: save rendered grouped series boxplot directly to disk.

Source

pub fn lag_plot(&self, lag: usize) -> Result<PlotSpec, FrameError>

Return a backend-neutral lag plot request plotting y(t) against y(t+lag) (pandas pandas.plotting.lag_plot(series, lag=...)).

Source

pub fn lag_plot_to_svg(&self, lag: usize) -> Result<String, FrameError>

Convenience helper: render series lag plot directly to deterministic SVG string.

Source

pub fn lag_plot_to_html(&self, lag: usize) -> Result<String, FrameError>

Convenience helper: render series lag plot directly to HTML figure snippet.

Source

pub fn lag_plot_to_file<P: AsRef<Path>>( &self, lag: usize, path: P, ) -> Result<(), FrameError>

Convenience helper: save rendered series lag plot directly to disk.

Source

pub fn autocorrelation_plot(&self) -> Result<PlotSpec, FrameError>

Return a backend-neutral autocorrelation plot request computing autocorrelation across all integer lags (pandas pandas.plotting.autocorrelation_plot(series)).

Source

pub fn autocorrelation_plot_to_svg(&self) -> Result<String, FrameError>

Convenience helper: render series autocorrelation plot directly to deterministic SVG string.

Source

pub fn autocorrelation_plot_to_html(&self) -> Result<String, FrameError>

Convenience helper: render series autocorrelation plot directly to HTML figure snippet.

Source

pub fn autocorrelation_plot_to_file<P: AsRef<Path>>( &self, path: P, ) -> Result<(), FrameError>

Convenience helper: save rendered series autocorrelation plot directly to disk.

Source

pub fn bootstrap_plot( &self, size: usize, samples: usize, ) -> Result<HistogramSpec, FrameError>

Return a backend-neutral bootstrap plot request assessing statistical uncertainty via resampling (pandas pandas.plotting.bootstrap_plot(series, size=..., samples=...)).

Source

pub fn bootstrap_plot_to_svg( &self, size: usize, samples: usize, ) -> Result<String, FrameError>

Convenience helper: render series bootstrap plot directly to deterministic SVG string.

Source

pub fn bootstrap_plot_to_html( &self, size: usize, samples: usize, ) -> Result<String, FrameError>

Convenience helper: render series bootstrap plot directly to HTML figure snippet.

Source

pub fn bootstrap_plot_to_file<P: AsRef<Path>>( &self, size: usize, samples: usize, path: P, ) -> Result<(), FrameError>

Convenience helper: save rendered series bootstrap plot directly to disk.

Source

pub fn table(&self) -> Result<TablePlotSpec, FrameError>

Return a backend-neutral table plot request (pandas pandas.plotting.table(ax, series, ...)).

Source

pub fn table_with_labels( &self, row_labels: Option<&[&str]>, col_labels: Option<&[&str]>, ) -> Result<TablePlotSpec, FrameError>

Return a backend-neutral table plot request with optional custom row and column labels.

Source

pub fn table_to_svg( &self, row_labels: Option<&[&str]>, col_labels: Option<&[&str]>, ) -> Result<String, FrameError>

Convenience helper: render Series table directly to deterministic SVG string.

Source

pub fn table_to_html( &self, row_labels: Option<&[&str]>, col_labels: Option<&[&str]>, ) -> Result<String, FrameError>

Convenience helper: render Series table directly to HTML figure snippet.

Source

pub fn table_to_file<P: AsRef<Path>>( &self, path: P, row_labels: Option<&[&str]>, col_labels: Option<&[&str]>, ) -> Result<(), FrameError>

Convenience helper: save rendered Series table directly to disk.

Source

pub fn line(&self) -> Result<PlotSpec, FrameError>

Return a backend-neutral pandas-style line plot request.

Source

pub fn line_to_svg(&self) -> Result<String, FrameError>

Convenience helper: render series line plot directly to deterministic SVG string.

Source

pub fn line_to_html(&self) -> Result<String, FrameError>

Convenience helper: render series line plot directly to HTML figure snippet.

Source

pub fn line_to_file<P: AsRef<Path>>(&self, path: P) -> Result<(), FrameError>

Convenience helper: save rendered series line plot directly to disk.

Source

pub fn bar_to_svg(&self) -> Result<String, FrameError>

Convenience helper: render series bar plot directly to deterministic SVG string.

Source

pub fn bar_to_html(&self) -> Result<String, FrameError>

Convenience helper: render series bar plot directly to HTML figure snippet.

Source

pub fn bar_to_file<P: AsRef<Path>>(&self, path: P) -> Result<(), FrameError>

Convenience helper: save rendered series bar plot directly to disk.

Source

pub fn barh(&self) -> Result<PlotSpec, FrameError>

Return a backend-neutral pandas-style horizontal bar plot request.

Source

pub fn barh_to_svg(&self) -> Result<String, FrameError>

Convenience helper: render series horizontal bar plot directly to deterministic SVG string.

Source

pub fn barh_to_html(&self) -> Result<String, FrameError>

Convenience helper: render series horizontal bar plot directly to HTML figure snippet.

Source

pub fn barh_to_file<P: AsRef<Path>>(&self, path: P) -> Result<(), FrameError>

Convenience helper: save rendered series horizontal bar plot directly to disk.

Source

pub fn area_to_svg(&self) -> Result<String, FrameError>

Convenience helper: render series area plot directly to deterministic SVG string.

Source

pub fn area_to_html(&self) -> Result<String, FrameError>

Convenience helper: render series area plot directly to HTML figure snippet.

Source

pub fn area_to_file<P: AsRef<Path>>(&self, path: P) -> Result<(), FrameError>

Convenience helper: save rendered series area plot directly to disk.

Source

pub fn scatter_to_svg(&self) -> Result<String, FrameError>

Convenience helper: render series scatter plot directly to deterministic SVG string.

Source

pub fn scatter_to_html(&self) -> Result<String, FrameError>

Convenience helper: render series scatter plot directly to HTML figure snippet.

Source

pub fn scatter_to_file<P: AsRef<Path>>(&self, path: P) -> Result<(), FrameError>

Convenience helper: save rendered series scatter plot directly to disk.

Source

pub fn pie_to_svg(&self) -> Result<String, FrameError>

Convenience helper: render series pie plot directly to deterministic SVG string.

Source

pub fn pie_to_html(&self) -> Result<String, FrameError>

Convenience helper: render series pie plot directly to HTML figure snippet.

Source

pub fn pie_to_file<P: AsRef<Path>>(&self, path: P) -> Result<(), FrameError>

Convenience helper: save rendered series pie plot directly to disk.

Source

pub fn kde(&self) -> Result<PlotSpec, FrameError>

Return a backend-neutral pandas-style kernel density estimation plot request.

Source

pub fn kde_to_svg(&self) -> Result<String, FrameError>

Convenience helper: render series KDE plot directly to deterministic SVG string.

Source

pub fn kde_to_html(&self) -> Result<String, FrameError>

Convenience helper: render series KDE plot directly to HTML figure snippet.

Source

pub fn kde_to_file<P: AsRef<Path>>(&self, path: P) -> Result<(), FrameError>

Convenience helper: save rendered series KDE plot directly to disk.

Source

pub fn density(&self) -> Result<PlotSpec, FrameError>

Return a backend-neutral pandas-style density plot request (alias for Series::kde).

Source

pub fn density_to_svg(&self) -> Result<String, FrameError>

Convenience helper: render series density plot directly to deterministic SVG string.

Source

pub fn density_to_html(&self) -> Result<String, FrameError>

Convenience helper: render series density plot directly to HTML figure snippet.

Source

pub fn density_to_file<P: AsRef<Path>>(&self, path: P) -> Result<(), FrameError>

Convenience helper: save rendered series density plot directly to disk.

Source

pub fn hexbin(&self) -> Result<PlotSpec, FrameError>

Return a backend-neutral pandas-style hexbin plot request.

Source

pub fn hexbin_to_svg(&self) -> Result<String, FrameError>

Convenience helper: render series hexbin plot directly to deterministic SVG string.

Source

pub fn hexbin_to_html(&self) -> Result<String, FrameError>

Convenience helper: render series hexbin plot directly to HTML figure snippet.

Source

pub fn hexbin_to_file<P: AsRef<Path>>(&self, path: P) -> Result<(), FrameError>

Convenience helper: save rendered series hexbin plot directly to disk.

Source

pub fn plot_with_kind(&self, kind: PlotKind) -> Result<PlotSpec, FrameError>

Return a backend-neutral plot request for the specified plot kind.

Source

pub fn to_string_repr(&self) -> String

Pretty-print the Series as a string table.

Matches str(series) / series.to_string() in pandas.

Source

pub fn broadcast( name: impl Into<LabelName>, 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]).

Source

pub fn name(&self) -> &LabelName

The name: text, plus the typed label when it is not a string (see LabelName).

Source

pub fn index(&self) -> &Index

Source

pub fn with_range_span(self, span: Option<(i64, i64, i64)>) -> Self

This Series with its labels marked as the pandas RangeIndex span (or unmarked), the labels unchanged; see Index::range_span.

Source

pub fn column(&self) -> &Column

Source

pub fn values(&self) -> &[Scalar]

Source

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.

Source

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.

Source

pub fn ravel(&self) -> Vec<Scalar>

Flatten Series values to a one-dimensional scalar vector.

Matches pd.Series.ravel() for this already-1D representation.

Source

pub fn tolist(&self) -> Vec<Scalar>

Pandas spelling alias for Self::to_list.

Matches pd.Series.tolist().

Source

pub fn view(&self) -> Self

Return a shallow clone view.

Matches pd.Series.view() for this immutable Rust representation.

Source

pub fn transpose(&self) -> Self

Series transpose is identity.

Matches pd.Series.transpose().

Source

pub fn t(&self) -> Self

Lowercase alias for Self::transpose.

Source

pub fn T(&self) -> Self

Uppercase pandas spelling for Self::transpose.

Rust style prefers Self::t, but pandas exposes series.T.

Source

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.

Source

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.

Source

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.

Source

pub fn dtype(&self) -> DType

Return the dtype of this Series.

Matches pd.Series.dtype.

Source

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.

Source

pub fn dtypes(&self) -> DType

Plural pandas alias for Self::dtype.

Matches pd.Series.dtypes.

Source

pub fn copy(&self) -> Self

Return a deep copy of this Series.

Matches pd.Series.copy(deep=True).

Source

pub fn keys(&self) -> Index

Return the Series index.

Matches pd.Series.keys(). This is an alias for the index.

Source

pub fn add_with_policy( &self, other: &Self, policy: &RuntimePolicy, ledger: &mut EvidenceLedger, ) -> Result<Self, FrameError>

Source

pub fn add(&self, other: &Self) -> Result<Self, FrameError>

Source

pub fn sub_with_policy( &self, other: &Self, policy: &RuntimePolicy, ledger: &mut EvidenceLedger, ) -> Result<Self, FrameError>

Source

pub fn sub(&self, other: &Self) -> Result<Self, FrameError>

Source

pub fn mul_with_policy( &self, other: &Self, policy: &RuntimePolicy, ledger: &mut EvidenceLedger, ) -> Result<Self, FrameError>

Source

pub fn mul(&self, other: &Self) -> Result<Self, FrameError>

Source

pub fn div_with_policy( &self, other: &Self, policy: &RuntimePolicy, ledger: &mut EvidenceLedger, ) -> Result<Self, FrameError>

Source

pub fn div(&self, other: &Self) -> Result<Self, FrameError>

Source

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).

Source

pub fn sub_fill( &self, other: &Self, fill_value: f64, ) -> Result<Self, FrameError>

Subtract with fill_value for NaN handling.

Source

pub fn mul_fill( &self, other: &Self, fill_value: f64, ) -> Result<Self, FrameError>

Multiply with fill_value for NaN handling.

Source

pub fn div_fill( &self, other: &Self, fill_value: f64, ) -> Result<Self, FrameError>

Divide with fill_value for NaN handling.

Source

pub fn modulo(&self, other: &Self) -> Result<Self, FrameError>

Modulo operation (element-wise remainder).

Matches s1.mod(s2) / s1 % s2 in pandas.

Source

pub fn modulo_with_policy( &self, other: &Self, policy: &RuntimePolicy, ledger: &mut EvidenceLedger, ) -> Result<Self, FrameError>

Source

pub fn floordiv(&self, other: &Self) -> Result<Self, FrameError>

Floor-division operation (element-wise).

Matches s1.floordiv(s2) / s1 // s2 in pandas.

Source

pub fn floordiv_with_policy( &self, other: &Self, policy: &RuntimePolicy, ledger: &mut EvidenceLedger, ) -> Result<Self, FrameError>

Source

pub fn pow(&self, other: &Self) -> Result<Self, FrameError>

Power operation (element-wise exponentiation).

Matches s1.pow(s2) / s1 ** s2 in pandas.

Source

pub fn pow_with_policy( &self, other: &Self, policy: &RuntimePolicy, ledger: &mut EvidenceLedger, ) -> Result<Self, FrameError>

Source

pub fn subtract(&self, other: &Self) -> Result<Self, FrameError>

pandas alias for Self::sub. Matches pd.Series.subtract.

Source

pub fn multiply(&self, other: &Self) -> Result<Self, FrameError>

pandas alias for Self::mul. Matches pd.Series.multiply.

Source

pub fn divide(&self, other: &Self) -> Result<Self, FrameError>

pandas alias for Self::div. Matches pd.Series.divide.

Source

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).

Source

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.

Source

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).

Source

pub fn rsub(&self, other: &Self) -> Result<Self, FrameError>

Right-handed subtraction: s1.rsub(s2) ≡ s2.sub(s1). Matches pd.Series.rsub(other).

Source

pub fn rmul(&self, other: &Self) -> Result<Self, FrameError>

Right-handed multiplication: s1.rmul(s2) ≡ s2.mul(s1). Matches pd.Series.rmul(other).

Source

pub fn rdiv(&self, other: &Self) -> Result<Self, FrameError>

Right-handed division: s1.rdiv(s2) ≡ s2.div(s1). Matches pd.Series.rdiv(other).

Source

pub fn rtruediv(&self, other: &Self) -> Result<Self, FrameError>

Right-handed true division: s1.rtruediv(s2) ≡ s2.div(s1). Matches pd.Series.rtruediv(other).

Source

pub fn rfloordiv(&self, other: &Self) -> Result<Self, FrameError>

Right-handed floor division: s1.rfloordiv(s2) ≡ s2.floordiv(s1). Matches pd.Series.rfloordiv(other).

Source

pub fn rmod(&self, other: &Self) -> Result<Self, FrameError>

Right-handed modulo: s1.rmod(s2) ≡ s2.modulo(s1). Matches pd.Series.rmod(other).

Source

pub fn rpow(&self, other: &Self) -> Result<Self, FrameError>

Right-handed exponentiation: s1.rpow(s2) ≡ s2.pow(s1). Matches pd.Series.rpow(other).

Source

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.

Source

pub fn rdivmod(&self, other: &Self) -> Result<(Self, Self), FrameError>

Reversed element-wise divmod: returns (other // self, other % self).

Matches pd.Series.rdivmod(other).

Source

pub fn td_add(&self, other: &Self) -> Result<Self, FrameError>

Add two Timedelta64 Series element-wise.

Matches td1 + td2 in pandas for timedelta Series.

Source

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.

Source

pub fn td_sub(&self, other: &Self) -> Result<Self, FrameError>

Subtract Timedelta64 Series element-wise.

Matches td1 - td2 in pandas for timedelta Series.

Source

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.

Source

pub fn td_mul_scalar(&self, scalar: f64) -> Result<Self, FrameError>

Multiply Timedelta64 Series by a numeric scalar.

Matches td * scalar in pandas.

Source

pub fn td_div_scalar(&self, scalar: f64) -> Result<Self, FrameError>

Divide Timedelta64 Series by a numeric scalar.

Matches td / scalar in pandas.

Source

pub fn td_floordiv_scalar(&self, scalar: i64) -> Result<Self, FrameError>

Floor-divide Timedelta64 Series by a numeric scalar.

Matches td // scalar in pandas.

Source

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).

Source

pub fn td_mod(&self, other: &Self) -> Result<Self, FrameError>

Modulo of Timedelta64 Series by another Timedelta64.

Matches td1 % td2 in pandas.

Source

pub fn td_neg(&self) -> Result<Self, FrameError>

Negate Timedelta64 Series (unary minus).

Matches -td in pandas.

Source

pub fn td_abs(&self) -> Result<Self, FrameError>

Absolute value of Timedelta64 Series.

Matches td.abs() or abs(td) in pandas.

Source

pub fn td_lt(&self, other: &Self) -> Result<Self, FrameError>

Compare Timedelta64 Series: less than.

Source

pub fn td_le(&self, other: &Self) -> Result<Self, FrameError>

Compare Timedelta64 Series: less than or equal.

Source

pub fn td_gt(&self, other: &Self) -> Result<Self, FrameError>

Compare Timedelta64 Series: greater than.

Source

pub fn td_ge(&self, other: &Self) -> Result<Self, FrameError>

Compare Timedelta64 Series: greater than or equal.

Source

pub fn td_eq(&self, other: &Self) -> Result<Self, FrameError>

Compare Timedelta64 Series: equality.

Source

pub fn td_ne(&self, other: &Self) -> Result<Self, FrameError>

Compare Timedelta64 Series: inequality.

Source

pub fn len(&self) -> usize

Return the number of elements in this Series.

Source

pub fn is_empty(&self) -> bool

Return true if this Series has zero elements.

Source

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.

Source

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.

Source

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.

Source

pub fn first_valid_index(&self) -> Option<IndexLabel>

Return the index label of the first non-null value.

Matches pd.Series.first_valid_index().

Source

pub fn last_valid_index(&self) -> Option<IndexLabel>

Return the index label of the last non-null value.

Matches pd.Series.last_valid_index().

Source

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).

Source

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).

Source

pub fn reindex_to_index(&self, target: &Index) -> Result<Self, FrameError>

Self::reindex to the labels of target, kept as they are (a range, an int64 buffer): over int labels on both sides the positions come without a label made (see reindex_positions_typed; br-frankenpandas-mcq15). The result’s index is target under this Series’ index name.

Source

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'|'nearest').

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.

Source

pub fn reindex_with_method_options( &self, new_labels: Vec<IndexLabel>, method: &str, limit: Option<usize>, tolerance: Option<&[f64]>, ) -> Result<Self, FrameError>

Self::reindex_with_method with pandas’ limit and tolerance (one per new label, in the labels’ units: nanoseconds for datetimes; see method_reindex_positions).

Source

pub fn gt(&self, other: &Self) -> Result<Self, FrameError>

Element-wise greater-than. Matches series > other.

Source

pub fn lt(&self, other: &Self) -> Result<Self, FrameError>

Element-wise less-than. Matches series < other.

Source

pub fn eq_series(&self, other: &Self) -> Result<Self, FrameError>

Element-wise equality. Matches series == other.

Source

pub fn eq(&self, other: &Self) -> Result<Self, FrameError>

pandas method alias for element-wise equality.

Matches pd.Series.eq(other).

Source

pub fn ne_series(&self, other: &Self) -> Result<Self, FrameError>

Element-wise not-equal. Matches series != other.

Source

pub fn ne(&self, other: &Self) -> Result<Self, FrameError>

pandas method alias for element-wise inequality.

Matches pd.Series.ne(other).

Source

pub fn ge(&self, other: &Self) -> Result<Self, FrameError>

Element-wise greater-or-equal. Matches series >= other.

Source

pub fn le(&self, other: &Self) -> Result<Self, FrameError>

Element-wise less-or-equal. Matches series <= other.

Source

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).

Source

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).

Source

pub fn eq_scalar(&self, scalar: &Scalar) -> Result<Self, FrameError>

Element-wise == scalar.

Source

pub fn ne_scalar(&self, scalar: &Scalar) -> Result<Self, FrameError>

Element-wise != scalar.

Source

pub fn gt_scalar(&self, scalar: &Scalar) -> Result<Self, FrameError>

Element-wise > scalar.

Source

pub fn ge_scalar(&self, scalar: &Scalar) -> Result<Self, FrameError>

Element-wise >= scalar.

Source

pub fn lt_scalar(&self, scalar: &Scalar) -> Result<Self, FrameError>

Element-wise < scalar.

Source

pub fn le_scalar(&self, scalar: &Scalar) -> Result<Self, FrameError>

Element-wise <= scalar.

Source

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).

Source

pub fn assert_equals( &self, other: &Self, options: &AssertEqualOptions, ) -> Result<(), AssertionError>

Assert that this Series is equal to another according to the specified options (matching pandas.testing.assert_series_equal).

§Errors

Returns testing::AssertionError if the Series are not equal according to the options.

Source

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 == false
  • true & true == true
  • true & null == null, null & null == null
Source

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 == true
  • false | false == false
  • false | null == null, null | null == null
Source

pub fn not(&self) -> Result<Self, FrameError>

Element-wise boolean NOT.

Missing values remain missing.

Source

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)

Source

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.

Source

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.

Source

pub fn iloc_step( &self, start: usize, step: isize, len: usize, ) -> Result<Self, FrameError>

len rows from start, step apart (step negative for a backwards slice): s.iloc[start::step] as Python’s slice.indices resolves it.

A unit-range index becomes an arithmetic one and an all-valid float64 column a strided view of its buffer, as pandas’ slice is a numpy view; s.iloc[::-1] built, normalized and gathered a million positions (6.3 ms, pandas 0.006; br-frankenpandas-e00f7). Anything else gathers the rows as Self::iloc does.

§Errors

Rejects a selection reaching outside the rows, as iloc does.

Source

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.

Source

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).

Source

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.

Source

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).

Source

pub fn loc_slice_positions( &self, start: Option<&IndexLabel>, stop: Option<&IndexLabel>, ) -> Result<Vec<usize>, FrameError>

The positions .loc[start:stop] selects, resolved as Self::loc_slice resolves them - for writes through them (s.loc[a:b] = value).

Source

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.

Source

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.

Source

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.

Source

pub fn sort_index_na( &self, ascending: bool, na_position: &str, ) -> Result<Self, FrameError>

Return a new Series sorted by index labels with explicit NA position.

Matches s.sort_index(ascending=..., na_position='first'|'last').

Source

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'.

Source

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').

Source

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.

Source

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.

Source

pub fn fillna(&self, fill_value: &Scalar) -> Result<Self, FrameError>

Fill missing values with a scalar.

Matches pd.Series.fillna(value).

Source

pub fn fillna_limit( &self, fill_value: &Scalar, limit: usize, ) -> Result<Self, FrameError>

Fill the first limit missing values with fill_value.

Matches series.fillna(value, limit=N): pandas counts the fills along the whole Series, not per run of missing values (that is a method’s limit, ffill(limit=N)); it filled limit per gap (br-frankenpandas-vwkd3).

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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).

Source

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).

Source

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).

Source

pub fn interpolate_supports( method: &str, limit_direction: Option<&str>, limit_area: Option<&str>, ) -> bool

Whether interpolate_with implements this combination: every method takes every option but pad, a forward fill (pandas refuses any other direction) without limit_area.

Source

pub fn interpolate_with( &self, method: &str, limit: Option<usize>, limit_direction: Option<&str>, limit_area: Option<&str>, ) -> Result<Self, FrameError>

pandas’ interpolate(method, limit=, limit_direction=, limit_area=) (br-frankenpandas-rc0923-epic-python-honest-dropin-fvsao.5: the Python binding dropped every option and always interpolated linearly). Combinations outside interpolate_supports are rejected.

Source

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 value
  • zero: use the left bounding value (step function / zero-order hold)
Source

pub fn dropna(&self) -> Result<Self, FrameError>

Remove entries with missing values.

Matches pd.Series.dropna().

Source

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.

Source

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.

Source

pub fn asof_value(&self, label: &IndexLabel) -> Result<Scalar, FrameError>

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 NaT

A 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)

A string where is converted with Timestamp(where) before anything else, so a string that is not a date raises whatever the index holds. MEASURED, live pandas 2.2.3:

pd.Series([1., 2., 3.], index=['a', 'b', 'c']).asof('c')
    -> DateParseError: Unknown datetime string format, unable to parse: c

(A date string against a non-datetime index raises TypeError in pandas; fp keeps answering it, because fp also spells datetime indexes as ISO strings.) br-frankenpandas-rc0923-epic-first-green-ci-kyvo0.6

Source

pub fn isna(&self) -> Result<Self, FrameError>

Return a boolean mask where missing values are true.

Matches pd.Series.isna().

Source

pub fn isnull(&self) -> Result<Self, FrameError>

Alias for isna.

Matches pd.Series.isnull().

Source

pub fn notna(&self) -> Result<Self, FrameError>

Return a boolean mask where non-missing values are true.

Matches pd.Series.notna().

Source

pub fn notnull(&self) -> Result<Self, FrameError>

Alias for notna.

Matches pd.Series.notnull().

Source

pub fn count(&self) -> usize

Return the number of non-null elements.

Matches pd.Series.count().

Source

pub fn count_nonzero(&self) -> usize

Return the number of non-zero elements.

Matches np.count_nonzero(series).

Source

pub fn value_counts(&self) -> Result<Self, FrameError>

Source

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).

Source

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.

Source

pub fn is_unique(&self) -> bool

Check if all values in the Series are unique (no duplicates).

Matches pd.Series.is_unique.

Source

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().

Source

pub fn is_monotonic_increasing(&self) -> bool

Check if values are monotonically increasing (non-decreasing).

Matches pd.Series.is_monotonic_increasing.

Source

pub fn is_monotonic(&self) -> bool

Alias for is_monotonic_increasing.

Source

pub fn is_monotonic_decreasing(&self) -> bool

Check if values are monotonically decreasing (non-increasing).

Matches pd.Series.is_monotonic_decreasing.

Source§

impl Series

Source

pub fn apply<F>(&self, func: F) -> Result<Series, FrameError>
where F: Fn(&Scalar) -> Scalar,

Apply a custom function to each element of the Series.

Matches pd.Series.apply(func).

Source

pub fn map_func<F>(&self, func: F) -> Result<Series, FrameError>
where F: Fn(&Scalar) -> Scalar,

Map values of a Series using an input mapping or function.

Matches pd.Series.map(arg).

Source

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.

Source

pub fn nunique(&self) -> usize

Count of unique non-null values.

Matches pd.Series.nunique().

Source

pub fn nunique_with_dropna(&self, dropna: bool) -> usize

Count of unique values with explicit null counting control.

Matches pd.Series.nunique(dropna=...).

Source

pub fn map(&self, mapping: &[(Scalar, Scalar)]) -> Result<Self, FrameError>

Source

pub fn map_callable<F>(&self, func: F) -> Result<Self, FrameError>
where F: FnMut(&Scalar) -> Scalar,

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).

Source

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.

Source

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.

Source

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.

Source

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}).

Source

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.

Source

pub fn replace_regex_cells( &self, pat: &str, value: &Scalar, ) -> Result<Self, FrameError>

pandas’ regex replace with a non-string value (NaN, None, a number): every string cell the pattern finds (re.search) becomes value whole, of its own type; any other cell is unchanged. (A string value is a substitution - Self::replace_regex; this one was written as its text, so NaN came back as the string ‘nan’; br-frankenpandas-otatv.)

Source

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).

Source

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”.

Source

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).

Source

pub fn astype(&self, dtype: DType) -> Result<Self, FrameError>

Cast values to a target dtype.

Matches series.astype(dtype) for scalar dtypes.

Source

pub fn astype_width( &self, width: NumericWidth, nullable: bool, ) -> Result<Self, FrameError>

Cast to a numpy dtype narrower than 64 bits - astype('int32'), astype('uint8'), astype('float32'), and with nullable the masked Int32 … Float32 (fvsao.23) - as Column::cast_to_width casts: integers wrap into the width (astype('int8') of 300 is 44), floats round to float32. A categorical casts its values, as Self::astype.

Source

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 as astype()
  • errors="coerce": values that fail conversion become NaN
Source

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.

Source

pub fn clip_lower(&self, threshold: f64) -> Result<Self, FrameError>

Clip values below a threshold.

Source

pub fn clip_upper(&self, threshold: f64) -> Result<Self, FrameError>

Clip values above a threshold.

Source

pub fn clip_nanos( &self, lower: Option<i64>, upper: Option<i64>, ) -> Result<Option<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. Clip a datetime64/timedelta64 column to [lower, upper] nanoseconds (either optional), NaT kept, as pandas’ clip with Timestamp/Timedelta bounds; None for any other dtype (the f64 clip refused these; br-frankenpandas-rc0923-epic-python-honest-dropin-fvsao.17).

Source

pub fn clip_with_series( &self, lower: Option<&Self>, upper: Option<&Self>, ) -> Result<Self, FrameError>

Source

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.

Source

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.

Source

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.

Source

pub fn absolute(&self) -> Result<Self, FrameError>

Alias for abs. Matches np.absolute.

Source

pub fn fabs(&self) -> Result<Self, FrameError>

Absolute value of floating-point elements.

Matches np.fabs(series). Same as abs() but explicitly for floats.

Source

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.

Source

pub fn around(&self, decimals: i32) -> Result<Self, FrameError>

Alias for round. Matches np.around.

Source

pub fn floor(&self) -> Result<Self, FrameError>

Floor each element (round toward negative infinity).

Matches np.floor(series). NaN values pass through.

Source

pub fn ceil(&self) -> Result<Self, FrameError>

Ceiling of each element (round toward positive infinity).

Matches np.ceil(series). NaN values pass through.

Source

pub fn trunc(&self) -> Result<Self, FrameError>

Truncate each element toward zero.

Matches np.trunc(series). NaN values pass through.

Source

pub fn sqrt(&self) -> Result<Self, FrameError>

Element-wise square root.

Matches np.sqrt(series). NaN values pass through.

Source

pub fn exp(&self) -> Result<Self, FrameError>

Element-wise exponential (e^x).

Matches np.exp(series). NaN values pass through.

Source

pub fn log(&self) -> Result<Self, FrameError>

Element-wise natural logarithm.

Matches np.log(series). NaN values pass through.

Source

pub fn log10(&self) -> Result<Self, FrameError>

Element-wise base-10 logarithm.

Matches np.log10(series). NaN values pass through.

Source

pub fn log2(&self) -> Result<Self, FrameError>

Element-wise base-2 logarithm.

Matches np.log2(series). NaN values pass through.

Source

pub fn sin(&self) -> Result<Self, FrameError>

Element-wise sine.

Matches np.sin(series). NaN values pass through.

Source

pub fn cos(&self) -> Result<Self, FrameError>

Element-wise cosine.

Matches np.cos(series). NaN values pass through.

Source

pub fn tan(&self) -> Result<Self, FrameError>

Element-wise tangent.

Matches np.tan(series). NaN values pass through.

Source

pub fn sinh(&self) -> Result<Self, FrameError>

Element-wise hyperbolic sine.

Matches np.sinh(series). NaN values pass through.

Source

pub fn cosh(&self) -> Result<Self, FrameError>

Element-wise hyperbolic cosine.

Matches np.cosh(series). NaN values pass through.

Source

pub fn tanh(&self) -> Result<Self, FrameError>

Element-wise hyperbolic tangent.

Matches np.tanh(series). NaN values pass through.

Source

pub fn arcsin(&self) -> Result<Self, FrameError>

Element-wise inverse sine.

Matches np.arcsin(series). NaN values pass through.

Source

pub fn arccos(&self) -> Result<Self, FrameError>

Element-wise inverse cosine.

Matches np.arccos(series). NaN values pass through.

Source

pub fn arctan(&self) -> Result<Self, FrameError>

Element-wise inverse tangent.

Matches np.arctan(series). NaN values pass through.

Source

pub fn arcsinh(&self) -> Result<Self, FrameError>

Element-wise inverse hyperbolic sine.

Matches np.arcsinh(series). NaN values pass through.

Source

pub fn arccosh(&self) -> Result<Self, FrameError>

Element-wise inverse hyperbolic cosine.

Matches np.arccosh(series). NaN values pass through.

Source

pub fn arctanh(&self) -> Result<Self, FrameError>

Element-wise inverse hyperbolic tangent.

Matches np.arctanh(series). NaN values pass through.

Source

pub fn asin(&self) -> Result<Self, FrameError>

Alias for arcsin. Matches Rust/math convention.

Source

pub fn acos(&self) -> Result<Self, FrameError>

Alias for arccos. Matches Rust/math convention.

Source

pub fn atan(&self) -> Result<Self, FrameError>

Alias for arctan. Matches Rust/math convention.

Source

pub fn asinh(&self) -> Result<Self, FrameError>

Alias for arcsinh. Matches Rust/math convention.

Source

pub fn acosh(&self) -> Result<Self, FrameError>

Alias for arccosh. Matches Rust/math convention.

Source

pub fn atanh(&self) -> Result<Self, FrameError>

Alias for arctanh. Matches Rust/math convention.

Source

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.

Source

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.

Source

pub fn cbrt(&self) -> Result<Self, FrameError>

Element-wise cube root.

Matches np.cbrt(series). NaN values pass through.

Source

pub fn sign(&self) -> Result<Self, FrameError>

Element-wise sign (-1, 0, or 1).

Matches np.sign(series). NaN values pass through.

Source

pub fn signbit(&self) -> Result<Self, FrameError>

Element-wise sign bit (true if negative).

Matches np.signbit(series). NaN values pass through.

Source

pub fn radians(&self) -> Result<Self, FrameError>

Convert angles from degrees to radians.

Matches np.radians(series) / np.deg2rad(series).

Source

pub fn deg2rad(&self) -> Result<Self, FrameError>

Alias for radians(). Matches np.deg2rad(series).

Source

pub fn degrees(&self) -> Result<Self, FrameError>

Convert angles from radians to degrees.

Matches np.degrees(series) / np.rad2deg(series).

Source

pub fn rad2deg(&self) -> Result<Self, FrameError>

Alias for degrees(). Matches np.rad2deg(series).

Source

pub fn reciprocal(&self) -> Result<Self, FrameError>

Element-wise reciprocal (1/x).

Matches np.reciprocal(series). NaN values pass through.

Source

pub fn square(&self) -> Result<Self, FrameError>

Element-wise square (x^2).

Matches np.square(series). NaN values pass through.

Source

pub fn rint(&self) -> Result<Self, FrameError>

Round to nearest integer (banker’s rounding).

Matches np.rint(series). NaN values pass through.

Source

pub fn fix(&self) -> Result<Self, FrameError>

Round toward zero (alias for trunc).

Matches np.fix(series). NaN values pass through.

Source

pub fn isfinite(&self) -> Result<Self, FrameError>

Element-wise check for finite values.

Matches np.isfinite(series). Returns boolean Series.

Source

pub fn isinf(&self) -> Result<Self, FrameError>

Element-wise check for infinite values.

Matches np.isinf(series). Returns boolean Series.

Source

pub fn isnan(&self) -> Result<Self, FrameError>

Element-wise check for NaN values.

Matches np.isnan(series). Returns boolean Series.

Source

pub fn isneginf(&self) -> Result<Self, FrameError>

Element-wise check for negative infinity.

Matches np.isneginf(series). Returns boolean Series.

Source

pub fn isposinf(&self) -> Result<Self, FrameError>

Element-wise check for positive infinity.

Matches np.isposinf(series). Returns boolean Series.

Source

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).

Source

pub fn neg(&self) -> Result<Self, FrameError>

Element-wise negation (-x).

Matches np.negative(series) / -series.

Source

pub fn negative(&self) -> Result<Self, FrameError>

Alias for neg(). Matches np.negative(series).

Source

pub fn positive(&self) -> Result<Self, FrameError>

Element-wise identity (+x, no-op for numeric).

Matches np.positive(series) / +series.

Source

pub fn reverse(&self) -> Result<Self, FrameError>

Reverse the order of elements.

Matches series[::-1] / np.flip(series).

Source

pub fn flip(&self) -> Result<Self, FrameError>

Alias for reverse(). Matches np.flip(series).

Source

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.

Source

pub fn tile(&self, reps: usize) -> Result<Self, FrameError>

Tile (repeat) the series a given number of times.

Matches np.tile(series, reps).

Source

pub fn maximum(&self, other: &Self) -> Result<Self, FrameError>

Element-wise maximum of two Series.

Matches np.maximum(s1, s2). NaN propagates.

Source

pub fn minimum(&self, other: &Self) -> Result<Self, FrameError>

Element-wise minimum of two Series.

Matches np.minimum(s1, s2). NaN propagates.

Source

pub fn fmax(&self, other: &Self) -> Result<Self, FrameError>

Element-wise maximum ignoring NaN.

Matches np.fmax(s1, s2). Ignores NaN.

Source

pub fn fmin(&self, other: &Self) -> Result<Self, FrameError>

Element-wise minimum ignoring NaN.

Matches np.fmin(s1, s2). Ignores NaN.

Source

pub fn hypot(&self, other: &Self) -> Result<Self, FrameError>

Element-wise hypotenuse: sqrt(x2 + y2).

Matches np.hypot(s1, s2).

Source

pub fn atan2(&self, other: &Self) -> Result<Self, FrameError>

Element-wise arc tangent of y/x (choosing quadrant correctly).

Matches np.arctan2(y, x).

Source

pub fn arctan2(&self, other: &Self) -> Result<Self, FrameError>

Alias for atan2. Matches np.arctan2.

Source

pub fn copysign(&self, other: &Self) -> Result<Self, FrameError>

Element-wise copy sign from other to self.

Matches np.copysign(s1, s2).

Source

pub fn bitwise_and(&self, other: &Self) -> Result<Self, FrameError>

Element-wise bitwise AND.

Matches np.bitwise_and(s1, s2).

Source

pub fn bitwise_or(&self, other: &Self) -> Result<Self, FrameError>

Element-wise bitwise OR.

Matches np.bitwise_or(s1, s2).

Source

pub fn bitwise_xor(&self, other: &Self) -> Result<Self, FrameError>

Element-wise bitwise XOR.

Matches np.bitwise_xor(s1, s2).

Source

pub fn bitwise_not(&self) -> Result<Self, FrameError>

Element-wise bitwise NOT.

Matches np.bitwise_not(s) / np.invert(s).

Source

pub fn invert(&self) -> Result<Self, FrameError>

Alias for bitwise_not. Matches np.invert.

Source

pub fn float_power(&self, other: &Self) -> Result<Self, FrameError>

Element-wise float power.

Matches np.float_power(s1, s2).

Source

pub fn floor_divide(&self, other: &Self) -> Result<Self, FrameError>

Element-wise floor division.

Matches np.floor_divide(s1, s2) / s1 // s2.

Source

pub fn fmod(&self, other: &Self) -> Result<Self, FrameError>

Element-wise float modulo.

Matches np.fmod(s1, s2).

Source

pub fn power(&self, other: &Self) -> Result<Self, FrameError>

Element-wise power.

Matches np.power(s1, s2) / s1 ** s2.

Source

pub fn remainder(&self, other: &Self) -> Result<Self, FrameError>

Element-wise remainder.

Matches np.remainder(s1, s2) / s1 % s2.

Source

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.

Source

pub fn ldexp(&self, exp: i32) -> Result<Self, FrameError>

Multiply by 2^exp.

Matches np.ldexp(s, exp).

Source

pub fn logaddexp(&self, other: &Self) -> Result<Self, FrameError>

Log of sum of exponentials: log(exp(s1) + exp(s2)).

Matches np.logaddexp(s1, s2).

Source

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).

Source

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.

Source

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.

Source

pub fn interpolate_linear(&self) -> Result<Self, FrameError>

Linear interpolation to fill missing values.

Matches pd.Series.interpolate(method='linear').

Source

pub fn gcd(&self, other: &Self) -> Result<Self, FrameError>

Element-wise greatest common divisor.

Matches np.gcd(s1, s2).

Source

pub fn gradient(&self) -> Result<Self, FrameError>

Numerical gradient (forward/central/backward differences).

Matches np.gradient(s).

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn flatnonzero(&self) -> Result<Self, FrameError>

Indices of non-zero elements.

Matches np.flatnonzero(s). Returns indices where values are non-zero.

Source

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.

Source

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.

Source

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.

Source

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 exactly 0.0
  • exponent is an integer
  • x = mantissa * 2^exponent
Source

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]].

Source

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.

Source

pub fn hist_counts(&self, bins: usize) -> Vec<usize>

Compute histogram counts.

Matches the bins=n histogram path behind pd.Series.hist.

Source

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.

Source

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.

Source

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.

Source

pub fn split(&self, n: usize) -> Result<Vec<Self>, FrameError>

Alias for array_split.

Source

pub fn zeros_like(&self) -> Result<Self, FrameError>

Create a zeros Series with same shape and dtype as self.

Matches np.zeros_like().

Source

pub fn ones_like(&self) -> Result<Self, FrameError>

Create a ones Series with same shape and dtype as self.

Matches np.ones_like().

Source

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().

Source

pub fn logical_and(&self, other: &Self) -> Result<Self, FrameError>

Logical AND between two Series.

Matches np.logical_and().

Source

pub fn logical_or(&self, other: &Self) -> Result<Self, FrameError>

Logical OR between two Series.

Matches np.logical_or().

Source

pub fn logical_xor(&self, other: &Self) -> Result<Self, FrameError>

Logical XOR between two Series.

Matches np.logical_xor().

Source

pub fn logical_not(&self) -> Result<Self, FrameError>

Logical NOT (element-wise negation to boolean).

Matches np.logical_not().

Source

pub fn left_shift(&self, other: &Self) -> Result<Self, FrameError>

Left bit shift.

Matches np.left_shift().

Source

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.

Source

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')
    -> OverflowError

so 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.

Source

pub fn sum(&self) -> Result<Scalar, FrameError>

Sum of non-null numeric values. Returns Scalar::Float64(0.0) for empty.

Matches pd.Series.sum().

Source

pub fn mean(&self) -> Result<Scalar, FrameError>

Mean of non-null numeric values. Returns NaN for empty.

Matches pd.Series.mean().

Source

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.

Source

pub fn min(&self) -> Result<Scalar, FrameError>

Min of non-null numeric values. Returns NaN for empty.

Matches pd.Series.min().

Source

pub fn max(&self) -> Result<Scalar, FrameError>

Max of non-null numeric values. Returns NaN for empty.

Matches pd.Series.max().

Source

pub fn std(&self) -> Result<Scalar, FrameError>

Standard deviation of non-null numeric values (ddof=1, sample std).

Matches pd.Series.std().

Source

pub fn var(&self) -> Result<Scalar, FrameError>

Variance of non-null numeric values (ddof=1, sample variance).

Matches pd.Series.var().

Source

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.

Source

pub fn std_ddof(&self, ddof: usize) -> Result<Scalar, FrameError>

Standard deviation with configurable degrees of freedom.

Matches pd.Series.std(ddof=n).

Source

pub fn median(&self) -> Result<Scalar, FrameError>

Median of non-null numeric values. Returns NaN for empty.

Matches pd.Series.median().

Source

pub fn any(&self) -> Result<bool, FrameError>

Whether any non-missing value is truthy.

Matches pd.Series.any() with default skipna=True.

Source

pub fn all(&self) -> Result<bool, FrameError>

Whether all non-missing values are truthy.

Matches pd.Series.all() with default skipna=True.

Source

pub fn prod(&self) -> Result<Scalar, FrameError>

Product of non-null numeric values. Returns 1.0 for empty.

Matches pd.Series.prod().

Source

pub fn product(&self) -> Result<Scalar, FrameError>

pandas alias for Self::prod. Matches pd.Series.product(). Per br-frankenpandas-az1pt.

Source

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.

Source

pub fn mean_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>

Mean with skipna control.

Source

pub fn min_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>

Min with skipna control.

Source

pub fn max_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>

Max with skipna control.

Source

pub fn std_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>

Std with skipna control.

Source

pub fn var_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>

Var with skipna control.

Source

pub fn median_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>

Median with skipna control.

Source

pub fn prod_skipna(&self, skipna: bool) -> Result<Scalar, FrameError>

Prod with skipna control.

Source

pub fn nansum(&self) -> Result<Scalar, FrameError>

Alias for sum, matching np.nansum.

Source

pub fn nanmean(&self) -> Result<Scalar, FrameError>

Alias for mean, matching np.nanmean.

Source

pub fn nanmin(&self) -> Result<Scalar, FrameError>

Alias for min, matching np.nanmin.

Source

pub fn nanmax(&self) -> Result<Scalar, FrameError>

Alias for max, matching np.nanmax.

Source

pub fn nanprod(&self) -> Result<Scalar, FrameError>

Alias for prod, matching np.nanprod.

Source

pub fn nanstd(&self, ddof: usize) -> Result<Scalar, FrameError>

Alias for std_ddof, matching np.nanstd.

Source

pub fn nanvar(&self, ddof: usize) -> Result<Scalar, FrameError>

Alias for var_ddof, matching np.nanvar.

Source

pub fn nanmedian(&self) -> Result<Scalar, FrameError>

Alias for median, matching np.nanmedian.

Source

pub fn lcm(&self, other: &Self) -> Result<Self, FrameError>

Element-wise least common multiple.

Matches np.lcm(x, y).

Source

pub fn ptp(&self) -> Scalar

Peak-to-peak range (max − min) over non-missing values.

Matches np.ptp.

Source

pub fn nonzero(&self) -> Vec<usize>

Indices of non-zero/truthy elements.

Matches np.nonzero().

Source

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).

Source

pub fn percentile(&self, p: f64) -> Scalar

Percentile of non-missing values.

Matches np.percentile(). Takes percentile p in [0, 100].

Source

pub fn nanquantile(&self, q: f64) -> Result<Scalar, FrameError>

Alias for quantile, matching np.nanquantile.

Source

pub fn nanpercentile(&self, p: f64) -> Scalar

Alias for percentile, matching np.nanpercentile.

Source

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.

Source

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.

Source

pub fn trapz(&self, dx: f64) -> Result<Scalar, FrameError>

Trapezoidal numerical integration.

Matches np.trapz(). Returns scalar result of integral.

Source

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
Source

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.

Source

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.

Source

pub fn true_divide(&self, other: &Self) -> Result<Self, FrameError>

Alias for div, matching NumPy naming.

Source

pub fn right_shift(&self, other: &Self) -> Result<Self, FrameError>

Right bit shift.

Matches np.right_shift().

Source

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.

Source

pub fn nanargmin(&self) -> Result<i64, FrameError>

Alias for argmin, matching np.nanargmin.

Source

pub fn nanargmax(&self) -> Result<i64, FrameError>

Alias for argmax, matching np.nanargmax.

Source

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).

Source

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|.

Source

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.

Source

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=...).

Source

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).

Source

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.

Source

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.

Source

pub fn cumsum(&self) -> Result<Self, FrameError>

Cumulative sum, skipping NaN.

Matches pd.Series.cumsum(skipna=True).

Source

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.

Source

pub fn cumprod_with_skipna(&self, skipna: bool) -> Result<Self, FrameError>

Cumulative product with an explicit skipna (see cumsum_with_skipna).

Source

pub fn cummax_with_skipna(&self, skipna: bool) -> Result<Self, FrameError>

Cumulative maximum with an explicit skipna (see cumsum_with_skipna).

Source

pub fn cummin_with_skipna(&self, skipna: bool) -> Result<Self, FrameError>

Cumulative minimum with an explicit skipna (see cumsum_with_skipna).

Source

pub fn cumprod(&self) -> Result<Self, FrameError>

Cumulative product, skipping NaN.

Matches pd.Series.cumprod(skipna=True).

Source

pub fn cummin(&self) -> Result<Self, FrameError>

Cumulative minimum, skipping NaN.

Matches pd.Series.cummin(skipna=True).

Source

pub fn cummax(&self) -> Result<Self, FrameError>

Cumulative maximum, skipping NaN.

Matches pd.Series.cummax(skipna=True).

Source

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.

Source

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.

Source

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).

Source

pub fn where_series( &self, cond: &Self, other: &Self, ) -> Result<Self, FrameError>

Pandas-named Series replacement alias for Self::where_cond_series.

Source

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).

Source

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.

Source

pub fn isin(&self, test_values: &[Scalar]) -> Result<Self, FrameError>

Source

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; a nullable Series gives the boolean dtype with <NA> there, as pandas’ masked comparison.

Source

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.

Source

pub fn idxmax(&self) -> Result<IndexLabel, FrameError>

Return the label of the maximum value.

Matches series.idxmax(). Skips missing values.

Source

pub fn idxmax_ext(&self, skipna: bool) -> Result<Option<IndexLabel>, FrameError>

Return index label of maximum value with skipna control.

Matches s.idxmax(skipna=...).

Source

pub fn idxmin_ext(&self, skipna: bool) -> Result<Option<IndexLabel>, FrameError>

Return index label of minimum value with skipna control.

Matches s.idxmin(skipna=...).

Source

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.

Source

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.

Source

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 duplicates
  • last: keep last occurrence of duplicates
  • all: keep all occurrences (may return more than n rows)
Source

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').

Source

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.

Source

pub fn argmin(&self) -> Result<i64, FrameError>

Return the integer position of the minimum value.

Matches pd.Series.argmin(). Skips missing values.

Source

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.

Source

pub fn argmax(&self) -> Result<i64, FrameError>

Return the integer position of the maximum value.

Matches pd.Series.argmax(). Skips missing values.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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=...).

Source

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).

Source

pub fn factorize(&self) -> Result<(Self, Self), FrameError>

Source

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).

Source

pub fn sem(&self) -> Result<f64, FrameError>

Standard error of the mean.

Matches pd.Series.sem(). Computes std / sqrt(n).

Source

pub fn skew(&self) -> Result<f64, FrameError>

Skewness (Fisher’s definition, bias=False).

Matches pd.Series.skew().

Source

pub fn kurtosis(&self) -> Result<f64, FrameError>

Excess kurtosis (Fisher’s definition, bias=False).

Matches pd.Series.kurtosis() / pd.Series.kurt().

Source

pub fn kurt(&self) -> Result<f64, FrameError>

Alias for kurtosis().

Source

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.

Source

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.

Source

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).

Source

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).

Source

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.

Source

pub fn memory_usage(&self) -> usize

Approximate memory usage in bytes.

Matches pd.Series.memory_usage(). Includes index and values.

Source

pub fn hasnans(&self) -> bool

Return true if the Series contains any NaN or null values.

Matches pd.Series.hasnans.

Source

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.

Source

pub fn ndim(&self) -> usize

Number of axes — always 1 for Series.

Matches pd.Series.ndim.

Source

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.

Source

pub fn shape(&self) -> (usize,)

Shape of the Series.

Matches pd.Series.shape as a one-element tuple.

Source

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.

Source

pub fn empty(&self) -> bool

Whether the Series has zero elements.

Matches pd.Series.empty.

Source

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.

Source

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.

Source

pub fn flags(&self) -> DataFrameFlags

Series flags metadata.

Matches pd.Series.flags for the duplicate-label flag currently represented by FrankenPandas.

Source

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.

Source

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 with 0..len and return a Series.
  • drop=false: widen to a two-column DataFrame with the materialized index first and the value column second.
Source

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.

Source

pub fn reset_index_allow_duplicates( &self, drop: bool, name: Option<&str>, allow_duplicates: bool, ) -> Result<SeriesResetIndexResult, FrameError>

pd.Series.reset_index(drop=..., name=..., allow_duplicates=...): with allow_duplicates an index column may share the value column’s label, where without it that is pandas’ “cannot insert X, already exists” (br-frankenpandas-n57tz: allow_duplicates was refused).

Source

pub fn pipe<F>(&self, func: F) -> Result<Self, FrameError>
where F: FnOnce(&Self) -> Result<Self, FrameError>,

Pass the Series through a function.

Matches pd.Series.pipe(func). Useful for method chaining.

Source

pub fn items(&self) -> Vec<(IndexLabel, Scalar)>

Return an iterator over (index_label, value) pairs.

Matches pd.Series.items().

Source

pub fn iteritems(&self) -> Vec<(IndexLabel, Scalar)>

👎Deprecated:

use items() instead

Alias for items (deprecated in pandas but kept for compatibility).

Source

pub fn iat(&self, pos: i64) -> Result<Scalar, FrameError>

Access a scalar value by integer position.

Matches pd.Series.iat[i].

Source

pub fn at(&self, label: &IndexLabel) -> Result<Scalar, FrameError>

Access a scalar value by label.

Matches pd.Series.at[label].

Source

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.

Source

pub fn get_or(&self, label: &IndexLabel, default: Scalar) -> Scalar

Dict-like scalar lookup with a fallback value.

Matches pd.Series.get(key, default=...).

Source

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.

Source

pub fn transform<F>(&self, func: F) -> Result<Self, FrameError>
where F: Fn(&Scalar) -> Scalar,

Apply a function element-wise, returning a Series of the same shape.

Matches pd.Series.transform(func).

Source

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.

Source

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.

Source

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.

Source

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.

Source

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=...).

Source

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.

Source

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.

Source

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].

Source

pub fn describe_with_percentiles( &self, percentiles: &[f64], ) -> Result<Self, FrameError>

Generate descriptive statistics with custom percentiles.

Matches pd.Series.describe(percentiles=[...]).

Source

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.

Source

pub fn aggregate(&self, funcs: &[&str]) -> Result<Self, FrameError>

pandas alias for Self::agg (pd.Series.aggregate(...)). br-frankenpandas-f7c9o.

Source

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.

Source

pub fn droplevel(&self) -> Result<Self, FrameError>

Return Series with dropped index level(s).

Matches s.droplevel(0) for single-level index.

Source

pub fn unstack_levels( &self, moved: &[usize], fill_value: Option<&Scalar>, ) -> Result<DataFrame, FrameError>

pandas’ unstack(level=moved) over a row MultiIndex of any depth (moved: level positions, in the order given): those levels become the columns - one level’s typed labels sorted, the column axis named after it, or several levels’ combinations in the order they first appear (pandas’ _unstack_multiple), a column MultiIndex named after them - and the other levels, in order, the rows, sorted (a MultiIndex when several, else an Index named after the level). A combination that does not occur is missing, and then every int column is float64 (one block, as pandas); a nullable dtype keeps an NA. A repeated combination is pandas’ “Index contains duplicate entries, cannot reshape” (the first value won). fill_value fills the missing combinations as pandas does while reshaping (an int Series filled with an int stays int64). Only a two-level index’s last level unstacked (fvsao.13, br-frankenpandas-xbl2k).

Source

pub fn unstack(&self) -> Result<DataFrame, FrameError>

Unstack a Series with string-composite index into a DataFrame.

Matches pd.Series.unstack(): a row MultiIndex unstacks its last level (Self::unstack_levels). Without one, index labels in the format “row_key, col_key” (comma-separated composite keys) split into the row index and the column names.

Source

pub fn to_list(&self) -> Vec<Scalar>

Convert Series to a vector of scalars.

Matches series.to_list().

Source

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.

Source

pub fn to_dict(&self) -> Vec<(IndexLabel, Scalar)>

Convert Series to a vector of (label, scalar) pairs.

Matches series.to_dict().

Source

pub fn to_csv(&self, sep: char, include_index: bool) -> String

Serialize the Series to a CSV string.

Matches pd.Series.to_csv().

Source

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_*).

Source

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
Source

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
Source

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, ...}

Floats are written at pandas’ default double_precision (10).

Source

pub fn to_json_with_options( &self, orient: &str, options: JsonOptions, ) -> Result<String, FrameError>

Series::to_json under pandas’ double_precision / index keywords (JsonOptions; split without the index when it is off).

Source

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.

Source

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.

Source

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).

Source

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.

Source

pub fn duplicated(&self) -> Result<Self, FrameError>

Source

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 True
  • Last: mark all but the last occurrence as True
  • None: mark all duplicated values as True
Source

pub fn drop_duplicates(&self) -> Result<Self, FrameError>

Remove duplicate values, keeping the first occurrence.

Matches pd.Series.drop_duplicates(keep='first').

Source

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 value
  • Last: keep the last occurrence of each value
  • None: drop all duplicated values entirely
Source

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.

Source

pub fn compare(&self, other: &Self) -> Result<DataFrame, FrameError>

Pandas spelling alias for Self::compare_with.

Matches pd.Series.compare(other).

Source

pub fn reindex_like(&self, other: &Self) -> Result<Self, FrameError>

Reindex to match another Series’ index.

Matches pd.Series.reindex_like(other).

Source

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.

Source

pub fn convert_dtypes_with( &self, options: ConvertDtypes, ) -> Result<Self, FrameError>

Matches pd.Series.convert_dtypes(infer_objects=, convert_string=, convert_integer=, convert_boolean=, convert_floating=) (see convert_column_dtypes_with; br-frankenpandas-di8vx).

Source

pub fn infer_objects(&self) -> Result<Self, FrameError>

Infer object dtypes to best-possible scalar dtypes.

Matches pd.Series.infer_objects() (see inferred_object_column): numpy dtypes stay, text stays text. It returned the Series as it was, so an object Series of ints stayed object.

Source

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.

Source

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.

Source

pub fn rename(&self, name: impl Into<LabelName>) -> Result<Self, FrameError>

Rename the Series (return a copy with a new name).

Matches pd.Series.rename(name).

Source

pub fn rename_axis<N: Into<LabelName>>( &self, name: N, ) -> 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).

Source

pub fn set_axis(&self, labels: Vec<IndexLabel>) -> Result<Self, FrameError>

Replace the index labels.

Matches pd.Series.set_axis(labels).

Source

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).

Source

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).

Source

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).

Source

pub fn between_time_inclusive( &self, start: &str, end: &str, inclusive: IntervalClosed, ) -> Result<Self, FrameError>

Self::between_time with pandas’ inclusive= (which ends of the time range are kept; ‘both’ the default).

Source

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).

Source

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.

Source

pub fn combine<F>(&self, other: &Self, func: F) -> Result<Self, FrameError>
where F: Fn(&Scalar, &Scalar) -> Scalar,

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.

Source

pub fn explode_lists(&self, ignore_index: bool) -> Result<Self, FrameError>

pandas’ s.explode(ignore_index) over list cells (fvsao.33): a list cell becomes one row per item (an empty list one row of NaN), any other value stays one row; an object Series’ result is object and another dtype’s keeps it (see DataFrame::explode_lists), as pandas’, and the index repeats its labels (a fresh RangeIndex with ignore_index).

Source

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.

Source

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).

Source

pub fn rolling_closed( &self, window: usize, min_periods: Option<usize>, center: bool, closed: IntervalClosed, ) -> Result<Rolling<'_>, FrameError>

A count window closed as pandas’ rolling(window, center=, closed=) says (fixed_window_bounds; ‘right’, the default, is Self::rolling_with_center). min_periods defaults to window and must not exceed it, as pandas.

Source

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).

Source

pub fn rolling_offset_closed( &self, window: &str, min_periods: Option<usize>, closed: IntervalClosed, ) -> Result<Rolling<'_>, FrameError>

Self::rolling_offset closed as pandas’ closed= says (offset_window_bounds).

Source

pub fn rolling_offset_centered( &self, window: &str, min_periods: Option<usize>, closed: IntervalClosed, center: bool, ) -> Result<Rolling<'_>, FrameError>

Self::rolling_offset_closed, each window centred on its row when center (centered_offset_window_bounds; pandas’ rolling('3D', center=True), br-frankenpandas-gv69z).

Source

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).

Source

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).

Source

pub fn expanding(&self, min_periods: Option<usize>) -> Expanding<'_>

Create an expanding window view of this Series.

Matches series.expanding(min_periods=1).

Source

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.
Source

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 average sum_i (1-a)^i x_{t-i} / sum_i (1-a)^i.
  • adjust=false: the recursive form y_0 = x_0; y_t = (1-a)*y_{t-1} + a*x_t (with ignore_na=False renormalization across internal NaN gaps, exactly as pandas’ _libs/window/aggregations.pyx::ewm kernel: new observations enter with weight alpha and the prior weight resets to 1 after every observation).
  • min_periods=k: outputs are NaN until at least max(min_periods, 1) non-NaN observations have been seen — pandas’ ExponentialMovingWindow clamps min_periods to at least 1.
Source

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).

Source

pub fn resample_ext( &self, freq: &str, closed: Option<&str>, label: Option<&str>, origin: Option<&str>, ) -> Resample<'_>

Source

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.

Source

pub fn dot(&self, other: &Self) -> Result<f64, FrameError>

Source

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)

Source

pub fn rank_with_pct( &self, method: &str, ascending: bool, na_option: &str, pct: bool, ) -> Result<Self, FrameError>

Source

pub fn corr(&self, other: &Self) -> Result<f64, FrameError>

Compute the Pearson correlation with another Series.

Source

pub fn cov_with(&self, other: &Self) -> Result<f64, FrameError>

Compute the sample covariance with another Series.

Source

pub fn cov(&self, other: &Self) -> Result<f64, FrameError>

Pandas spelling alias for Self::cov_with.

Matches pd.Series.cov(other).

Source

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 is count - ddof. Defaults map: ddof=0 population, ddof=1 sample (pandas default).
Source

pub fn aligned_numeric_pairs( &self, other: &Self, ) -> Result<Vec<(f64, f64)>, FrameError>

The (self, other) value pairs pandas’ corr reads: the two aligned inner-wise, a pair kept where both are present numbers.

Source

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.

Source

pub fn corr_kendall(&self, other: &Self) -> Result<f64, FrameError>

Compute the Kendall tau-b correlation with another Series.

Source

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.).

Source

pub fn groupby_sharing<'a>( &'a self, by: &'a Series, layout: &Arc<DenseGroupLayout>, ) -> Result<SeriesGroupBy<'a>, FrameError>

Self::groupby reusing layout, the dense group ids of the groupbys already built over this same by key (br-frankenpandas-vug8g): a layout belongs to ONE key, and the caller keeps it beside that key. A layout holding the ids of a key of another length is not used.

Source

pub fn str(&self) -> StringAccessor<'_>

Access string methods on a Utf8 Series (analogous to pandas.Series.str).

Source

pub fn dt(&self) -> DatetimeAccessor<'_>

Access datetime components of this Series.

Matches pd.Series.dt. Extracts components from ISO 8601 formatted string values.

Source

pub fn cat(&self) -> Option<CategoricalAccessor<'_>>

Access categorical methods on this Series.

Matches pd.Series.cat. Returns None if the Series is not categorical.

Source

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.

Source

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.

Source

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().

Source

pub fn is_categorical(&self) -> bool

Returns true if this Series has categorical metadata.

Source

pub fn is_sparse(&self) -> bool

Returns true if this Series has sparse dtype metadata.

Source

pub fn from_categorical( name: impl Into<LabelName>, values: Vec<Scalar>, ordered: bool, ) -> Result<Self, FrameError>

Create a categorical Series from values.

Matches pd.Categorical(values): the categories are the distinct non-missing values in sorted order (first-seen order when they do not sort), and the Series stores the values (see Self::category_codes).

Source

pub fn from_categorical_codes( name: impl Into<LabelName>, 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).

Source

pub fn from_sparse_dense( name: impl Into<LabelName>, 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.

Source

pub fn apply_fn<F>(&self, func: F) -> Result<Self, FrameError>
where F: Fn(&Scalar) -> Scalar,

Apply a closure element-wise to produce a new Series.

Source

pub fn apply_fn_na<F>(&self, func: F) -> Result<Self, FrameError>
where F: Fn(&Scalar) -> Scalar,

Apply a function with na_action='ignore'.

Matches series.apply(func, na_action='ignore'). Skips NaN/null values, preserving them in the output unchanged.

Source

pub fn map_fn<F>(&self, func: F) -> Result<Self, FrameError>
where F: Fn(&Scalar) -> Result<Scalar, 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).

Source

pub fn map_dict( &self, mapping: &BTreeMap<Scalar, Scalar>, ) -> Result<Self, FrameError>

Source

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)).

Trait Implementations§

Source§

impl AsDType for Series

Source§

fn as_dtype(&self) -> DType

Return the corresponding DType.
Source§

impl AsDType for &Series

Source§

fn as_dtype(&self) -> DType

Return the corresponding DType.
Source§

impl Clone for Series

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Series

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Series

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Series

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Series

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Series

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Series

Auto Trait Implementations§

§

impl !Freeze for Series

§

impl !RefUnwindSafe for Series

§

impl !UnwindSafe for Series

§

impl Send for Series

§

impl Sync for Series

§

impl Unpin for Series

§

impl UnsafeUnpin for Series

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.