Skip to main content

DataFrame

Struct DataFrame 

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

Implementations§

Source§

impl DataFrame

Source

pub fn new( index: Index, columns: impl Into<ColumnStore>, ) -> Result<Self, FrameError>

Source

pub fn from_f64_block_columns( index: Index, names: Vec<String>, block: Vec<f64>, ) -> Result<Self, FrameError>

Build a block-backed all-valid-Float64 DataFrame from a single column-major block (block[col * rows + row], rows == index.len()).

The frame exposes an O(1) DataFrame::to_numpy_block_view (pandas’ zero-copy df.values on a homogeneous-float frame) and each column borrows the shared block with no f64 data copy. block.len() must equal index.len() * names.len().

§Errors

Returns FrameError::CompatibilityRejected when block.len() does not match index.len() * names.len() or on dimension overflow.

Source

pub fn to_numpy_block_view(&self) -> Option<Float64BlockView>

O(1) zero-copy view of a block-backed frame’s data — pandas’ df.values on a homogeneous-float frame (an F-contiguous (rows, cols) array sharing the frame’s memory). Obtaining it is an Arc refcount bump.

Returns None unless this frame is block-backed (built via DataFrame::from_f64_block_columns); callers then fall back to DataFrame::to_numpy_flat for a materialized copy.

Source

pub fn new_with_column_order<C, O>( index: Index, columns: C, column_order: O, ) -> Result<Self, FrameError>
where C: Into<ColumnStore>, O: Into<Vec<String>>,

Source

pub fn new_with_row_multiindex( index: Index, row_multiindex: MultiIndex, columns: impl Into<ColumnStore>, ) -> Result<Self, FrameError>

Source

pub fn with_row_multiindex( self, row_multiindex: MultiIndex, ) -> Result<Self, FrameError>

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 dataframe plot directly to deterministic SVG string.

Source

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

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

Source

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

Convenience helper: save rendered dataframe plot 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 dataframe line plot directly to deterministic SVG string.

Source

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

Convenience helper: render dataframe 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 dataframe line plot directly to disk.

Source

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

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

Source

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

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

Source

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

Convenience helper: render dataframe 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 dataframe 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 dataframe horizontal bar plot directly to deterministic SVG string.

Source

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

Convenience helper: render dataframe 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 dataframe horizontal bar plot directly to disk.

Source

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

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

Source

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

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

Source

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

Convenience helper: render dataframe 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 dataframe area plot directly to disk.

Source

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

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

Source

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

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

Source

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

Convenience helper: render dataframe 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 dataframe scatter plot directly to disk.

Source

pub fn scatter_columns(&self, x: &str, y: &str) -> Result<PlotSpec, FrameError>

Return a backend-neutral pandas-style scatter plot request for the specified (x, y) column pair.

Source

pub fn scatter_xy(&self, x: &str, y: &str) -> Result<PlotSpec, FrameError>

Return a backend-neutral pandas-style scatter plot request for the specified (x, y) column pair (alias for DataFrame::scatter_columns).

Source

pub fn scatter_columns_to_svg( &self, x: &str, y: &str, ) -> Result<String, FrameError>

Convenience helper: render dataframe (x, y) scatter plot directly to deterministic SVG string.

Source

pub fn scatter_xy_to_svg(&self, x: &str, y: &str) -> Result<String, FrameError>

Convenience helper: render dataframe (x, y) scatter plot directly to deterministic SVG string (alias for DataFrame::scatter_columns_to_svg).

Source

pub fn scatter_columns_to_html( &self, x: &str, y: &str, ) -> Result<String, FrameError>

Convenience helper: render dataframe (x, y) scatter plot directly to HTML figure snippet.

Source

pub fn scatter_xy_to_html(&self, x: &str, y: &str) -> Result<String, FrameError>

Convenience helper: render dataframe (x, y) scatter plot directly to HTML figure snippet (alias for DataFrame::scatter_columns_to_html).

Source

pub fn scatter_columns_to_file<P: AsRef<Path>>( &self, x: &str, y: &str, path: P, ) -> Result<(), FrameError>

Convenience helper: save rendered dataframe (x, y) scatter plot directly to disk.

Source

pub fn scatter_xy_to_file<P: AsRef<Path>>( &self, x: &str, y: &str, path: P, ) -> Result<(), FrameError>

Convenience helper: save rendered dataframe (x, y) scatter plot directly to disk (alias for DataFrame::scatter_columns_to_file).

Source

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

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

Source

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

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

Source

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

Convenience helper: render dataframe 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 dataframe 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 dataframe KDE plot directly to deterministic SVG string.

Source

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

Convenience helper: render dataframe 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 dataframe KDE plot directly to disk.

Source

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

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

Source

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

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

Source

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

Convenience helper: render dataframe 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 dataframe 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 dataframe hexbin plot directly to deterministic SVG string.

Source

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

Convenience helper: render dataframe 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 dataframe hexbin plot directly to disk.

Source

pub fn hexbin_columns(&self, x: &str, y: &str) -> Result<PlotSpec, FrameError>

Return a backend-neutral pandas-style hexbin plot request for the specified (x, y) column pair.

Source

pub fn hexbin_xy(&self, x: &str, y: &str) -> Result<PlotSpec, FrameError>

Return a backend-neutral pandas-style hexbin plot request for the specified (x, y) column pair (alias for DataFrame::hexbin_columns).

Source

pub fn hexbin_columns_to_svg( &self, x: &str, y: &str, ) -> Result<String, FrameError>

Convenience helper: render dataframe (x, y) hexbin plot directly to deterministic SVG string.

Source

pub fn hexbin_xy_to_svg(&self, x: &str, y: &str) -> Result<String, FrameError>

Convenience helper: render dataframe (x, y) hexbin plot directly to deterministic SVG string (alias for DataFrame::hexbin_columns_to_svg).

Source

pub fn hexbin_columns_to_html( &self, x: &str, y: &str, ) -> Result<String, FrameError>

Convenience helper: render dataframe (x, y) hexbin plot directly to HTML figure snippet.

Source

pub fn hexbin_xy_to_html(&self, x: &str, y: &str) -> Result<String, FrameError>

Convenience helper: render dataframe (x, y) hexbin plot directly to HTML figure snippet (alias for DataFrame::hexbin_columns_to_html).

Source

pub fn hexbin_columns_to_file<P: AsRef<Path>>( &self, x: &str, y: &str, path: P, ) -> Result<(), FrameError>

Convenience helper: save rendered dataframe (x, y) hexbin plot directly to disk.

Source

pub fn hexbin_xy_to_file<P: AsRef<Path>>( &self, x: &str, y: &str, path: P, ) -> Result<(), FrameError>

Convenience helper: save rendered dataframe (x, y) hexbin plot directly to disk (alias for DataFrame::hexbin_columns_to_file).

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 plot_xy( &self, kind: PlotKind, x: &str, y: &str, ) -> Result<PlotSpec, FrameError>

Return a backend-neutral plot request for the specified plot kind and (x, y) column pair.

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 dataframe histogram directly to deterministic SVG string.

Source

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

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

Source

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

Convenience helper: save rendered dataframe 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 across all numerical columns.

Source

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

Convenience helper: render dataframe 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 dataframe 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 dataframe histogram with custom bins directly to disk.

Source

pub fn hist_columns( &self, columns: &[&str], bins: usize, ) -> Result<HistogramSpec, FrameError>

Return a backend-neutral histogram request restricted to the specified columns with custom bin count.

Source

pub fn hist_columns_to_svg( &self, columns: &[&str], bins: usize, ) -> Result<String, FrameError>

Convenience helper: render dataframe histogram for specified columns directly to deterministic SVG string.

Source

pub fn hist_columns_to_html( &self, columns: &[&str], bins: usize, ) -> Result<String, FrameError>

Convenience helper: render dataframe histogram for specified columns directly to HTML figure snippet.

Source

pub fn hist_columns_to_file<P: AsRef<Path>>( &self, columns: &[&str], bins: usize, path: P, ) -> Result<(), FrameError>

Convenience helper: save rendered dataframe histogram for specified columns directly to disk.

Source

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

Return a backend-neutral histogram request grouping a numeric column by values of another column (pandas df.hist(column=..., by=...)).

Source

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

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

Source

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

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

Source

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

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

Source

pub fn hist_columns_by( &self, columns: &[&str], by: &str, bins: usize, ) -> Result<HistogramSpec, FrameError>

Return a backend-neutral histogram request grouping multiple numeric columns by values of another column (pandas df.hist(column=[...], by=...)).

Source

pub fn hist_columns_by_to_svg( &self, columns: &[&str], by: &str, bins: usize, ) -> Result<String, FrameError>

Convenience helper: render dataframe multi-column grouped histogram directly to deterministic SVG string.

Source

pub fn hist_columns_by_to_html( &self, columns: &[&str], by: &str, bins: usize, ) -> Result<String, FrameError>

Convenience helper: render dataframe multi-column grouped histogram directly to HTML figure snippet.

Source

pub fn hist_columns_by_to_file<P: AsRef<Path>>( &self, columns: &[&str], by: &str, bins: usize, path: P, ) -> Result<(), FrameError>

Convenience helper: save rendered dataframe multi-column grouped histogram directly to disk.

Source

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

Return a backend-neutral histogram request grouping all numeric columns (excluding by) by values of by (pandas df.hist(by=...)).

Source

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

Convenience helper: render all-numeric-columns grouped histogram directly to deterministic SVG string.

Source

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

Convenience helper: render all-numeric-columns grouped histogram directly to HTML figure snippet.

Source

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

Convenience helper: save rendered all-numeric-columns grouped 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 DataFrame::boxplot).

Source

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

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

Source

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

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

Source

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

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

Source

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

Convenience helper: save rendered dataframe boxplot directly to disk.

Source

pub fn boxplot_columns( &self, columns: &[&str], ) -> Result<BoxPlotSpec, FrameError>

Return a backend-neutral boxplot request restricted to the specified columns.

Source

pub fn boxplot_columns_to_svg( &self, columns: &[&str], ) -> Result<String, FrameError>

Convenience helper: render dataframe boxplot for specified columns directly to deterministic SVG string.

Source

pub fn boxplot_columns_to_html( &self, columns: &[&str], ) -> Result<String, FrameError>

Convenience helper: render dataframe boxplot for specified columns directly to HTML figure snippet.

Source

pub fn boxplot_columns_to_file<P: AsRef<Path>>( &self, columns: &[&str], path: P, ) -> Result<(), FrameError>

Convenience helper: save rendered dataframe boxplot for specified columns directly to disk.

Source

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

Return a backend-neutral boxplot request grouping a numeric column by values of another column (pandas df.boxplot(column=..., by=...)).

Source

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

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

Source

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

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

Source

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

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

Source

pub fn boxplot_columns_by( &self, columns: &[&str], by: &str, ) -> Result<BoxPlotSpec, FrameError>

Return a backend-neutral boxplot request grouping multiple numeric columns by values of another column (pandas df.boxplot(column=[...], by=...)).

Source

pub fn boxplot_columns_by_to_svg( &self, columns: &[&str], by: &str, ) -> Result<String, FrameError>

Convenience helper: render dataframe multi-column grouped boxplot directly to deterministic SVG string.

Source

pub fn boxplot_columns_by_to_html( &self, columns: &[&str], by: &str, ) -> Result<String, FrameError>

Convenience helper: render dataframe multi-column grouped boxplot directly to HTML figure snippet.

Source

pub fn boxplot_columns_by_to_file<P: AsRef<Path>>( &self, columns: &[&str], by: &str, path: P, ) -> Result<(), FrameError>

Convenience helper: save rendered dataframe multi-column grouped boxplot directly to disk.

Source

pub fn boxplot_by_all(&self, by: &str) -> Result<BoxPlotSpec, FrameError>

Return a backend-neutral boxplot request grouping all numeric columns (excluding by) by values of by (pandas df.boxplot(by=...)).

Source

pub fn boxplot_by_all_to_svg(&self, by: &str) -> Result<String, FrameError>

Convenience helper: render all-numeric-columns grouped boxplot directly to deterministic SVG string.

Source

pub fn boxplot_by_all_to_html(&self, by: &str) -> Result<String, FrameError>

Convenience helper: render all-numeric-columns grouped boxplot directly to HTML figure snippet.

Source

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

Convenience helper: save rendered all-numeric-columns grouped boxplot directly to disk.

Source

pub fn parallel_coordinates( &self, class_column: &str, cols: Option<&[&str]>, ) -> Result<PlotSpec, FrameError>

Return a backend-neutral parallel coordinates plot request (pandas pandas.plotting.parallel_coordinates(frame, class_column, cols=...)).

Source

pub fn parallel_coordinates_to_svg( &self, class_column: &str, cols: Option<&[&str]>, ) -> Result<String, FrameError>

Convenience helper: render parallel coordinates plot directly to deterministic SVG string.

Source

pub fn parallel_coordinates_to_html( &self, class_column: &str, cols: Option<&[&str]>, ) -> Result<String, FrameError>

Convenience helper: render parallel coordinates plot directly to HTML figure snippet.

Source

pub fn parallel_coordinates_to_file<P: AsRef<Path>>( &self, class_column: &str, cols: Option<&[&str]>, path: P, ) -> Result<(), FrameError>

Convenience helper: save rendered parallel coordinates plot directly to disk.

Source

pub fn andrews_curves( &self, class_column: &str, samples: usize, ) -> Result<PlotSpec, FrameError>

Return a backend-neutral Andrews curves plot request (pandas pandas.plotting.andrews_curves(frame, class_column, samples=...)).

Source

pub fn andrews_curves_to_svg( &self, class_column: &str, samples: usize, ) -> Result<String, FrameError>

Convenience helper: render Andrews curves plot directly to deterministic SVG string.

Source

pub fn andrews_curves_to_html( &self, class_column: &str, samples: usize, ) -> Result<String, FrameError>

Convenience helper: render Andrews curves plot directly to HTML figure snippet.

Source

pub fn andrews_curves_to_file<P: AsRef<Path>>( &self, class_column: &str, samples: usize, path: P, ) -> Result<(), FrameError>

Convenience helper: save rendered Andrews curves plot directly to disk.

Source

pub fn radviz( &self, class_column: &str, cols: Option<&[&str]>, ) -> Result<PlotSpec, FrameError>

Return a backend-neutral RadViz plot request (pandas pandas.plotting.radviz(frame, class_column, cols=...)).

Source

pub fn radviz_to_svg( &self, class_column: &str, cols: Option<&[&str]>, ) -> Result<String, FrameError>

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

Source

pub fn radviz_to_html( &self, class_column: &str, cols: Option<&[&str]>, ) -> Result<String, FrameError>

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

Source

pub fn radviz_to_file<P: AsRef<Path>>( &self, class_column: &str, cols: Option<&[&str]>, path: P, ) -> Result<(), FrameError>

Convenience helper: save rendered RadViz plot directly to disk.

Source

pub fn scatter_matrix( &self, alpha: Option<f64>, diagonal: Option<&str>, range_padding: Option<f64>, ) -> Result<ScatterMatrixSpec, FrameError>

Return a backend-neutral scatter matrix plot request (pandas pandas.plotting.scatter_matrix(frame, ...)).

Source

pub fn scatter_matrix_with_cols( &self, cols: Option<&[&str]>, alpha: Option<f64>, diagonal: Option<&str>, range_padding: Option<f64>, ) -> Result<ScatterMatrixSpec, FrameError>

Return a backend-neutral scatter matrix plot request selecting explicit columns.

Source

pub fn scatter_matrix_to_svg( &self, alpha: Option<f64>, diagonal: Option<&str>, range_padding: Option<f64>, ) -> Result<String, FrameError>

Convenience helper: render scatter matrix directly to deterministic SVG string.

Source

pub fn scatter_matrix_to_html( &self, alpha: Option<f64>, diagonal: Option<&str>, range_padding: Option<f64>, ) -> Result<String, FrameError>

Convenience helper: render scatter matrix directly to HTML figure snippet.

Source

pub fn scatter_matrix_to_file<P: AsRef<Path>>( &self, path: P, alpha: Option<f64>, diagonal: Option<&str>, range_padding: Option<f64>, ) -> Result<(), FrameError>

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

Source

pub fn scatter_matrix_with_cols_to_svg( &self, cols: Option<&[&str]>, alpha: Option<f64>, diagonal: Option<&str>, range_padding: Option<f64>, ) -> Result<String, FrameError>

Convenience helper: render scatter matrix with explicit columns directly to deterministic SVG string.

Source

pub fn scatter_matrix_with_cols_to_html( &self, cols: Option<&[&str]>, alpha: Option<f64>, diagonal: Option<&str>, range_padding: Option<f64>, ) -> Result<String, FrameError>

Convenience helper: render scatter matrix with explicit columns directly to HTML figure snippet.

Source

pub fn scatter_matrix_with_cols_to_file<P: AsRef<Path>>( &self, cols: Option<&[&str]>, path: P, alpha: Option<f64>, diagonal: Option<&str>, range_padding: Option<f64>, ) -> Result<(), FrameError>

Convenience helper: save rendered scatter matrix with explicit columns directly to disk.

Source

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

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

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 DataFrame 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 DataFrame 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 DataFrame table directly to disk.

Source

pub fn from_series_with_columns( series_list: Vec<Series>, columns: Option<&[String]>, ) -> Result<Self, FrameError>

pd.DataFrame(dict_of_series, columns=[...]) — SELECT the named columns first, then align only those.

The order matters and is observable in the ROW COUNT. MEASURED, live pandas 2.2.3, with a indexed [1,2] and b indexed [2,3]:

pd.DataFrame({'a': a, 'b': b})                index [1, 2, 3]   the union
pd.DataFrame({'a': a, 'b': b}, columns=['b']) index [2, 3]      b's index ALONE
    b -> [30, 40]      int64, no gap invented, so no widening
pd.DataFrame({'a': a, 'b': b}, columns=['a','z'])
                                             index [1, 2]      a's index alone
    a -> [10, 20]      int64
    z -> [nan, nan]    OBJECT, an all-missing column for the absent name

Building the full union and projecting afterwards gives three rows where pandas gives two, and null-fills columns that pandas leaves intact. A name absent from the data contributes NO index labels — it becomes an all-missing column over whatever the present names span.

columns = None is the plain union, i.e. Self::from_series. (br-frankenpandas-oxodo, br-frankenpandas-fixture-divergence-triage-9s0c4)

Source

pub fn from_series(series_list: Vec<Series>) -> Result<Self, FrameError>

AG-05: Pre-compute N-way union index across all series first, then reindex each column exactly once. Eliminates O(N²) iterative realignment where N = number of series.

Source

pub fn from_dict( column_order: &[&str], data: Vec<(&str, Vec<Scalar>)>, ) -> Result<Self, FrameError>

Construct a DataFrame from a dict of column vectors.

Matches pd.DataFrame({"a": [1, 2], "b": [3, 4]}). All vectors must have the same length. Index is auto-generated as 0..n (RangeIndex-style).

column_order controls observable column label order.

Source

pub fn from_dict_with_columns( data: Vec<(&str, Vec<Scalar>)>, columns: Option<&[String]>, index_labels: Option<Vec<IndexLabel>>, ) -> Result<Self, FrameError>

Construct a DataFrame from dict-of-columns data under pandas’ columns= contract, with an optional explicit index.

Matches pd.DataFrame(dict, columns=..., index=...). This is NOT from_dict’s column_order, which is an ORDERING hint over columns that are all expected to exist: that one appends any dict key the caller did not list, and REJECTS a listed name that is absent. pandas’ columns= is a SELECTOR. Measured on live pandas 2.2.3 with d = {"a": [1, 2], "b": [3, 4]}:

pd.DataFrame(d, columns=["a", "z"])   -> a=[1,2], z=[nan,nan] (object)
pd.DataFrame(d, columns=["b"])        -> ONLY b; 'a' is DROPPED
pd.DataFrame(d, columns=["z", "y"])   -> shape (0, 2): no requested name
                                         exists, so there is no index to
                                         take a length from
pd.DataFrame(d, columns=[])           -> shape (0, 0)
pd.DataFrame(d, columns=[], index=[10, 20])   -> shape (2, 0)
pd.DataFrame(d, columns=["a"], index=[1,2,3]) -> ValueError (length)
pd.DataFrame({"a":[1,2],"b":[3]}, columns=["a"]) -> OK: an unselected
    ragged column is dropped BEFORE the equal-length check, while the
    same dict with no `columns=` raises "All arrays must be of the same
    length"

br-frankenpandas-oxodo: this contract had no owner in FrankenPandas. The conformance harness held a private copy of it (collect_dict_constructor_payloads) and got the first line wrong — it raised “column ‘z’ not found in data”, which pandas does not do — and the oracle carried the same invented rejection, so all three layers agreed on an error and fp_p2d_018 pinned it as truth. A user calling FrankenPandas could not express the operation the packet certified.

A repeated name in columns is preserved: pandas returns the column repeatedly, and ColumnStore preserves duplicate column labels.

Source

pub fn from_dict_index( data: Vec<(&str, Vec<Scalar>)>, ) -> Result<Self, FrameError>

Construct a DataFrame from a dict with orient='index'.

Matches pd.DataFrame.from_dict(data, orient='index'). Each key becomes a row index label, and each value is a list of column values. Column names default to 0, 1, 2, …

Source

pub fn from_dict_index_columns( data: Vec<(&str, Vec<Scalar>)>, column_names: &[&str], ) -> Result<Self, FrameError>

Construct a DataFrame from a dict with orient=‘index’ and custom column names.

Like from_dict_index but with explicit column names.

Source

pub fn from_list_like( matrix_rows: Vec<Vec<Scalar>>, column_order: Option<&[String]>, index_labels: Option<Vec<IndexLabel>>, ) -> Result<Self, FrameError>

pd.DataFrame([[...], [...]], columns=..., index=...).

The list-like constructor: short rows are padded with NaN and the padded column widens to float64, matching pandas. Added so the conformance harness can stop building this frame itself (br-frankenpandas-oxodo).

Source

pub fn from_records( records: Vec<Vec<Scalar>>, column_order: Option<&[String]>, index_labels: Option<Vec<IndexLabel>>, ) -> Result<Self, FrameError>

Construct a DataFrame from row-oriented list-like records.

Matches pd.DataFrame.from_records(data, columns=..., index=...) for tuple/list-style records. Short rows are null-filled; explicit columns may also introduce trailing all-null columns.

Source

pub fn from_scalar( value: &Scalar, index_labels: Vec<IndexLabel>, column_order: Option<&[String]>, ) -> Result<Self, FrameError>

Construct a DataFrame from row-oriented tuples.

Matches the rectangular tuple/list subset of pd.DataFrame.from_records(data, columns=...). Each inner Vec is a row; all rows must have the same length as columns. Construct a DataFrame by BROADCASTING one scalar over an index and a column set.

Matches pd.DataFrame(scalar, index=..., columns=...). Measured on pandas 2.2.3:

pd.DataFrame(5,    index=[0,1], columns=['a','b']) -> [[5,5],[5,5]] int64
pd.DataFrame(2.5,  index=[0,1], columns=['a'])     -> [[2.5],[2.5]] float64
pd.DataFrame('x',  index=[0,1], columns=['a'])     -> [['x'],['x']] object
pd.DataFrame(True, index=[0],   columns=['a'])     -> [[True]] bool
pd.DataFrame(5,    index=[],    columns=['a'])     -> shape (0,1), int64
pd.DataFrame(5,    index=[1,2], columns=[])        -> shape (2,0)
pd.DataFrame(5,    index=[0,1])                    -> ValueError:
    "DataFrame constructor not properly called!"   <- columns OMITTED

columns is Option because pandas draws a real distinction that a bare slice cannot express: an EXPLICIT empty list is legal and yields shape (n, 0), while OMITTING columns is an error — a bare scalar carries no labels to infer. Collapsing the two would make one of those two measured behaviours unreachable.

Added by br-frankenpandas-oxodo. The conformance harness had been building this frame ITSELF for eight dataframe_constructor_scalar fixtures, so the packet was green against an operation FrankenPandas did not actually expose.

Source

pub fn from_tuples( records: Vec<Vec<Scalar>>, columns: &[&str], ) -> Result<Self, FrameError>

Source

pub fn from_tuples_with_index( records: Vec<Vec<Scalar>>, columns: &[&str], index_labels: Vec<IndexLabel>, ) -> Result<Self, FrameError>

Construct a DataFrame from a list of row tuples with custom index.

Matches pd.DataFrame(data, columns=columns, index=index) for list-of-lists.

Source

pub fn from_dict_mixed( column_order: &[&str], data: Vec<(&str, DataFrameColumnInput)>, ) -> Result<Self, FrameError>

Construct a DataFrame from mixed dict inputs (Vec<Scalar> and scalar).

Scalar values are broadcast to the row count inferred from the first non-scalar column. If all inputs are scalar, an explicit index is required and this constructor rejects the operation.

Source

pub fn from_record_maps( records: Vec<BTreeMap<String, Scalar>>, column_order: Option<&[String]>, index_labels: Option<Vec<IndexLabel>>, ) -> Result<Self, FrameError>

Construct a DataFrame from mapping records.

Matches the mapping-record branch of pd.DataFrame.from_records(records, columns=..., index=...). Missing keys are null-filled. If column_order is provided, it is used as the exact output column selector/order and may include labels absent from the records (materialized as all-null columns).

Source

pub fn from_csv(text: &str, sep: char) -> Result<Self, FrameError>

Parse a CSV string into a DataFrame.

Matches pd.read_csv(StringIO(text)). The first line is treated as column headers. Values are auto-detected as Int64, Float64, Bool, or Utf8.

Source

pub fn from_csv_with_options( text: &str, options: &DataFrameCsvReadOptions, ) -> Result<Self, FrameError>

Parse a CSV string into a DataFrame with explicit parsing options.

Matches the pd.read_csv(..., header=..., dtype=..., index_col=..., na_values=...) shape for currently supported options.

Source

pub fn from_dict_with_index( data: Vec<(&str, Vec<Scalar>)>, index_labels: Vec<IndexLabel>, ) -> Result<Self, FrameError>

Construct a DataFrame from a dict of column vectors with an explicit index.

Matches pd.DataFrame({"a": [1, 2]}, index=["x", "y"]).

Source

pub fn from_dict_with_index_mixed( data: Vec<(&str, DataFrameColumnInput)>, index_labels: Vec<IndexLabel>, ) -> Result<Self, FrameError>

Construct a DataFrame from mixed dict inputs with an explicit index.

Scalar values are broadcast to the explicit index length.

Source

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

Return a new DataFrame with only the specified columns, in order.

Matches df[["a", "c"]] column selection in pandas, preserving repeated columns and duplicate column names.

Source

pub fn column_occurrences(&self, name: &str) -> usize

How many columns carry the label name (0 when none; more than one for a duplicated label, which df[name] selects as a frame).

Source

pub fn get_column_selection( &self, name: &str, ) -> Result<ColumnSelection, FrameError>

Single column indexing matching df[name] in pandas.

If name matches a single column, returns ColumnSelection::Series. If name matches multiple duplicate columns, returns ColumnSelection::DataFrame.

Source

pub fn len(&self) -> usize

Return the number of rows.

Source

pub fn is_empty(&self) -> bool

Return true if the DataFrame has zero rows.

Source

pub fn empty(&self) -> bool

Pandas-style .empty property: true iff the DataFrame contains zero rows OR zero columns.

Matches pd.DataFrame.empty. This is a stricter predicate than is_empty() — a frame with rows but no columns is still empty under pandas’ definition because there are no values to operate on.

Source

pub fn num_columns(&self) -> usize

Return the number of columns.

Source

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

Return (nrows, ncols) tuple.

Matches pd.DataFrame.shape.

Source

pub fn dtypes(&self) -> Result<Series, FrameError>

Return a Series of dtypes, one per column.

Matches pd.DataFrame.dtypes.

Source

pub fn copy(&self) -> Self

Return a deep copy of this DataFrame.

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

Source

pub fn keys(&self) -> MultiIndexOrIndex

Return the DataFrame info axis.

Matches pd.DataFrame.keys(). This is an alias for the column labels.

Source

pub fn index(&self) -> &Index

Source

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

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

Source

pub fn row_index(&self) -> MultiIndexOrIndex

Return the logical DataFrame row index.

When row MultiIndex metadata is present, this returns it instead of the flat storage fallback in index().

Source

pub fn row_multiindex(&self) -> Option<&MultiIndex>

The row MultiIndex: the frame’s own, else the levels its flat index carries (a frame built from a Series that had them).

Source

pub fn series_index(&self) -> Index

The row index a column of this frame carries as a Series: the flat labels, with the row MultiIndex levels attached when the frame has them, so df['v'] of a multi-key groupby result keeps its levels (br-frankenpandas-rc0923-epic-rust-parity-bugs-4qg5w.9).

Source

pub fn column_multiindex(&self) -> Option<&MultiIndex>

The COLUMN axis when it has more than one level, as df.groupby(k).agg({'x': ['sum','mean']}) and resample(...).ohlc() both produce. None means the flat column_order is the whole axis.

Sibling of Self::row_multiindex; the field already existed but had no reader outside this crate, so the conformance harness could not see a two-level column axis at all. (br-frankenpandas-nv5ct)

Source

pub fn columns(&self) -> &ColumnStore

Borrowed view of the column store.

Returns ColumnStore, not &BTreeMap<String, Column>: the concrete map type used to be part of this crate’s public API, which meant a duplicate-tolerant store could only be exposed by materializing a map per call — collapsing exactly the repeated labels the store exists to carry (br-frankenpandas-u387a). The view offers the same reads the map did (get, contains_key, keys, values, iter, len, is_empty, and [name] indexing), with iteration still NAME-SORTED.

Source

pub fn columns_index(&self) -> MultiIndexOrIndex

Return the logical DataFrame columns index.

Matches pd.DataFrame.columns, including MultiIndex columns for operations like groupby.ohlc().

Source

pub fn columns_multiindex(&self) -> Option<&MultiIndex>

Source

pub fn with_columns_multiindex( &self, multiindex: Option<MultiIndex>, ) -> Result<Self, FrameError>

This frame with multiindex as its column axis (None: the flat names), as pandas’ df.columns = MultiIndex sets it; the storage keys stay as they are, so its width must match the column count.

Source

pub fn column_names(&self) -> Vec<&String>

Return the flat storage column names in observable DataFrame order.

For the pandas-visible logical column index, including MultiIndex metadata, use columns_index().

Source

pub fn column_label(&self, name: &str) -> IndexLabel

The typed pandas label of the column keyed name (see column_key): 0 for DataFrame([[1, 2]])’s first column, the string itself for a string label.

Source

pub fn column_series_name(&self, name: &str) -> LabelName

The name a Series of the column keyed name takes: its typed label (DataFrame([[1, 2]])[0].name is the integer 0).

Source

pub fn column_labels(&self) -> Vec<IndexLabel>

Every column’s typed label, in column order.

Source

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

This frame with its columns labelled labels, one per column in order; each must key its column (column_key(label) is the name).

Source

pub fn with_recorded_column_labels( self, labels: impl IntoIterator<Item = IndexLabel>, ) -> Self

This frame recording labels as the typed labels of the columns they key (see column_key); a label keying no column is ignored.

Source

pub fn columns_name(&self) -> Option<&LabelName>

pandas’ df.columns.name: the column axis’ own name (a pivot’s is its columns column’s).

Source

pub fn with_columns_name<N: Into<LabelName>>(self, name: Option<N>) -> Self

This frame with its column axis named name (pandas’ rename_axis(columns=name); None unnames it). A LabelName keeps its typed label.

Source

pub fn with_value_labels(self, dtype: &DType) -> Self

This frame with its columns labelled by the dtype values their names print - for columns made from a column’s values (pivot’s, crosstab’s, get_dummies’): the column ‘5’ made from an int64 value is the integer 5, as in pandas (fvsao.32). A name that is not exactly such a value’s text stays a string.

Source

pub fn column_range_span(&self) -> Option<(i64, i64, i64)>

The range(start, stop, step) the column labels are when they are pandas’ default RangeIndex (DataFrame([[1, 2]]).columns), while the columns still are exactly that range.

Source

pub fn with_column_range(self, span: (i64, i64, i64)) -> Self

This frame’s columns marked as pandas’ default RangeIndex span (its integer labels recorded too).

Source

pub fn with_labels_of(self, source: &Self) -> Self

This frame with the typed column labels source records for the columns they share by name - for a result whose columns are some of source’s (a selection, a reordering, a row operation rebuilt from names), which dropped them (fvsao.32).

Source

pub fn with_column_levels(&self, series: Series) -> Series

series, indexed by (some of) this frame’s columns, with those columns’ MultiIndex levels attached: pandas indexes a row or a reduction of MultiIndex columns by that MultiIndex (df.iloc[0], df.sum() - the flat keys were the index; g3bux).

Source

pub fn with_typed_labels_of(self, source: &Self) -> Self

Self::with_labels_of without the RangeIndex mark, for a result pandas builds a new column Index for (describe’s, get_dummies’).

Source

pub fn columns_tz(&self) -> Option<&str>

The zone of datetime column labels (pandas’ df.columns.tz): a tz-aware row index transposed onto the columns keeps it.

Source

pub fn with_columns_tz(self, tz: Option<String>) -> Self

This frame with its datetime column labels read in tz (pandas’ df.columns.tz): a tz-aware DatetimeIndex given as the columns keeps its zone (the labels read the UTC clock; br-frankenpandas-e186m).

Source

pub fn column(&self, name: &str) -> Option<&Column>

Source

pub fn column_at(&self, position: usize) -> Option<&Column>

O(1) positional column access, the value counterpart to Self::column_name_at.

br-frankenpandas-3ya6b. Reading every column of a frame had no route that did not go through a label: callers had to ask column_name_at(i) for an OWNED String and hand it straight back to Self::column. On a transposed frame that label is a formatted integer, so the round trip per column was

  • i.to_string() — one allocation to make the label,
  • name.parse::<i64>() — to recover the position it came from, and
  • label.to_string() != name — a SECOND allocation to validate the round trip (see homogeneous_transpose_column_position),

to arrive back at the position the caller already had. A transposed frame has one output column per SOURCE ROW, so this is the one shape in the corpus where a per-column constant scales with the data: at 1M rows the old route pays ~2M allocations and ~1M parses before any column is materialized.

⚠️ THIS REMOVES A CONSTANT, NOT THE STRUCTURAL GAP. pandas answers df.T.to_numpy() from its 2D BlockManager and measured FLAT at 45.2/44.6/44.6us from 10k to 1M rows, while FrankenPandas must still build one Column per output column however it is addressed (br-frankenpandas-l4vzc). Do not expect this to change the SIGN of that comparison; if a measurement ever shows it doing so, l4vzc’s structural account is wrong and that is the interesting result.

Source

pub fn column_name_at(&self, position: usize) -> Option<String>

O(1) positional column-name access, matching df.columns[i] in pandas. Unlike column_names(), a lazily labeled column axis (a transposed frame’s Int64UnitRange order) formats just the requested label instead of materializing every label String.

Source

pub fn filter_rows(&self, mask: &Series) -> Result<Self, FrameError>

Filter rows where mask is True.

Matches df[bool_series] boolean indexing in pandas. The mask must be a Bool-typed Series. Indexes are aligned; missing mask values are treated as False.

Source

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

Return a DataFrame of booleans indicating missing values.

Matches df.isna().

Source

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

Return a DataFrame of booleans indicating non-missing values.

Matches df.notna().

Source

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

Alias for isna.

Matches df.isnull().

Source

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

Alias for notna.

Matches df.notnull().

Source

pub fn count(&self) -> Result<Series, FrameError>

Return non-missing counts for each column.

Matches df.count() default behavior (axis=0, skipna=True).

Source

pub fn count_na(&self) -> Result<Series, FrameError>

Count of missing (NaN/null) values per column.

Matches df.isna().sum(). Returns a Series indexed by column name.

Source

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

Fill missing values in each column with fill_value.

Matches df.fillna(value) for scalar value.

Source

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

Fill the first limit missing values of each column with fill_value (see Series::fillna_limit).

Matches df.fillna(value, limit=N).

Source

pub fn fillna_dict( &self, fill_map: &BTreeMap<String, Scalar>, ) -> Result<Self, FrameError>

Fill missing values with per-column values.

Matches df.fillna({'col1': val1, 'col2': val2}). Columns not listed in fill_map are left unchanged.

Source

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

Drop rows containing missing values in any selected column.

Matches default df.dropna() row-wise behavior (axis=0, how='any').

Source

pub fn dropna_with_options( &self, how: DropNaHow, subset: Option<&[String]>, ) -> Result<Self, FrameError>

Drop rows by configurable missing-value policy.

Matches df.dropna(how=..., subset=...) for row-wise mode (axis=0).

Source

pub fn dropna_with_threshold( &self, thresh: usize, subset: Option<&[String]>, ) -> Result<Self, FrameError>

Drop rows by minimum non-missing value count.

Matches df.dropna(thresh=..., subset=...) for row-wise mode (axis=0).

Source

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

Drop columns containing missing values in any row.

Matches default df.dropna(axis=1) behavior (how='any').

Source

pub fn dropna_columns_with_options( &self, how: DropNaHow, subset: Option<&[IndexLabel]>, ) -> Result<Self, FrameError>

Drop columns by configurable missing-value policy.

Matches df.dropna(axis=1, how=..., subset=...) where subset selects row labels to consider during missing-value checks.

Source

pub fn dropna_columns_with_threshold( &self, thresh: usize, subset: Option<&[IndexLabel]>, ) -> Result<Self, FrameError>

Drop columns by minimum non-missing value count.

Matches df.dropna(axis=1, thresh=..., subset=...) where subset selects row labels to consider.

Source

pub fn duplicated( &self, subset: Option<&[String]>, keep: DuplicateKeep, ) -> Result<Series, FrameError>

Return a boolean Series indicating duplicated rows.

Matches df.duplicated(subset=..., keep=...).

Uses hash-based O(n) deduplication instead of O(n²) pairwise comparison. Per br-frankenpandas-cclly performance optimization.

Source

pub fn drop_duplicates( &self, subset: Option<&[String]>, keep: DuplicateKeep, ignore_index: bool, ) -> Result<Self, FrameError>

Drop duplicated rows.

Matches df.drop_duplicates(subset=..., keep=..., ignore_index=...).

Source

pub fn head(&self, n: i64) -> Result<Self, FrameError>

Return the first n rows.

Matches df.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 df.tail(n). If n is negative, this returns all rows except the first -n rows.

Source

pub fn set_index(&self, column: &str, drop: bool) -> Result<Self, FrameError>

Set the DataFrame index from an existing column.

Matches df.set_index(column, drop=...) for a single column selector.

Source

pub fn set_index_with_verify_integrity( &self, column: &str, drop: bool, verify_integrity: bool, ) -> Result<Self, FrameError>

Set the DataFrame index from an existing column while optionally rejecting duplicate labels.

Source

pub fn set_index_multi( &self, columns: &[&str], drop: bool, sep: &str, ) -> Result<Self, FrameError>

Set the index from multiple columns, creating a composite index.

Matches df.set_index([col1, col2, ...]) in pandas. The composite index is formed from the tuple of values across the specified columns, formatted with the separator (default "/"). If drop is true (pandas default), the columns are removed from the DataFrame.

Source

pub fn set_index_append( &self, columns: &[&str], drop: bool, sep: &str, ) -> Result<Self, FrameError>

df.set_index(columns, append=True): a MultiIndex whose levels are the current index’s (every level of a row MultiIndex, keeping their names) followed by columns.

Source

pub fn to_multi_index(&self, columns: &[&str]) -> Result<MultiIndex, FrameError>

Extract a MultiIndex from the specified columns.

Does NOT modify the DataFrame. Returns a standalone MultiIndex that can be used for hierarchical indexing operations.

Source

pub fn reset_index(&self, drop: bool) -> Result<Self, FrameError>

Reset the index to a default RangeIndex.

Matches df.reset_index(drop=...) for the single-index DataFrame model.

Source

pub fn reset_index_allow_duplicates( &self, drop: bool, allow_duplicates: bool, ) -> Result<Self, FrameError>

df.reset_index(drop=..., allow_duplicates=...): with allow_duplicates an index column may take a label a column already has (pandas’ insert rule), where without it that is pandas’ “cannot insert X, already exists” (br-frankenpandas-n57tz: allow_duplicates was refused).

Source

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

Return a new DataFrame sorted by index labels.

Matches df.sort_index(ascending=...) for 1D index labels.

Source

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

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

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

Source

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

Sort the DataFrame by its column labels (axis=1).

Matches df.sort_index(axis=1, ascending=...): the labels themselves - a column MultiIndex level by level, typed labels by value (2 before 10) - not the storage names as text, which put the column 10 before 2 and a pivot_table’s (v, 10) before (v, 2) (br-frankenpandas-xbl2k). Stable; a repeated name keeps its columns together in their order.

Source

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

Return a new DataFrame sorted by a column’s values.

Matches df.sort_values(by=column, ascending=...) for a single column key with default na_position='last'.

Source

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

Return a new DataFrame sorted by a column’s values with explicit NA position.

Matches df.sort_values(by=column, ascending=..., na_position='first'|'last').

Source

pub fn sort_values_multi( &self, by: &[&str], ascending: &[bool], na_position: &str, ) -> Result<Self, FrameError>

Sort by multiple columns with per-column ascending flags.

Matches df.sort_values(by=[...], ascending=[...], na_position='first'|'last'). na_position defaults to “last”.

Source

pub fn sort_values_at( &self, positions: &[usize], ascending: &[bool], na_position: &str, ) -> Result<Self, FrameError>

Sort by the columns AT positions (per-key ascending flags): a key under a repeated column key - a MultiIndex column whose leaf name repeats, (‘q’, ‘e’) beside (‘p’, ‘e’) - sorts by its own column (i17d4; by name it sorted by the first).

Source

pub fn loc(&self, labels: &[IndexLabel]) -> Result<Self, FrameError>

Label-based row selection for list-like indexers.

Matches df.loc[[...]] for list selectors. Requested labels are returned in selector order and duplicate labels are preserved. Missing labels fail closed.

Source

pub fn loc_with_columns( &self, labels: &[IndexLabel], column_selector: Option<&[String]>, ) -> Result<Self, FrameError>

Label-based row+column selection for list-like indexers.

Matches df.loc[[...], [...]] for list selectors. Requested rows are returned in selector order and duplicate row labels are preserved. Missing labels/columns fail closed.

Source

pub fn loc_tuple(&self, key: &[IndexLabel]) -> Result<Self, FrameError>

Tuple-/prefix-key row selection against a row MultiIndex.

Exact tuple keys ([lvl0, lvl1, ...]) match full composite rows. Shorter keys act as prefix selection, mirroring df.loc[(a, slice(None))] for the leading levels.

Source

pub fn loc_tuple_with_columns( &self, key: &[IndexLabel], column_selector: Option<&[String]>, ) -> Result<Self, FrameError>

Tuple-/prefix-key row selection with an optional column subset.

Source

pub fn get_loc( &self, key: &[IndexLabel], level: Option<usize>, ) -> Result<Vec<usize>, FrameError>

Return row positions for a row-MultiIndex tuple or a single level key.

level=None performs exact or prefix tuple lookup depending on key arity. level=Some(n) performs a single-label lookup on the N-th level.

Source

pub fn get_loc_level( &self, key: &[IndexLabel], ) -> Result<(Vec<usize>, Option<MultiIndexOrIndex>), FrameError>

pandas-style tuple lookup returning matching positions and the remaining row index.

Source

pub fn iloc(&self, positions: &[i64]) -> Result<Self, FrameError>

Position-based row selection for list-like indexers.

Matches df.iloc[[...]] for list selectors. Requested positions are returned in selector order and duplicates are preserved. Negative positions are resolved from the end of the DataFrame.

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): df.iloc[start::step] as Python’s slice.indices resolves it.

The rows are an arithmetic index and each all-valid float64 column a strided view of its buffer, as pandas’ slice is a numpy view; every stepped slice built, normalized and gathered a list of positions (df.iloc[::-1] 8.6 ms a million rows by three columns, pandas 0.008; br-frankenpandas-e00f7). Other columns gather the rows.

§Errors

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

Source

pub fn iloc_with_columns( &self, positions: &[i64], column_selector: Option<&[String]>, ) -> Result<Self, FrameError>

Position-based row+column selection for list-like indexers.

Matches df.iloc[[...], [...]] for list selectors. Requested rows are returned in selector order and duplicates are preserved. Missing columns fail closed.

Source

pub fn loc_bool(&self, mask: &[bool]) -> Result<Self, FrameError>

Boolean mask row selection.

Matches df.loc[bool_array] in pandas. The boolean mask must have the same length as the DataFrame. Rows where the mask is True are kept.

Source

pub fn iloc_bool(&self, mask: &[bool]) -> Result<Self, FrameError>

Boolean mask row selection (position-based).

Matches df.iloc[bool_array] in pandas. Semantically identical to loc_bool for DataFrames (the mask selects rows by position either way).

Source

pub fn loc_bool_series(&self, mask: &Series) -> Result<Self, FrameError>

Boolean Series mask row selection with index alignment.

Matches df.loc[bool_series] in pandas, the most common usage pattern (e.g., df.loc[df['col'] > 5]). The mask Series is aligned with the DataFrame by index before filtering. Missing mask values are treated as False. This is an alias for DataFrame::filter_rows.

Source

pub fn iloc_bool_series(&self, mask: &Series) -> Result<Self, FrameError>

Position-based boolean Series mask row selection.

Matches df.iloc[bool_series] in pandas 2.2.3, which refuses a Series mask (NotImplementedError for an integer index, ValueError otherwise; br-frankenpandas-qs8b6).

Source

pub fn loc_slice( &self, start: Option<&IndexLabel>, stop: Option<&IndexLabel>, ) -> Result<Self, FrameError>

Label-based slice row selection (inclusive on both ends).

Matches df.loc[start:stop] in pandas. Both endpoints are inclusive (pandas label-slicing semantics). Either may be None to mean “from the beginning” or “to the end”.

Source

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

The row positions .loc[start:stop] selects, resolved as Self::loc_slice resolves them - for callers that write through them (df.loc[a:b, col] = value).

Source

pub fn iloc_slice( &self, start: Option<i64>, stop: Option<i64>, ) -> Result<Self, FrameError>

Position-based slice row selection (exclusive end).

Matches df.iloc[start:stop] in pandas. The start is inclusive and stop is exclusive (Python slice semantics). Negative values are resolved from the end. Both are optional.

Source

pub fn loc_row(&self, label: &IndexLabel) -> Result<Series, FrameError>

Return a single row as a Series by label.

Matches df.loc[label] when label is a scalar in pandas. The returned Series has the DataFrame’s column names as its index and the row values as data.

Source

pub fn loc_row_tuple(&self, key: &[IndexLabel]) -> Result<Series, FrameError>

Return a single row as a Series by exact row-MultiIndex tuple.

Source

pub fn iloc_row(&self, position: i64) -> Result<Series, FrameError>

Return a single row as a Series by position.

Matches df.iloc[n] when n is a scalar in pandas. The returned Series has the DataFrame’s column names as its index and the row values as data.

Source

pub fn with_column( &self, name: impl Into<String>, column: Column, ) -> Result<Self, FrameError>

Add or replace a column.

Matches df['new_col'] = values.

Source

pub fn astype_columns( &self, mapping: &[(&str, DType)], ) -> Result<Self, FrameError>

Cast one or more columns to target dtypes.

Matches mapping-style df.astype({"a": dtype_a, "b": dtype_b}). Mapping order is processed deterministically and duplicate selectors are rejected.

Source

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

Cast a single column to a target dtype.

Matches df.astype({"col": dtype}) for single-column mapping.

Source

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

Cast the column name to a numpy dtype narrower than 64 bits (df.astype({'a': 'int16'})), as Series::astype_width.

Source

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

Cast every column to a numpy dtype narrower than 64 bits (df.astype('int32')), as Series::astype_width.

Source

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

Cast all columns to a single target dtype.

Matches df.astype(dtype) (scalar form).

Source

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

Apply the CONSTRUCTOR’s dtype= argument to every column.

Matches the dtype= parameter of pd.DataFrame(data, dtype=...), which is deliberately NOT the same operation as Self::astype even though both name a target dtype. Measured on pandas 2.2.3:

pd.DataFrame([[1.5]], dtype='int64')     -> ValueError: Trying to coerce
                                            float values to integers
pd.DataFrame([[1.5]]).astype('int64')    -> [[1]]   <- TRUNCATES
pd.DataFrame([[2.0]], dtype='int64')     -> [[2]]   <- lossless is fine

So the constructor REFUSES a lossy float->int while astype truncates toward zero. Column::new already encodes the strict rule (br-frankenpandas-8nupg), and this is its frame-level composition.

It exists as its own method rather than reusing astype because the two only COINCIDE today: Self::astype currently also goes through Column::new without pre-truncating, so it inherits the strict rule. The moment astype is corrected to truncate, a constructor path routed through it would silently start truncating too — a divergence nothing would catch. Keeping them separate makes that fix safe.

Added by br-frankenpandas-oxodo: the conformance harness had been applying constructor dtype= ITSELF, so every constructor_dtype fixture was green against a capability FrankenPandas did not expose. Apply the DataFrame constructor’s dtype= to every column.

A NON-NULLABLE int64 REFUSES A MISSING VALUE. numpy’s int64 has no NA representation, and pandas aborts the whole construction rather than inventing one - it does NOT fall back to a nullable dtype or to NaN. br-frankenpandas-v1zy1. MEASURED, live pandas 2.2.3, on [[True, None], [False, True]]:

dtype=pandaswhy
int64TypeErrornumpy int64 cannot hold NA
Int64[1, <NA>]the nullable extension dtype can
float64[1.0, nan]NaN IS float64’s missing value
Float64[1.0, <NA>]extension dtype
str['True', None]the missing value SURVIVES the cast
string['True', <NA>]ditto, as the extension dtype
bool[True, False]COERCED by truthiness; bool has no NA
boolean[True, <NA>]extension dtype

THE THREE FAMILIES RESOLVE THE SAME PROBLEM THREE DIFFERENT WAYS, which is why there is no single “non-nullable dtypes reject missing values” rule: int64 RAISES, bool COERCES, float64 has NaN as its own missing value.

A STRING CAST PRESERVES MISSINGNESS HERE AND ONLY HERE. astype(str) genuinely does stringify - measured, pd.Series([True, None]).astype(str) is ['True', 'None'] - so the shared cast in Column::new is RIGHT for astype and wrong only for the constructor, which is why this method restores the missing values rather than the cast being changed. br-frankenpandas-constructor-utf8-null-stringified-r1bbv.

Before this check FrankenPandas returned [1, Null] for BOTH spellings, so int64 and Int64 were behaviourally identical at the constructor and no value fixture could detect them being confused - which is why br-frankenpandas-jozfk’s spec-resolution fix, correct on its own terms, did not make the corpus able to catch a regression that reverted it.

The check lives HERE and deliberately NOT in Column::new: numpy-int64 semantics are a property of the CONSTRUCTOR’s dtype=, while Column::new is shared with astype and with internal builders that legitimately pair DType::Int64 with missing values.

Source

pub fn tz_localize(&self, tz: Option<&str>) -> Result<Self, FrameError>

Localize tz-naive datetime columns to a timezone or strip timezone info.

Matches the supported subset of pd.DataFrame.tz_localize(tz). Walks every Utf8-typed column whose values look like ISO-8601 datetime strings and applies DatetimeAccessor::tz_localize column-by-column. Non-Utf8 columns and Utf8 columns whose contents don’t parse as datetimes are passed through unchanged. Per br-frankenpandas-6iac0.

Note: pandas’ DataFrame.tz_localize operates on the index axis by default; this implementation deviates by walking column VALUES because fp-index doesn’t yet have a dedicated DatetimeIndex variant (tracked separately under br-frankenpandas-t8hz0). When the DatetimeIndex variant lands, this method should grow an axis parameter.

Source

pub fn tz_localize_with_options( &self, tz: Option<&str>, options: TzLocalizeOptions, ) -> Result<Self, FrameError>

Localize tz-naive datetime columns with explicit DST policy.

Matches the supported subset of pd.DataFrame.tz_localize(tz, ambiguous=..., nonexistent=...). Same column-walking rules as Self::tz_localize.

Source

pub fn tz_convert(&self, tz: Option<&str>) -> Result<Self, FrameError>

Convert timezone-aware datetime columns to a different timezone.

Matches the supported subset of pd.DataFrame.tz_convert(tz). Walks every Utf8 datetime-string column and applies DatetimeAccessor::tz_convert column-by-column. Non-Utf8 columns are passed through; columns whose values are tz-naive (no offset suffix) raise an error matching pandas’ “Cannot convert tz-naive timestamps, use tz_localize” message. Per br-frankenpandas-6iac0.

Same axis-deviation note as Self::tz_localize.

Source

pub fn to_period(&self, freq: &str) -> Result<Self, FrameError>

Convert a datetime-like row index to period-style labels.

Matches the row-index default of pd.DataFrame.to_period(freq) for the supported Y, Q, M, W, D, B, H, T/min, and S frequencies. FrankenPandas stores the converted labels in the existing flat Index as canonical period strings until a dedicated Period label variant lands.

Source

pub fn to_timestamp(&self, freq: &str, how: &str) -> Result<Self, FrameError>

Convert period-style row index labels to timestamp labels.

Matches the row-index default of pd.DataFrame.to_timestamp(freq, how) for the supported Y, Q, M, D, H, T/min, and S frequencies. Until FrankenPandas has a dedicated PeriodIndex label type, this accepts the canonical period strings emitted by Self::to_period.

Source

pub fn astype_columns_safe( &self, mapping: &[(&str, DType)], errors: &str, ) -> Result<Self, FrameError>

Cast one or more columns with error handling.

Matches df.astype({"a": dtype}, errors='coerce'|'raise'|'ignore').

  • errors="raise" (default): propagate conversion errors
  • errors="coerce": values that fail conversion become NaN
  • errors="ignore": return the original DataFrame unchanged on error
Source

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

Cast all columns with error handling.

Matches df.astype(dtype, errors='coerce'|'raise'|'ignore').

Source

pub fn drop_column(&self, name: &str) -> Result<Self, FrameError>

Remove a column by name, returning the modified DataFrame.

Matches df.drop(columns=['col']).

Source

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

Drop multiple columns at once.

Matches df.drop(columns=[...]). Returns error if any column is missing.

Source

pub fn filter( &self, items: Option<&[&str]>, like: Option<&str>, regex: Option<&str>, ) -> Result<Self, FrameError>

Filter the DataFrame by column-label patterns.

Matches pd.DataFrame.filter(items=None, like=None, regex=None, axis=1) (column-axis filter). Exactly one of items, like, or regex must be Some; the others must be None. Per br-frankenpandas-nk54a.

  • items: Some(list): keep columns whose names appear in list, in list order. Missing names are silently dropped (matches pandas).
  • like: Some(substr): keep columns whose names contain substr.
  • regex: Some(pattern): keep columns whose names match the regex.

Use DataFrame::filter_axis with axis=0 for row-index label matching.

Source

pub fn filter_axis( &self, items: Option<&[&str]>, like: Option<&str>, regex: Option<&str>, axis: usize, ) -> Result<Self, FrameError>

Filter rows or columns by label.

Matches pd.DataFrame.filter(items=None, like=None, regex=None, axis=...).

  • axis=0: filter rows by row-index label string form.
  • axis=1: filter columns by column label.

Exactly one of items, like, or regex must be provided. items preserves the caller-provided item order and silently drops missing labels.

Source

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

pandas-named column rename alias.

Matches df.rename(columns={'old': 'new'}) for mapping-style column renames.

Source

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

Rename columns using a mapping.

Matches df.rename(columns={'old': 'new'}).

Source

pub fn rename_columns_map( &self, mapping: &HashMap<String, String>, ) -> Result<Self, FrameError>

Rename columns using a HashMap mapping.

Convenience wrapper matching df.rename(columns={...}) semantics. Only columns present in the mapping are renamed; others are kept as-is.

Source

pub fn rename_with<F>(&self, func: F) -> Result<Self, FrameError>
where F: Fn(&str) -> String,

Rename columns using a mapper function.

Matches df.rename(columns=func). Applies the function to each column name.

Source

pub fn rename_index(&self, mapping: &[(IndexLabel, IndexLabel)]) -> Self

Rename index labels using a mapping.

Matches df.rename(index={...}). Labels not in the mapping are left unchanged.

Source

pub fn rename_index_with<F>(&self, func: F) -> Self
where F: Fn(&IndexLabel) -> IndexLabel,

Rename index labels using a function.

Matches df.rename(index=func). Applies the function to each index label.

Source

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

Rename the row index axis.

Matches pd.DataFrame.rename_axis(name) for flat row indexes.

Source

pub fn add_prefix(&self, prefix: &str) -> Result<Self, FrameError>

Add a prefix to all column names.

Matches df.add_prefix(prefix).

Source

pub fn add_suffix(&self, suffix: &str) -> Result<Self, FrameError>

Add a suffix to all column names.

Matches df.add_suffix(suffix).

Source

pub fn add_prefix_axis( &self, prefix: &str, axis: usize, ) -> Result<Self, FrameError>

Add a prefix to labels along the chosen axis.

Matches df.add_prefix(prefix, axis=...). axis=0 prefixes the index (labels are stringified), axis=1 prefixes column names.

Source

pub fn add_suffix_axis( &self, suffix: &str, axis: usize, ) -> Result<Self, FrameError>

Add a suffix to labels along the chosen axis.

Matches df.add_suffix(suffix, axis=...). axis=0 suffixes the index (labels are stringified), axis=1 suffixes column names.

Source

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

Summary statistics for numeric columns.

Matches df.describe() — returns a DataFrame with index [count, mean, std, min, 25%, 50%, 75%, max] and one column per numeric input column.

Source

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

Describe with custom percentiles.

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

Source

pub fn describe_dtypes( &self, include: &[&str], exclude: &[&str], ) -> Result<Self, FrameError>

Describe with include/exclude dtype filters.

Matches df.describe(include=[...], exclude=[...]). Pass empty slices to use defaults (numeric only). Supported dtype strings: “int64”, “float64”, “bool”, “object”/“string”.

Source

pub fn quantile(&self, q: f64) -> Result<Series, FrameError>

Compute quantile(s) for each numeric column.

Matches df.quantile(q) for a single quantile value. Returns a Series indexed by column names.

Source

pub fn apply<A>(&self, func: A, axis: usize) -> Result<A::Output, FrameError>

Apply either a built-in reducer name or a user closure along an axis.

  • df.apply("sum", 0) returns a Series.
  • df.apply(|vals| ..., 1) returns a single-column DataFrame.
Source

pub fn transpose_view( &self, ) -> Result<Option<DataFrameTransposeView<'_>>, FrameError>

Transpose the DataFrame: rows become columns, columns become rows.

Matches df.T / df.transpose(). Column names become the index of the result, and the original index labels become column names (converted to strings).

Source

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

Source

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

Alias for transpose().

Matches df.T in pandas.

Source

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

Uppercase pandas spelling for Self::transpose.

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

Source

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

Return row-major scalar values.

Matches pd.DataFrame.values at the API-shape level. Unlike Self::to_numpy, this preserves non-numeric scalar values.

Source

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

Per-column product alias.

Matches pd.DataFrame.product() as an alias of prod().

Source

pub fn product_with_numeric_only( &self, numeric_only: bool, ) -> Result<Series, FrameError>

df.product(numeric_only=...), the alias’s sibling of Self::prod_with_numeric_only. An alias must offer the same options as the method it aliases, or callers get a silently narrower API on one spelling. (br-frankenpandas-reductions-numeric-only-default-zx21n)

Source

pub fn get(&self, key: &str) -> Result<Option<Series>, FrameError>

Dict-like column lookup.

Matches pd.DataFrame.get(key) by returning None instead of an error for a missing column.

Source

pub fn get_or(&self, key: &str, default: Series) -> Result<Series, FrameError>

Dict-like column lookup with a fallback Series.

Matches pd.DataFrame.get(key, default) for Series defaults.

Source

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

Extract the single boolean value from a 1x1 DataFrame.

Matches pd.DataFrame.bool(). Raises unless the DataFrame has exactly one row, one column, and that cell is a boolean scalar.

Source

pub fn attrs(&self) -> BTreeMap<String, Scalar>

User metadata mapping.

Matches pd.DataFrame.attrs shape. FrankenPandas does not yet persist mutable attrs on the DataFrame storage object, so the current accessor returns the default empty metadata map.

Source

pub fn flags(&self) -> DataFrameFlags

DataFrame flags metadata.

Matches pd.DataFrame.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 DataFrame with updated flags.

Matches pd.DataFrame.set_flags(allows_duplicate_labels=...) for the duplicate-label flag.

Source

pub fn style(&self) -> StyledDataFrame<'_>

Styling accessor for DataFrame HTML and text rendering helpers.

Matches pd.DataFrame.style as a typed accessor over the current DataFrame. The current implementation supports practical table rendering methods such as StyledDataFrame::to_html, StyledDataFrame::to_string_table, and classed HTML output.

Source

pub fn sparse(&self) -> SparseDataFrameView<'_>

Sparse accessor for DataFrame density and dense materialization helpers.

Matches pd.DataFrame.sparse as a typed accessor over the current DataFrame. The view exposes stored-value counts, density metrics, caller-provided fill-value variants, and SparseDataFrameView::to_dense.

Source

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

Swap axes (rows and columns).

Matches df.swapaxes('index', 'columns'). Alias for transpose().

Source

pub fn lookup( &self, row_labels: &[IndexLabel], col_labels: &[&str], ) -> Result<Vec<Scalar>, FrameError>

Label-based element lookup.

Matches df.lookup(row_labels, col_labels). Returns a Vec of Scalars where element i is the value at (row_labels[i], col_labels[i]).

Source

pub fn with_column_keys(&self, keys: Vec<String>) -> Result<Self, FrameError>

This frame with its columns keyed keys, position for position, over the same rows and row MultiIndex (the typed column labels, column MultiIndex and axis name dropped): stand-in keys for an operation that finds columns by name, so repeated keys stay apart (i17d4).

§Errors

LengthMismatch when keys does not name every column.

Source

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

Matches df.where(cond, other). Applies element-wise to each column. If other is None, replaced values become NaN.

Source

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

pandas-named alias for Self::where_cond. Matches df.where(cond, other).

Per br-frankenpandas-nk54a. where would conflict with the Rust keyword in where clauses if used as an identifier in some contexts, but it’s not a reserved identifier — the inherent method works directly. Provided as a pandas-faithful alias.

Source

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

Replace values where cond is True with other.

Matches df.mask(cond, other). Inverse of where_cond.

Source

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

Keep values where cond is True, replacing False positions with corresponding values from other DataFrame.

Matches df.where(cond, other=df).

Source

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

Replace values where cond is True with corresponding values from other DataFrame.

Matches df.mask(cond, other=df).

Source

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

Symmetry alias for where_cond_df (br-frankenpandas-df9v7 / fd90.138, refactored in br-frankenpandas-a2sck / fd90.139).

mask_df_other already existed but no parallel-named where_* was reachable from a mask_df_other callsite without remembering the where_cond_df name. This alias makes the symmetry explicit; both names dispatch through the same implementation. Prefer where_cond_df in new code.

Source

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

Iterate over rows as (IndexLabel, Vec<(&str, Scalar)>) pairs.

Matches df.iterrows(). Returns an iterator over (index_label, row_data) where row_data is a vector of (column_name, value) pairs.

Source

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

Iterate over rows as tuples of (IndexLabel, Vec<Scalar>).

Matches df.itertuples(). Returns (index_label, values_in_column_order).

Source

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

Convert DataFrame to a list of record tuples.

Matches df.to_records(). Each record is a Vec of Scalar where the first element is the index label (converted to Scalar) followed by each column value in column order.

Source

pub fn to_numpy_2d(&self) -> Vec<Vec<f64>>

Convert numeric columns to a 2D Vec<Vec<f64>>.

Matches df.to_numpy(). Rows are outer, columns are inner. Non-numeric values become f64::NAN.

Source

pub fn items(&self) -> Result<Vec<(String, Series)>, FrameError>

Iterate over columns as (column_name, Series) pairs.

Matches df.items() / df.iteritems().

§Panics

Panics if self.column_order references a column that is absent from self.columns, which indicates internal DataFrame metadata corruption.

Source

pub fn iteritems(&self) -> Result<Vec<(String, Series)>, FrameError>

👎Deprecated:

use items() instead

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

Source

pub fn assign( &self, assignments: Vec<(&str, Column)>, ) -> Result<Self, FrameError>

Assign new or overwrite existing columns.

Matches df.assign(**kwargs). Takes a list of (column_name, Column) pairs. Existing columns are replaced; new columns are appended.

Source

pub fn assign_fn( &self, assignments: Vec<(&str, Box<dyn Fn(&DataFrame) -> Result<Column, FrameError>>)>, ) -> Result<Self, FrameError>

Assign new columns computed from the DataFrame via closures.

Matches df.assign(col=lambda df: ...). Each closure receives a reference to the current DataFrame (including previously-assigned columns in this call) and must return a Column of the correct length.

Source

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

Apply a transformation function to the DataFrame.

Matches df.pipe(func). The function receives a reference to self and returns a new DataFrame.

Source

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

Rank values in each column of the DataFrame.

Applies Series::rank independently to each column.

Source

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

Rank values in each column of the DataFrame and optionally scale them to percentile ranks.

Source

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

Ranks values across columns for each row independently.

Matches pd.DataFrame.rank(axis=1).

Source

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

Rank values across columns for each row and optionally scale them to percentile ranks.

Source

pub fn melt( &self, id_vars: &[&str], value_vars: &[&str], var_name: Option<&str>, value_name: Option<&str>, ) -> Result<Self, FrameError>

Unpivot (melt) a DataFrame from wide to long format.

id_vars: columns to keep as identifiers value_vars: columns to unpivot (if empty, uses all non-id columns) var_name: name for the variable column (default “variable”) value_name: name for the value column (default “value”)

Source

pub fn pivot_table( &self, values: &str, index_col: &str, columns_col: &str, aggfunc: &str, ) -> Result<Self, FrameError>

Pivot table: aggregate values grouped by index and column keys.

values: column containing values to aggregate index_col: column to use as the new row index columns_col: column whose unique values become new columns aggfunc: aggregation function (“mean”, “sum”, “count”, “size”, “min”, “max”, “first”, “last”)

Source

pub fn pivot_table_with_dropna( &self, values: &str, index_col: &str, columns_col: &str, aggfunc: &str, dropna: bool, ) -> Result<Self, FrameError>

Pivot table with explicit control over whether missing index/column keys are dropped before aggregation.

Matches df.pivot_table(..., dropna=...) for the core single-value case. The default pivot_table() wrapper uses dropna=true.

Source

pub fn pivot_table_fill( &self, values: &str, index_col: &str, columns_col: &str, aggfunc: &str, fill_value: f64, ) -> Result<Self, FrameError>

Create a pivot table with a fill_value for missing cells.

Matches df.pivot_table(values, index, columns, aggfunc, fill_value=v).

Source

pub fn pivot_table_multi_values( &self, values: &[&str], index_col: &str, columns_col: &str, aggfunc: &str, ) -> Result<Self, FrameError>

Create a pivot table with multiple value columns.

Matches df.pivot_table(values=['col1','col2'], index=..., columns=..., aggfunc=...). Column names in the result are formatted as “value_column_pivot_value” (e.g. “sales_East”, “profit_East”).

⚠️ THE VALUE GROUPS COME OUT IN NAME ORDER, NOT ARGUMENT ORDER, and that is pandas’ rule rather than a convenience. br-frankenpandas-eay9h. MEASURED, live pandas 2.2.3, one frame, both spellings of values:

callresult
values=["sales","profit"] sort=Trueprofit_A profit_B sales_A sales_B
values=["profit","sales"] sort=Trueprofit_A profit_B sales_A sales_B
values=["sales","profit"] sort=Falsesales_A sales_B profit_A profit_B
values=["profit","sales"] sort=Falsesales_A sales_B profit_A profit_B

pandas DOES NOT MOVE when the caller reorders values: sort=True (its DEFAULT) is alphabetical by value name and sort=False preserves the FRAME’s column order. This method exposes no sort knob, so it implements the default. Iterating values in argument order – what this did until eay9h – agrees with pandas only when the caller happens to pass the value names already sorted.

Source

pub fn pivot_table_aggfunc_dict( &self, value_aggs: &[(&str, &str)], index_col: &str, columns_col: &str, ) -> Result<Self, FrameError>

Create a pivot table where each value column uses its own aggregation.

Matches df.pivot_table(values=[...], index=..., columns=..., aggfunc={'col1':'sum','col2':'mean'}). Each (value_col, aggfunc) entry is pivoted independently and the result columns are prefixed with the value column name ({value_col}_{pivot_column}), matching the layout of pivot_table_multi_values – including its NAME ordering. Duplicate value column names are rejected (a dict has unique keys). Missing columns and unsupported aggfuncs propagate from the single-value pivot_table call.

⚠️ Same rule, measured separately on live pandas 2.2.3 because the dict form does NOT follow the list form when sort=False (there it keeps the dict’s own key order, where the list form takes the frame’s column order). Under pandas’ sort=True DEFAULT, which is what this implements, both are alphabetical and neither moves when the caller reorders the argument:

callresult
aggfunc={"zeta":"sum","alpha":"mean"}alpha_A alpha_B zeta_A zeta_B
aggfunc={"alpha":"mean","zeta":"sum"}alpha_A alpha_B zeta_A zeta_B

br-frankenpandas-eay9h.

Source

pub fn pivot_table_with_margins( &self, values: &str, index_col: &str, columns_col: &str, aggfunc: &str, margins: bool, ) -> Result<Self, FrameError>

Create a pivot table with optional margin totals.

Matches df.pivot_table(values, index, columns, aggfunc, margins=True). When margins is true, appends an “All” row and “All” column with totals computed using the same aggregation function.

Source

pub fn pivot_table_with_margins_name( &self, values: &str, index_col: &str, columns_col: &str, aggfunc: &str, margins: bool, margins_name: &str, ) -> Result<Self, FrameError>

Pivot table with margins and a customizable margin label.

Like pivot_table_with_margins but allows specifying the label used for the margin row/column (default is “All” in pandas).

Source

pub fn agg( &self, funcs: &HashMap<String, Vec<String>>, ) -> Result<Self, FrameError>

Aggregate using one or more operations over the specified axis.

funcs: mapping of column_name → list of aggregation function names. Returns a DataFrame with index = function names and columns = original column names.

Source

pub fn aggregate( &self, funcs: &HashMap<String, Vec<String>>, ) -> Result<Self, FrameError>

pandas alias for Self::agg.

Matches pd.DataFrame.aggregate(...) for dict-style column aggregation specifications.

Source

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

Apply a function element-wise to every value in the DataFrame.

Returns a new DataFrame with the same shape and index.

Source

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

pandas-2.1+ alias for Self::applymap. Matches df.map(func).

Per br-frankenpandas-nk54a. pandas 2.1 deprecated applymap in favor of map; this alias supports the new spelling so users migrating from pandas 2.x don’t need to rename.

Source

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

Apply a function element-wise, skipping missing values.

Matches df.applymap(func, na_action='ignore'). Missing values (Null/NaN) are passed through unchanged; func is only called on non-missing values.

Source

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

Apply a function element-wise (pandas 2.0 name for applymap).

Matches pd.DataFrame.map(func).

Source

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

Apply a function element-wise, preserving the shape of the DataFrame.

Similar to applymap but validates that the output has the same shape.

Source

pub fn pivot_table_multi_agg( &self, values: &str, index_col: &str, columns_col: &str, aggfuncs: &[&str], ) -> Result<Self, FrameError>

Create a pivot table applying multiple aggregation functions.

Matches df.pivot_table(values, index, columns, aggfunc=['sum','mean']). Returns a DataFrame with columns named "{col}_{func}" for each combination of pivot column value and aggregation function.

Source

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

Compute the Pearson correlation matrix between numeric columns.

Source

pub fn corr_with_numeric_only( &self, numeric_only: bool, ) -> Result<Self, FrameError>

Compute the Pearson correlation matrix, optionally restricting to numeric dtypes.

Matches df.corr(numeric_only=...). Boolean columns are treated as numeric, and non-numeric columns are excluded from the result.

Source

pub fn corr_min_periods(&self, min_periods: usize) -> Result<Self, FrameError>

Compute pairwise Pearson correlation with a minimum-observations threshold.

Matches df.corr(min_periods=n). Pairs with fewer than min_periods valid (non-NaN) observations yield NaN.

Source

pub fn corr_min_periods_with_numeric_only( &self, min_periods: usize, numeric_only: bool, ) -> Result<Self, FrameError>

Compute pairwise Pearson correlation with a minimum-observations threshold.

Matches df.corr(min_periods=n, numeric_only=...).

Source

pub fn corr_method(&self, method: &str) -> Result<Self, FrameError>

Compute correlation matrix using the specified method.

Supported methods: “pearson”, “spearman”, “kendall”.

Source

pub fn corr_method_with_numeric_only( &self, method: &str, numeric_only: bool, ) -> Result<Self, FrameError>

Compute correlation matrix using the specified method and numeric_only policy.

Supported methods: “pearson”, “spearman”, “kendall”.

Source

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

Compute the pairwise covariance matrix between numeric columns.

Matches df.cov(), whose pandas 2.x default is numeric_only=False: a string or categorical column is an error, not silently dropped.

Source

pub fn cov_with_numeric_only( &self, numeric_only: bool, ) -> Result<Self, FrameError>

Compute the pairwise covariance matrix, optionally restricting to numeric dtypes. Matches df.cov(numeric_only=...).

Source

pub fn cov_min_periods(&self, min_periods: usize) -> Result<Self, FrameError>

Compute pairwise covariance with a minimum-observations threshold.

Matches df.cov(min_periods=n). Pairs with fewer than min_periods valid (non-NaN) observations yield NaN.

Source

pub fn cov_min_periods_with_numeric_only( &self, min_periods: usize, numeric_only: bool, ) -> Result<Self, FrameError>

Matches df.cov(min_periods=n, numeric_only=...).

Source

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

Column-wise correlation with another DataFrame.

Matches df.corrwith(other). Returns a Series of Pearson correlations for each shared numeric column.

Source

pub fn corrwith_axis( &self, other: &Self, axis: usize, ) -> Result<Series, FrameError>

Compute pairwise correlation with another DataFrame along the given axis.

Matches df.corrwith(other, axis=...).

  • axis=0 (default): correlate matching columns
  • axis=1: correlate matching rows
Source

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

Matrix dot product with another DataFrame.

Matches df.dot(other). Computes matrix multiplication where self’s columns are matched to other’s index.

Source

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

Compute the number of unique values per column.

Source

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

Single-cell access by integer (row_pos, col_pos).

Matches pd.DataFrame.iat[i, j]. Negative positions count from the end (pandas convention). Returns CompatibilityRejected for out-of-range row or column positions.

Source

pub fn with_index(&self, index: Index) -> Result<Self, FrameError>

This frame with index as its row axis, labels and name both, as pandas’ df.index = new_index replaces it (set_axis keeps the old axis name).

Source

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

Replace the row index or column names without touching data.

Matches pd.DataFrame.set_axis(labels, axis=0|1):

  • axis=0: replace the row index with labels.
  • axis=1: replace column names with stringified labels.

Returns LengthMismatch when labels.len() doesn’t match the chosen axis; returns CompatibilityRejected for unknown axis.

Source

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

Single-cell access by (row label, column name).

Matches pd.DataFrame.at[label, col]. Returns None when the row label is not present in the index or the column name is unknown. Use .iloc / iat-style positional access on the underlying Index+Column for integer positions.

Source

pub fn value_counts_map(&self) -> Result<BTreeMap<String, Series>, FrameError>

Per-column value counts as a map of Series.

Returns {column_name → Series} where each Series is the value_counts() result for that column. This is distinct from both value_counts() (counts unique full-row tuples) and value_counts_per_column() (returns a nunique summary DataFrame). Callers who want the pandas idiom {col: df[col].value_counts() for col in df.columns} get it in one pass here.

Source

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

Count unique rows in the DataFrame.

Matches pd.DataFrame.value_counts(). Returns a Series indexed by composite row values, with counts as values, sorted descending.

Source

pub fn value_counts_subset(&self, subset: &[&str]) -> Result<Series, FrameError>

Count unique value combinations for a subset of columns.

Matches df.value_counts(subset=['col1','col2']). Counts combinations of values in the specified columns only.

Source

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

Infer better dtypes for object columns.

Matches pd.DataFrame.infer_objects() column by column (see inferred_object_column): numpy dtypes stay, text stays text (pandas: DataFrame({‘n’: [‘10’]}).infer_objects() is object).

Source

pub fn nlargest(&self, n: usize, column: &str) -> Result<Self, FrameError>

Get the top N rows ordered by a column.

Source

pub fn nsmallest(&self, n: usize, column: &str) -> Result<Self, FrameError>

Get the bottom N rows ordered by a column.

Source

pub fn nlargest_multi( &self, n: usize, columns: &[&str], ) -> Result<Self, FrameError>

Get the top N rows ordered by multiple columns.

Matches df.nlargest(n, columns=[...]).

Source

pub fn nsmallest_multi( &self, n: usize, columns: &[&str], ) -> Result<Self, FrameError>

Get the bottom N rows ordered by multiple columns.

Matches df.nsmallest(n, columns=[...]).

Source

pub fn n_extreme_multi_keep( &self, n: usize, columns: &[&str], keep: &str, largest: bool, ) -> Result<Self, FrameError>

pandas’ nlargest / nsmallest (largest) of n rows over several columns under keep ‘last’ or ‘all’ (its SelectNFrame): each column but the last takes its n extreme rows keeping every tie; the rows past the border value are in, the border’s ties go on to the next column for the rest of the count; the last column applies keep; the rows taken are sorted by the columns, stable. The several-column calls ignored keep (br-frankenpandas-tjcru).

§Errors

A column not in the frame, or an unknown keep.

Source

pub fn nlargest_keep( &self, n: usize, column: &str, keep: &str, ) -> Result<Self, FrameError>

Source

pub fn nsmallest_keep( &self, n: usize, column: &str, keep: &str, ) -> Result<Self, FrameError>

Get the bottom N rows with keep parameter.

Matches pd.DataFrame.nsmallest(n, columns, keep).

Source

pub fn take(&self, indices: &[i64], axis: usize) -> Result<Self, FrameError>

Return the elements in the given positional indices along an axis.

Matches df.take(indices, axis=0|1), including negative indices from the end.

Source

pub fn take_rows(&self, indices: &[usize]) -> Result<Self, FrameError>

Helper for selecting rows by normalized non-negative positional indices.

Used by df.take(indices, axis=0) after negative indices have been resolved.

Source

pub fn fillna_method(&self, method: &str) -> Result<Self, FrameError>

Fill missing values using a method (‘ffill’ or ‘bfill’).

Matches pd.DataFrame.fillna(method='ffill') / method='bfill'.

Source

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

Reindex the DataFrame to a new set of index labels.

Missing rows are filled with NaN.

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; br-frankenpandas-mcq15): the rows’ index is target under this frame’s index name.

Source

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

Reindex this DataFrame to match another DataFrame’s row index.

Matches pd.DataFrame.reindex_like(other) for row-index alignment.

Source

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

Conform DataFrame to new index or columns.

Matches pd.DataFrame.reindex(labels, axis=...).

Source

pub fn reindex_fill( &self, new_labels: Vec<IndexLabel>, fill_value: Scalar, ) -> Result<Self, FrameError>

Reindex with a static fill_value for missing labels.

Matches df.reindex(new_labels, fill_value=X). Labels not found in the current index are filled with fill_value instead of NaN.

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 df.reindex(new_labels, method='ffill'|'bfill').

Single-pass, label-presence driven: only labels ABSENT from the source index are filled from the nearest source label in the fill direction; labels PRESENT in the source keep their own values, INCLUDING source NaNs. A two-pass reindex(...).ffill() would instead fill every NaN slot, overwriting original source NaNs that pandas leaves untouched.

Source

pub fn reindex_index_with_method( &self, target: &Index, method: &str, limit: Option<usize>, tolerance: Option<&[f64]>, ) -> Result<Self, FrameError>

Self::reindex_with_method_options onto target as it is held (see Series::reindex_index_with_method; br-frankenpandas-7krba).

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; see method_reindex_positions).

Source

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

Reindex columns: reorder, filter, or add columns.

Matches df.reindex(columns=[...]). Columns present in the new list but missing from the DataFrame are filled with NaN. Columns not in the new list are dropped. Order follows the provided list.

Source

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

Update values using non-null values from another DataFrame.

Analogous to pandas.DataFrame.update(other). Only updates values at matching index labels and column names where other has non-null values. Retains self’s index and columns (no new labels/columns added from other).

Source

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

Combine two DataFrames, preferring non-null values from self.

Analogous to pandas.DataFrame.combine_first(other). Uses union of indices and columns. For overlapping positions, uses self’s value if non-null, else other’s value.

Source

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

Combine two DataFrames element-wise using a binary function.

Matches df.combine(other, func). Aligns on both index and columns (union), filling missing positions with NaN before applying func.

Source

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

Combine the DataFrame with another DataFrame using a column-wise function.

Matches pd.DataFrame.combine(other, func, fill_value=None, overwrite=True).

Source

pub fn rolling( &self, window: usize, min_periods: Option<usize>, ) -> DataFrameRolling<'_>

Create a rolling window view over all numeric columns.

Matches df.rolling(window) semantics.

Source

pub fn rolling_with_center( &self, window: usize, min_periods: Option<usize>, center: bool, ) -> DataFrameRolling<'_>

Create a rolling window view over all numeric columns, centered on each row when center is true.

Matches df.rolling(window, min_periods, center).

Source

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

Self::rolling_with_center closed as pandas’ closed= says (fixed_window_bounds), and with pandas’ on= a column passed through as it was rather than aggregated. min_periods defaults to window and must not exceed it.

Source

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

A time-based window (pandas’ df.rolling('7D', on=, closed=)) over the datetime index or, with on, over that datetime column, which is passed through as it was (offset_window_bounds); min_periods defaults to 1, as pandas’.

Source

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

Self::rolling_offset, each window centred on its row when center (centered_offset_window_bounds; br-frankenpandas-gv69z).

Source

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

Create an expanding window view over all numeric columns.

Matches df.expanding(min_periods) semantics.

Source

pub fn ewm(&self, span: Option<f64>, alpha: Option<f64>) -> DataFrameEwm<'_>

Create an exponentially weighted moving window view over all numeric columns.

Matches df.ewm(span=...) semantics (pandas’ default adjust=True, min_periods=0).

Source

pub fn ewm_with_options( &self, span: Option<f64>, alpha: Option<f64>, adjust: bool, min_periods: usize, ) -> DataFrameEwm<'_>

ewm with pandas’ adjust and min_periods, applied to each numeric column as Series::ewm_with_options does.

Source

pub fn resample(&self, freq: &str) -> DataFrameResample<'_>

Create a time-based resampler view for the DataFrame.

Matches df.resample(freq). The DataFrame must have Utf8 datetime-like index labels. Applies aggregation to each numeric column per time bucket.

Source

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

Source

pub fn asfreq(&self, freq: &str) -> Result<Self, FrameError>

Conform the row index to a datetime frequency.

Matches the row-axis default of pd.DataFrame.asfreq(freq) for flat, strictly increasing 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 row index to a datetime frequency with optional fill.

method accepts pandas spellings "ffill"/"pad" and "bfill"/"backfill" for labels introduced by the frequency grid. fill_value, when present, fills any remaining missing values after reindexing/method fill.

Source

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

Select rows where the time component of the index is between two times.

Matches df.between_time(start_time, end_time). Index labels should be datetime-like strings with time component (HH:MM or HH:MM:SS).

Source

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

Self::between_time with pandas’ inclusive=.

Source

pub fn at_time(&self, time: &str) -> Result<Self, FrameError>

Select rows where the time component exactly matches the given time.

Matches df.at_time(time).

Source

pub fn to_latex(&self, include_index: bool) -> String

Render the DataFrame as a LaTeX table.

Matches df.to_latex().

Source

pub fn ndim(&self) -> usize

Return the number of dimensions.

Matches pd.DataFrame.ndim. Always returns 2.

Source

pub fn axes(&self) -> (Vec<IndexLabel>, Vec<String>)

Return a list of the row axis labels and column axis labels.

Matches pd.DataFrame.axes.

Source

pub fn size(&self) -> usize

Total number of cells in the DataFrame (rows × columns).

Matches pd.DataFrame.size. Equivalent to len() * num_columns(), but follows pandas’ property naming so callers can write size-generic code that works on both Series and DataFrame.

Source

pub fn to_html(&self, include_index: bool) -> String

Render the DataFrame as an HTML table.

Matches pd.DataFrame.to_html().

Source

pub fn groupby(&self, by: &[&str]) -> Result<DataFrameGroupBy<'_>, FrameError>

Group by one or more columns and aggregate.

Returns a DataFrameGroupBy for deferred aggregation.

Source

pub fn groupby_with_as_index( &self, by: &[&str], as_index: bool, ) -> Result<DataFrameGroupBy<'_>, FrameError>

Group the DataFrame by one or more columns with explicit as_index.

When as_index is true (default), group keys become the index. When as_index is false, group keys become regular columns and the index is a default integer range. Matches df.groupby(by, as_index=...).

Source

pub fn groupby_full( &self, by: &[&str], as_index: bool, sort: bool, ) -> Result<DataFrameGroupBy<'_>, FrameError>

Group the DataFrame with full parameter control.

Matches df.groupby(by, as_index=..., sort=...). When sort is true (default), groups are sorted by key. When sort is false, groups appear in first-seen order.

Source

pub fn groupby_full_options( &self, by: &[&str], as_index: bool, sort: bool, dropna: bool, ) -> Result<DataFrameGroupBy<'_>, FrameError>

Group with all options including dropna.

When dropna is true (default), rows with NaN in any group key column are excluded. When false, NaN keys form their own group. Matches df.groupby(by, dropna=False).

Source

pub fn groupby_full_options_with_observed( &self, by: &[&str], as_index: bool, sort: bool, dropna: bool, observed: bool, ) -> Result<DataFrameGroupBy<'_>, FrameError>

Group with explicit observed control for categorical inputs.

The current DataFrame storage model materializes categorical columns to their labels, so observed=true matches the pandas-observable result surface for categorical groupers. observed=false still requires DataFrame-level category metadata and is rejected for now.

Source

pub fn info(&self) -> String

Get summary info about the DataFrame: dtypes, non-null counts, memory.

Source

pub fn to_dict(&self, orient: &str) -> Result<DataFrameDictResult, FrameError>

Convert DataFrame to a nested dictionary.

Matches pd.DataFrame.to_dict(orient=...).

Supported orients:

  • "dict": {column -> {index -> value}} (default)
  • "list": {column -> [values]}
  • "records": [{column -> value}, ...]
  • "index": {index -> {column -> value}}
  • "series": {column -> Series}
  • "split": {index, columns, data}
Source

pub fn to_series_dict(&self) -> BTreeMap<String, Series>

Convert DataFrame to a dict of Series (one per column).

Matches pd.DataFrame.to_dict(orient='series'). Returns {column_name -> Series} where each Series has the DataFrame’s index.

§Panics

Panics if any column length no longer matches the DataFrame index length, which indicates internal DataFrame corruption.

Source

pub fn to_xarray(&self) -> Result<DataFrameXArrayDataset, FrameError>

Convert a flat-index DataFrame into an xarray-like Dataset snapshot.

Matches the practical pd.DataFrame.to_xarray() shape for scalar columns: the row index becomes the single coordinate/dimension, and each DataFrame column becomes one 1-D data variable.

Source

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

Export DataFrame to CSV string.

Matches df.to_csv() returning a string representation.

Source

pub fn to_csv_options( &self, sep: char, include_index: bool, na_rep: &str, columns: Option<&[&str]>, ) -> Result<String, FrameError>

Export DataFrame to CSV string with additional formatting options.

Matches df.to_csv(sep, index, na_rep, columns).

  • na_rep: string to represent missing values (default empty)
  • columns: optional subset of columns to include
Source

pub fn to_csv_with_quoting( &self, sep: char, include_index: bool, na_rep: &str, columns: Option<&[&str]>, quoting: CsvQuoting, ) -> Result<String, FrameError>

Export DataFrame to CSV string with quoting control.

Matches df.to_csv(..., quoting=csv.QUOTE_*).

  • CsvQuoting::Minimal: Quote only when necessary (default pandas behavior)
  • CsvQuoting::All: Quote all fields including headers, index, and values
  • CsvQuoting::NonNumeric: Quote all non-numeric fields
  • CsvQuoting::None: Never quote fields
  • header: if true (default), write column names as first row
Source

pub fn to_csv_with_header( &self, sep: char, include_index: bool, na_rep: &str, columns: Option<&[&str]>, quoting: CsvQuoting, header: bool, ) -> Result<String, FrameError>

Export DataFrame to CSV string with full control over quoting and header.

  • header: if true, write column names as first row; if false, omit header
Source

pub fn to_csv_full( &self, sep: char, include_index: bool, na_rep: &str, columns: Option<&[&str]>, quoting: CsvQuoting, header: bool, escapechar: Option<char>, ) -> Result<String, FrameError>

Export DataFrame to 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>

Export DataFrame to JSON string.

Matches pd.DataFrame.to_json(orient=...), floats at pandas’ default double_precision (10).

Source

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

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

Source

pub fn to_numpy(&self) -> Vec<Vec<f64>>

Return the DataFrame values as a row-major 2D vector of f64.

Matches pd.DataFrame.to_numpy(). Non-numeric values become NaN. Each inner vector is one row.

Source

pub fn to_numpy_flat(&self) -> (Vec<f64>, usize, usize)

Numeric-coerced values as a single row-major contiguous Vec<f64> plus (rows, cols), i.e. numpy C-order.

Unlike to_numpy — which returns a nested Vec<Vec<f64>> and pays one heap allocation per row (allocation-bound at large row counts) — this materializes into ONE buffer, matching numpy’s contiguous 2-D layout and making the result usable directly by BLAS / interop. Values are identical to to_numpy (flat[i*cols + j] == to_numpy()[i][j]): all-valid Int64/Float64 columns copy/cast from their typed slice, everything else takes the exact Scalar to_f64/NaN path.

Source

pub fn to_string(&self) -> String

Render the DataFrame as a formatted plain-text table.

Matches df.to_string() with pandas’ default index=True behavior.

Source

pub fn to_string_table(&self, include_index: bool) -> String

Render the DataFrame as a formatted plain-text table with explicit index-column control.

Matches df.to_string(). Columns are right-aligned for numeric data, left-aligned for strings. Includes index column on the left.

Source

pub fn to_string_truncated( &self, include_index: bool, max_rows: Option<usize>, max_cols: Option<usize>, ) -> String

Render the DataFrame as a string table with truncation.

Matches df.to_string(max_rows=N, max_cols=M). When the number of rows exceeds max_rows, shows the first and last max_rows/2 rows with “…” in between. Similarly truncates columns.

Source

pub fn to_markdown( &self, include_index: bool, tablefmt: Option<&str>, ) -> Result<String, FrameError>

Render the DataFrame as a Markdown table.

Matches df.to_markdown().

Source

pub fn sample( &self, n: Option<usize>, frac: Option<f64>, replace: bool, seed: Option<u64>, ) -> Result<Self, FrameError>

Randomly sample rows from the DataFrame.

n: number of rows to sample (mutually exclusive with frac). frac: fraction of rows to sample. replace: whether to sample with replacement. seed: optional deterministic seed.

Source

pub fn sample_weights( &self, n: usize, weights: &[f64], replace: bool, seed: Option<u64>, ) -> Result<Self, FrameError>

Weighted sampling of rows.

Matches df.sample(n, weights=...). The weights slice must have the same length as the DataFrame. Weights are normalized to sum to 1.

Source

pub fn stacked_values(&self) -> Result<Column, FrameError>

Stack: pivot columns into rows (wide-to-long).

Converts a DataFrame with columns [A, B, …] into a two-column DataFrame with a multi-level index (original_index, column_name) and a single value column. Similar to pandas DataFrame.stack(). The cells of Self::stack as one column, row by row (each row’s cells in column order), without the composite labels a stack builds for them: the Python stack makes its MultiIndex from codes and read the values alone (they were built with labels it discarded; br-frankenpandas-nna8h).

§Errors

A column the cells cannot share a dtype with.

Source

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

Source

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

pandas’ DataFrame.unstack(level=moved, fill_value) over a row MultiIndex: each column unstacked as Series::unstack_levels, side by side under its label - the column MultiIndex (column levels, *moved levels), its levels named after the column axis and the moved levels (br-frankenpandas-xbl2k; the binding unstacked a column at a time and lost the moved levels’ names).

Source

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

Unstack: pivot rows into columns (long-to-wide).

Assumes the index contains composite labels in “row|col” format (as produced by stack()). Produces a DataFrame with unique row keys as index and unique column keys as columns.

Source

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

Apply a closure to each column (axis=0) or each row (axis=1).

Unlike the string-based apply(), this takes a Rust closure.

Source

pub fn apply_with_result_type<F>( &self, func: F, result_type: &str, ) -> Result<Self, FrameError>
where F: Fn(&[Scalar]) -> Vec<Scalar>,

Row-wise apply with result_type control.

Matches pd.DataFrame.apply(func, axis=1, result_type=...).

  • "reduce": Each row produces a single scalar → returns a Series (default).
  • "expand": Each row produces a Vec of scalars → columns of the output DataFrame.
  • "broadcast": Each row produces a scalar → broadcast to all columns, preserving shape.
Source

pub fn apply_row<F>(&self, name: &str, func: F) -> Result<Series, FrameError>
where F: Fn(&[Scalar]) -> Scalar,

Row-wise apply returning a Series (one value per row).

Convenience wrapper for apply_fn(func, 1) that directly returns a Series instead of a single-column DataFrame.

Source

pub fn apply_row_fn<F>(&self, name: &str, func: F) -> Result<Series, FrameError>
where F: Fn(&[Scalar]) -> Result<Scalar, FrameError>,

Row-wise apply with failable closure returning a Series.

Like apply_row but the closure can return errors.

Source

pub fn pivot( &self, index_col: &str, columns_col: &str, values_col: &str, ) -> Result<Self, FrameError>

Simple pivot: reshape long to wide using column values.

Matches pd.DataFrame.pivot(index, columns, values). Unlike pivot_table, no aggregation is performed; duplicate entries error.

Source

pub fn squeeze_to_series(&self, axis: usize) -> Result<Series, Self>

Squeeze a single-column DataFrame to a Series, or single-row to a Series.

Matches pd.DataFrame.squeeze(axis).

  • axis=1 (default): if single column, return as Series
  • axis=0: if single row, return as Series
§Panics

Panics if the squeezed output cannot be represented as a valid Series because the DataFrame’s internal index or column metadata has already diverged from its column storage.

Source

pub fn memory_usage(&self) -> Result<Series, FrameError>

Approximate memory usage per column.

Matches pd.DataFrame.memory_usage(). Returns a Series with column names as index and byte estimates as values. Includes the index.

Source

pub fn memory_usage_with_options( &self, index: bool, deep: bool, ) -> Result<Series, FrameError>

Matches pd.DataFrame.memory_usage(index=..., deep=...).

Source

pub fn nunique(&self) -> Result<Series, FrameError>

Count of unique non-null values per column.

Matches pd.DataFrame.nunique().

Source

pub fn nunique_with_dropna(&self, dropna: bool) -> Result<Series, FrameError>

Count of unique values per column with explicit null counting control.

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

Source

pub fn nunique_axis(&self, axis: usize) -> Result<Series, FrameError>

Count unique non-null values with axis parameter.

Matches pd.DataFrame.nunique(axis).

  • axis=0 (default): unique count per column (same as nunique())
  • axis=1: unique count per row
Source

pub fn nunique_axis_with_dropna( &self, axis: usize, dropna: bool, ) -> Result<Series, FrameError>

Count unique values with axis parameter and explicit null counting control.

Matches pd.DataFrame.nunique(axis=..., dropna=...).

Source

pub fn nunique_axis1(&self) -> Result<Series, FrameError>

Count unique non-null values per row (axis=1).

Matches pd.DataFrame.nunique(axis=1).

Source

pub fn nunique_axis1_with_dropna( &self, dropna: bool, ) -> Result<Series, FrameError>

Count unique values per row with explicit null counting control.

Matches pd.DataFrame.nunique(axis=1, dropna=...).

Source

pub fn idxmin(&self) -> Result<Series, FrameError>

Return index label of minimum value over requested axis.

Matches pd.DataFrame.idxmin().

Source

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

Return index label of maximum value over requested axis.

Matches pd.DataFrame.idxmax().

Source

pub fn idxmax_ext( &self, axis: usize, skipna: bool, numeric_only: bool, ) -> Result<Series, FrameError>

Return index of first occurrence of maximum over requested axis.

Matches df.idxmax(axis=..., skipna=..., numeric_only=...).

Source

pub fn idxmin_ext( &self, axis: usize, skipna: bool, numeric_only: bool, ) -> Result<Series, FrameError>

Return index of first occurrence of minimum over requested axis.

Matches df.idxmin(axis=..., skipna=..., numeric_only=...).

Source

pub fn idxmin_axis1(&self) -> Result<Series, FrameError>

Column label of the minimum value per row (axis=1).

Matches pd.DataFrame.idxmin(axis=1). Returns a Series with one entry per row, containing the column name of the minimum value.

Source

pub fn idxmax_axis1(&self) -> Result<Series, FrameError>

Column label of the maximum value per row (axis=1).

Matches pd.DataFrame.idxmax(axis=1). Returns a Series with one entry per row, containing the column name of the maximum value.

Source

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

Whether all non-null values are truthy, per column.

Matches pd.DataFrame.all().

Source

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

Whether any non-null value is truthy, per column.

Matches pd.DataFrame.any().

Source

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

Sum of non-null values per column.

Matches pd.DataFrame.sum().

⚠️ This still defaults to numeric_only=true, which is pandas 1.x. pandas 2.x defaults to FALSE and includes object columns. Reach the pandas-2.x behaviour explicitly via Self::sum_with_numeric_only until the default is flipped (br-frankenpandas-reductions-numeric-only-default-zx21n).

Source

pub fn sum_with_numeric_only( &self, numeric_only: bool, ) -> Result<Series, FrameError>

df.sum(numeric_only=...). With false, an object column is CONCATENATED and the numeric columns keep their own dtype, matching pandas 2.x.

Source

pub fn min_agg_with_numeric_only( &self, numeric_only: bool, ) -> Result<Series, FrameError>

df.min(numeric_only=...). With false, an object column is compared LEXICOGRAPHICALLY, matching pandas 2.x.

Source

pub fn max_agg_with_numeric_only( &self, numeric_only: bool, ) -> Result<Series, FrameError>

df.max(numeric_only=...). See Self::min_agg_with_numeric_only.

Source

pub fn mean_with_numeric_only( &self, numeric_only: bool, ) -> Result<Series, FrameError>

df.mean(numeric_only=...). With false and a non-numeric column present this RAISES, as pandas 2.x does (“Could not convert … to numeric”).

Source

pub fn prod_with_numeric_only( &self, numeric_only: bool, ) -> Result<Series, FrameError>

df.prod(numeric_only=...). Raises on a non-numeric column when false.

Source

pub fn median_with_numeric_only( &self, numeric_only: bool, ) -> Result<Series, FrameError>

df.median(numeric_only=...). Raises on a non-numeric column when false.

Source

pub fn std_agg_with_numeric_only( &self, numeric_only: bool, ) -> Result<Series, FrameError>

df.std(numeric_only=...). Raises on a non-numeric column when false.

Source

pub fn var_agg_with_numeric_only( &self, numeric_only: bool, ) -> Result<Series, FrameError>

df.var(numeric_only=...). Raises on a non-numeric column when false.

Source

pub fn sem_agg_with_numeric_only( &self, numeric_only: bool, ) -> Result<Series, FrameError>

df.sem(numeric_only=...). Raises on a non-numeric column when false.

Source

pub fn skew_agg_with_numeric_only( &self, numeric_only: bool, ) -> Result<Series, FrameError>

df.skew(numeric_only=...). Raises on a non-numeric column when false.

Source

pub fn kurtosis_agg_with_numeric_only( &self, numeric_only: bool, ) -> Result<Series, FrameError>

df.kurtosis(numeric_only=...). Raises on a non-numeric column when false.

Source

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

Mean of non-null values per column.

Matches pd.DataFrame.mean().

Source

pub fn min_agg(&self) -> Result<Series, FrameError>

Min of non-null values per column.

Matches pd.DataFrame.min().

Source

pub fn max_agg(&self) -> Result<Series, FrameError>

Max of non-null values per column.

Matches pd.DataFrame.max().

Source

pub fn std_agg(&self) -> Result<Series, FrameError>

Standard deviation of non-null values per column.

Matches pd.DataFrame.std().

Source

pub fn var_agg(&self) -> Result<Series, FrameError>

Variance of non-null values per column.

Matches pd.DataFrame.var().

Source

pub fn std_agg_ddof(&self, ddof: usize) -> Result<Series, FrameError>

Standard deviation per column with configurable degrees of freedom.

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

Source

pub fn var_agg_ddof(&self, ddof: usize) -> Result<Series, FrameError>

Variance per column with configurable degrees of freedom.

Matches pd.DataFrame.var(ddof=n).

Source

pub fn median_agg(&self) -> Result<Series, FrameError>

Median of non-null values per column.

Matches pd.DataFrame.median().

Source

pub fn prod_agg(&self) -> Result<Series, FrameError>

Product of non-null values per column.

Matches pd.DataFrame.prod().

Source

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

Mode per column.

Matches pd.DataFrame.mode(). Returns a DataFrame where each column contains its mode values, padded with NaN when columns have fewer modes.

Source

pub fn mode_with_options( &self, axis: usize, numeric_only: bool, dropna: bool, ) -> Result<Self, FrameError>

Mode over columns or rows with pandas-compatible options.

Matches pd.DataFrame.mode(axis=..., numeric_only=..., dropna=...).

Source

pub fn sum_skipna(&self, skipna: bool) -> Result<Series, FrameError>

Sum per column with skipna control.

Matches pd.DataFrame.sum(skipna=True|False).

Source

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

Mean per column with skipna control.

Source

pub fn std_agg_skipna(&self, skipna: bool) -> Result<Series, FrameError>

Std per column with skipna control.

Source

pub fn var_agg_skipna(&self, skipna: bool) -> Result<Series, FrameError>

Var per column with skipna control.

Source

pub fn prod_agg_skipna(&self, skipna: bool) -> Result<Series, FrameError>

Prod per column with skipna control.

Source

pub fn skew_agg(&self) -> Result<Series, FrameError>

Skewness of non-null values per column.

Matches pd.DataFrame.skew().

Source

pub fn kurtosis_agg(&self) -> Result<Series, FrameError>

Kurtosis of non-null values per column.

Matches pd.DataFrame.kurtosis().

Source

pub fn kurt_agg(&self) -> Result<Series, FrameError>

Alias for kurtosis_agg() — pandas exposes df.kurt() and df.kurtosis() as equivalents at the column-aggregate level.

Source

pub fn sem_agg(&self) -> Result<Series, FrameError>

Standard error of the mean per column.

Matches pd.DataFrame.sem().

Source

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

Per-column min — pandas-parity alias for min_agg.

Source

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

Per-column max — pandas-parity alias for max_agg.

Source

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

Per-column std — pandas-parity alias for std_agg.

Source

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

Per-column var — pandas-parity alias for var_agg.

Source

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

Per-column median — pandas-parity alias for median_agg.

Source

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

Per-column product — pandas-parity alias for prod_agg.

Source

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

Per-column skewness — pandas-parity alias for skew_agg.

Source

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

Per-column excess kurtosis — pandas-parity alias for kurtosis_agg. Pandas uses both kurt and kurtosis as aliases.

Source

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

Per-column excess kurtosis (pandas alias for kurtosis).

Source

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

Per-column standard error of the mean — pandas-parity alias for sem_agg.

Source

pub fn sum_axis1(&self) -> Result<Series, FrameError>

Sum across columns per row.

Matches pd.DataFrame.sum(axis=1).

Source

pub fn mean_axis1(&self) -> Result<Series, FrameError>

Mean across columns per row.

Matches pd.DataFrame.mean(axis=1).

Source

pub fn min_axis1(&self) -> Result<Series, FrameError>

Minimum across columns per row.

Matches pd.DataFrame.min(axis=1).

Source

pub fn apply_rows<F>(&self, func: F, name: &str) -> Result<Series, FrameError>
where F: Fn(&[Scalar]) -> Scalar,

Apply a custom function to each row of the DataFrame.

Matches pd.DataFrame.apply(func, axis=1). The function receives a slice of Scalar values representing the row (in column_order) and should return a single Scalar result.

Source

pub fn max_axis1(&self) -> Result<Series, FrameError>

Maximum across columns per row.

Matches pd.DataFrame.max(axis=1).

Source

pub fn std_axis1(&self) -> Result<Series, FrameError>

Standard deviation across columns per row.

Matches pd.DataFrame.std(axis=1).

Source

pub fn var_axis1(&self) -> Result<Series, FrameError>

Variance across columns per row.

Matches pd.DataFrame.var(axis=1).

Source

pub fn sem_axis1(&self) -> Result<Series, FrameError>

Standard error of the mean across columns per row.

Matches pd.DataFrame.sem(axis=1).

Source

pub fn skew_axis1(&self) -> Result<Series, FrameError>

Skewness across columns per row.

Matches pd.DataFrame.skew(axis=1).

Source

pub fn kurtosis_axis1(&self) -> Result<Series, FrameError>

Excess kurtosis across columns per row.

Matches pd.DataFrame.kurtosis(axis=1).

Source

pub fn kurt_axis1(&self) -> Result<Series, FrameError>

Alias for kurtosis_axis1() — pandas exposes df.kurt(axis=1) and df.kurtosis(axis=1) as equivalents.

Source

pub fn count_axis1(&self) -> Result<Series, FrameError>

Count of non-null values across columns per row.

Matches pd.DataFrame.count(axis=1).

Source

pub fn all_axis1(&self) -> Result<Series, FrameError>

Whether all non-null values are truthy across columns per row.

Matches pd.DataFrame.all(axis=1).

Source

pub fn any_axis1(&self) -> Result<Series, FrameError>

Whether any non-null value is truthy across columns per row.

Matches pd.DataFrame.any(axis=1).

Source

pub fn quantile_axis1(&self, q: f64) -> Result<Series, FrameError>

Median across columns per row.

Matches pd.DataFrame.median(axis=1). Per-row quantile across numeric columns (axis=1).

Matches pd.DataFrame.quantile(q, axis=1). For each row the numeric column values are collected (skipping non-numeric and missing entries) and their linear-interpolation quantile is returned. q must lie in [0.0, 1.0]. Rows with no numeric entries emit Null(NaN).

Source

pub fn argmin_axis1(&self) -> Result<Series, FrameError>

Per-row index label of the first smallest numeric value.

Matches pd.DataFrame.idxmin(axis=1) combined with positional column lookup. Returns the column-name Series entry for each row’s argmin; rows with no numeric entries emit Null(NaN).

Source

pub fn argmax_axis1(&self) -> Result<Series, FrameError>

Per-row index label of the first largest numeric value.

Matches pd.DataFrame.idxmax(axis=1).

Source

pub fn median_axis1(&self) -> Result<Series, FrameError>

Source

pub fn prod_axis1(&self) -> Result<Series, FrameError>

Product across columns per row.

Matches pd.DataFrame.prod(axis=1).

Source

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

Cumulative sum per column.

Matches pd.DataFrame.cumsum().

Source

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

Cumulative product per column.

Matches pd.DataFrame.cumprod().

Source

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

Cumulative maximum per column.

Matches pd.DataFrame.cummax().

Source

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

Cumulative minimum per column.

Matches pd.DataFrame.cummin().

Source

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

Per-column cumulative sum with an explicit skipna, matching pd.DataFrame.cumsum(axis=0, skipna=...). skipna=false propagates the first NaN/NaT down each column (br-frankenpandas-tlhd6 follow-up).

Source

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

Per-column cumulative product with an explicit skipna (see cumsum_with_skipna).

Source

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

Per-column cumulative maximum with an explicit skipna (see cumsum_with_skipna).

Source

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

Per-column cumulative minimum with an explicit skipna (see cumsum_with_skipna).

Source

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

Cumulative sum across columns with explicit skipna, computed row-wise.

Source

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

Cumulative sum across columns, computed row-wise.

Matches pd.DataFrame.cumsum(axis=1, skipna=True).

Source

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

Cumulative product across columns with explicit skipna, computed row-wise.

Source

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

Cumulative product across columns, computed row-wise.

Matches pd.DataFrame.cumprod(axis=1, skipna=True).

Source

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

Cumulative minimum across columns with explicit skipna, computed row-wise.

Source

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

Cumulative minimum across columns, computed row-wise.

Matches pd.DataFrame.cummin(axis=1, skipna=True).

Source

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

Cumulative maximum across columns with explicit skipna, computed row-wise.

Source

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

Cumulative maximum across columns, computed row-wise.

Matches pd.DataFrame.cummax(axis=1, skipna=True).

Source

pub fn diff(&self, periods: i64) -> Result<Self, FrameError>

First-order difference per column.

Matches pd.DataFrame.diff(periods).

Source

pub fn diff_axis1(&self, periods: i64) -> Result<Self, FrameError>

First-order difference across columns per row.

Matches pd.DataFrame.diff(periods, axis=1).

Source

pub fn pct_change_axis1(&self, periods: i64) -> Result<Self, FrameError>

Percentage change across columns per row.

Matches pd.DataFrame.pct_change(periods, axis=1).

Source

pub fn shift(&self, periods: i64) -> Result<Self, FrameError>

Shift values per column.

Matches pd.DataFrame.shift(periods).

Source

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

Shift values per column, filling the vacated positions with fill_value instead of NaN. Matches pd.DataFrame.shift(periods, fill_value=...). An Int64 fill on an Int64 column keeps that column Int64 (no widening to Float64), exactly as the Series variant (br-frankenpandas-twqkf).

Source

pub fn shift_with_column_fills( &self, periods: i64, fills: &[Scalar], ) -> Result<Self, FrameError>

Self::shift_with_fill_value with each column’s own fill, by position: pandas reads a fill per column (a string a datetime column parses fills an object column as text; br-frankenpandas-geqye).

Source

pub fn shift_axis1(&self, periods: i64) -> Result<Self, FrameError>

Shift index horizontally by desired number of periods.

Matches pd.DataFrame.shift(periods, axis=1).

Source

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

Shift index horizontally by desired number of periods, filling vacated positions with fill_value.

Matches pd.DataFrame.shift(periods, axis=1, fill_value=...).

Source

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

Absolute value per column.

Matches pd.DataFrame.abs().

Source

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

Clip values per column.

Matches pd.DataFrame.clip(lower, upper).

Source

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

Clip values below a threshold across all numeric columns.

Matches pd.DataFrame.clip(lower=threshold).

Source

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

Clip values above a threshold across all numeric columns.

Matches pd.DataFrame.clip(upper=threshold).

Source

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

Clip each column to its own bound, matching df.clip(lower=s, upper=s, axis=1) where lower/upper are Series indexed by column name.

Each numeric column is clipped to the scalar bound looked up by its name. Following pandas’ where-based broadcast, a column whose provided lower or upper bound is absent from the Series (i.e. NaN) becomes all-NaN — distinct from the scalar clip, where a NaN bound means “no clip”. A bound Series passed as None applies no clipping on that side. (Per-row bounds, axis=0, are tracked under br-frankenpandas-l4wfl.)

Source

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

Clip each row to its own bound, matching df.clip(lower=s, upper=s, axis=0) where lower/upper are Series indexed by row label.

Every numeric value in row i is clipped to the bound looked up by that row’s label. Semantics verified against live pandas 2.2.3 (br-frankenpandas-l4wfl):

  • A row label present in the bound Series with a finite value clips that whole row to the value; dtype is preserved when the input is Int64 and every resulting value is integral (an integral float bound such as 3.0 keeps Int64; a fractional bound that actually clips demotes the column to Float64).
  • A row label present but NaN applies no clipping on that side (NaN comparisons are false), leaving the value and dtype untouched.
  • A row label absent from any provided bound Series forces that entire row to NaN and demotes every column to Float64 — pandas reindexes the bound to the frame’s axis, and the introduced NaN propagates through the where-broadcast. This is distinct from a present-but-NaN bound.
  • Pre-existing data nulls are preserved (and, like pandas, keep the column in Float64).

A bound Series passed as None applies no clipping on that side. (Per-column bounds, axis=1, are Self::clip_with_column_bounds.)

Source

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

Round numeric columns to specified decimal places.

Matches pd.DataFrame.round(decimals).

Source

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

Round each named column to its own number of decimal places.

Matches pd.DataFrame.round(decimals) where decimals is a dict/Series mapping column name -> decimals. Columns absent from the map are left UNCHANGED (pandas only rounds the listed columns); a listed non-numeric column is also left unchanged (rounding is a no-op on object dtype).

Source

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

Floor each numeric element (round toward negative infinity).

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

Source

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

Ceiling of each numeric element (round toward positive infinity).

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

Source

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

Truncate each numeric element toward zero.

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

Source

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

Element-wise square root.

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

Source

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

Element-wise exponential (e^x).

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

Source

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

Element-wise natural logarithm.

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

Source

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

Element-wise base-10 logarithm.

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

Source

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

Element-wise base-2 logarithm.

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

Source

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

Element-wise sine.

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

Source

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

Element-wise cosine.

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

Source

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

Element-wise tangent.

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

Source

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

Element-wise hyperbolic sine.

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

Source

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

Element-wise hyperbolic cosine.

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

Source

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

Element-wise hyperbolic tangent.

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

Source

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

Element-wise inverse sine.

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

Source

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

Element-wise inverse cosine.

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

Source

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

Element-wise inverse tangent.

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

Source

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

Element-wise inverse hyperbolic sine.

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

Source

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

Element-wise inverse hyperbolic cosine.

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

Source

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

Element-wise inverse hyperbolic tangent.

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

Source

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

Element-wise exp(x) - 1 with improved precision for small x.

Matches np.expm1(df). 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(df). NaN values pass through.

Source

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

Element-wise cube root.

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

Source

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

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

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

Source

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

Element-wise sign bit (true if negative).

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

Source

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

Convert angles from degrees to radians.

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

Source

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

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

Source

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

Convert angles from radians to degrees.

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

Source

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

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

Source

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

Element-wise reciprocal (1/x).

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

Source

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

Element-wise square (x^2).

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

Source

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

Round to nearest integer (banker’s rounding).

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

Source

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

Round toward zero (alias for trunc).

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

Source

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

Element-wise check for finite values.

Matches np.isfinite(df). Returns boolean DataFrame.

Source

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

Element-wise check for infinite values.

Matches np.isinf(df). Returns boolean DataFrame.

Source

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

Element-wise check for NaN values.

Matches np.isnan(df). Returns boolean DataFrame.

Source

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

Element-wise check for negative infinity.

Matches np.isneginf(df). Returns boolean DataFrame.

Source

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

Element-wise check for positive infinity.

Matches np.isposinf(df). Returns boolean DataFrame.

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

Source

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

Element-wise negation (-x).

Matches np.negative(df) / -df.

Source

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

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

Source

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

Element-wise NOT per column: ~df (logical for bool, bitwise for int; a float column refuses, as numpy).

Source

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

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

Matches np.positive(df) / +df.

Source

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

Reverse the order of elements in each column.

Matches df[::-1] / np.flip(df, axis=0).

Source

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

Alias for reverse(). Matches np.flip(df, axis=0).

Source

pub fn roll(&self, shift: i64) -> Result<Self, FrameError>

Roll elements along axis 0 by shift positions.

Matches np.roll(df, shift, axis=0). Elements shifted off one end wrap around to the other.

Source

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

Tile (repeat) each column a given number of times.

Matches np.tile(df, (reps, 1)).

Source

pub fn add_scalar(&self, value: f64) -> Result<Self, FrameError>

Add a scalar to all numeric columns.

Matches df + scalar or df.add(scalar).

Source

pub fn arith_series( &self, series: &Series, op: ArithmeticOp, axis: usize, reflected: bool, ) -> Result<Self, FrameError>

df <op> series, or series <op> df when reflected, broadcast as pandas does (br-frankenpandas-ini2u: fp had no DataFrame x Series op). With axis = 1 (pandas’ default, “columns”) the Series’ labels name columns: column labels are outer-joined, each column combines with its label’s value, and a label on one side only gives an all-NaN float64 column. With axis = 0 (“index”) the Series runs down the rows and each column combines with it as Series arithmetic over the outer-joined row labels. An outer join keeps equal labels in order and sorts different ones; dtypes follow Series arithmetic.

Source

pub fn cmp_series( &self, series: &Series, op: ComparisonOp, axis: usize, ) -> Result<Self, FrameError>

df <op> series for a comparison, broadcast like arith_series: a missing operand compares False (True under !=), as pandas’ flex comparisons do.

Source

pub fn arith_scalar( &self, scalar: &Scalar, op: ArithmeticOp, reflected: bool, ) -> Result<Self, FrameError>

df <op> scalar, or scalar <op> df when reflected, with pandas’ dtypes: an all-valid Int64 column (and a Bool column under + - * // %) with an integer scalar goes through the Series kernel (Column::binary_numeric) and stays int64 - wrapping overflow, pandas’ zero-division floats, its negative-power error - where the f64 path made it float64 (br-frankenpandas-c74wi). True division, a float scalar, and every other column keep the f64 path of the per-op methods.

Source

pub fn sub_scalar(&self, value: f64) -> Result<Self, FrameError>

Subtract a scalar from all numeric columns.

Source

pub fn mul_scalar(&self, value: f64) -> Result<Self, FrameError>

Multiply all numeric columns by a scalar.

Source

pub fn div_scalar(&self, value: f64) -> Result<Self, FrameError>

Divide all numeric columns by a scalar.

Source

pub fn pow_scalar(&self, value: f64) -> Result<Self, FrameError>

Raise all numeric columns to a scalar power.

Source

pub fn mod_scalar(&self, value: f64) -> Result<Self, FrameError>

Modulo all numeric columns by a scalar.

Source

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

Add another DataFrame or scalar with pandas’ canonical method name.

Matches pd.DataFrame.add(other) for DataFrame and scalar operands.

Source

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

Subtract another DataFrame or scalar with pandas’ canonical method name.

Source

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

Alias for DataFrame::sub.

Source

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

Multiply by another DataFrame or scalar with pandas’ canonical method name.

Source

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

Alias for DataFrame::mul.

Source

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

Divide by another DataFrame or scalar with pandas’ canonical method name.

Source

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

Alias for DataFrame::div.

Source

pub fn truediv<'a, O>(&self, other: O) -> Result<Self, FrameError>

Alias for DataFrame::div.

Source

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

Floor-divide by another DataFrame or scalar.

Source

pub fn mod<'a, O>(&self, other: O) -> Result<Self, FrameError>

Modulo by another DataFrame or scalar.

Rust callers use the raw identifier form: df.r#mod(other).

Source

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

Raise to the power of another DataFrame or scalar.

Source

pub fn radd<'a, O>(&self, other: O) -> Result<Self, FrameError>

Reverse add: other + self.

Source

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

Reverse subtract: other - self.

Source

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

Reverse multiply: other * self.

Source

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

Reverse true division: other / self.

Source

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

Alias for DataFrame::rdiv.

Source

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

Reverse floor division: other // self.

Source

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

Reverse modulo: other % self.

Source

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

Reverse power: other ** self.

Source

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

Add another DataFrame element-wise with index alignment.

Matches pd.DataFrame.add(other).

Source

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

Subtract another DataFrame element-wise with index alignment.

Matches pd.DataFrame.sub(other).

Source

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

Multiply another DataFrame element-wise with index alignment.

Matches pd.DataFrame.mul(other).

Source

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

Divide by another DataFrame element-wise with index alignment.

Matches pd.DataFrame.div(other).

Source

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

Floor-divide by another DataFrame element-wise with index alignment.

Matches pd.DataFrame.floordiv(other).

Source

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

Modulo with another DataFrame element-wise with index alignment.

Matches pd.DataFrame.mod(other).

Source

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

Raise another DataFrame element-wise to the power with index alignment.

Matches pd.DataFrame.pow(other) / df1 ** df2.

Source

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

Add another DataFrame element-wise with fill_value for NaN handling.

Matches pd.DataFrame.add(other, fill_value=X).

Source

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

Subtract another DataFrame element-wise with fill_value for NaN handling.

Matches pd.DataFrame.sub(other, fill_value=X).

Source

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

Multiply another DataFrame element-wise with fill_value for NaN handling.

Matches pd.DataFrame.mul(other, fill_value=X).

Source

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

Divide by another DataFrame element-wise with fill_value for NaN handling.

Matches pd.DataFrame.div(other, fill_value=X).

Source

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

Floor-divide by another DataFrame element-wise with fill_value for NaN handling.

Matches pd.DataFrame.floordiv(other, fill_value=X).

Source

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

Modulo with another DataFrame element-wise with fill_value for NaN handling.

Matches pd.DataFrame.mod(other, fill_value=X).

Source

pub fn floordiv_scalar(&self, value: f64) -> Result<Self, FrameError>

Floor-divide all numeric columns by a scalar.

Matches pd.DataFrame.floordiv(scalar).

Source

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

Element-wise equality with another DataFrame.

Matches pd.DataFrame.eq(other).

Source

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

Element-wise not-equal with another DataFrame.

Matches pd.DataFrame.ne(other).

Source

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

Element-wise greater-than with another DataFrame.

Matches pd.DataFrame.gt(other).

Source

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

Element-wise greater-or-equal with another DataFrame.

Matches pd.DataFrame.ge(other).

Source

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

Element-wise less-than with another DataFrame.

Matches pd.DataFrame.lt(other).

Source

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

Element-wise less-or-equal with another DataFrame.

Matches pd.DataFrame.le(other).

Source

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

Compare each element in all columns against a scalar.

Matches pd.DataFrame.eq(scalar) etc.

Source

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

Element-wise == scalar for all columns.

Source

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

Element-wise != scalar for all columns.

Source

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

Element-wise > scalar for all columns.

Source

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

Element-wise >= scalar for all columns.

Source

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

Element-wise < scalar for all columns.

Source

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

Element-wise <= scalar for all columns.

Source

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

Element-wise equality with another DataFrame or scalar.

Matches pd.DataFrame.eq(other).

Source

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

Element-wise inequality with another DataFrame or scalar.

Matches pd.DataFrame.ne(other).

Source

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

Element-wise greater-than comparison with another DataFrame or scalar.

Matches pd.DataFrame.gt(other).

Source

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

Element-wise greater-or-equal comparison with another DataFrame or scalar.

Matches pd.DataFrame.ge(other).

Source

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

Element-wise less-than comparison with another DataFrame or scalar.

Matches pd.DataFrame.lt(other).

Source

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

Element-wise less-or-equal comparison with another DataFrame or scalar.

Matches pd.DataFrame.le(other).

Source

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

One-hot encode specified columns.

Matches pd.get_dummies(df, columns). Creates indicator columns for each unique value in the specified columns, prefixed with {column_name}_{value}. Original columns are removed. If columns is empty, all Utf8 columns are encoded.

Source

pub fn get_dummies_with_options( &self, columns: &[&str], prefix_sep: &str, dummy_na: bool, drop_first: bool, ) -> Result<Self, FrameError>

One-hot encode columns with full pandas 2.2 option parity.

Matches pd.get_dummies(df, columns=..., prefix_sep='_', dummy_na=False, drop_first=False).

  • prefix_sep joins the source column name to the value (pandas default '_').
  • dummy_na adds an {col}{sep}nan indicator column marking null values in the source column.
  • drop_first drops the first indicator column for each encoded source column (discovery order), avoiding the dummy-variable trap.
Source

pub fn from_dummies( &self, sep: Option<&str>, default_category: Option<&str>, ) -> Result<Self, FrameError>

Convert dummy (one-hot encoded) columns back into categorical / string columns.

Matches pd.from_dummies(df, sep=..., default_category=...).

§Errors

Returns FrameError::CompatibilityRejected if:

  • sep is given and any column name does not contain the separator.
  • Any row contains multiple 1s.
  • Any row contains no 1s and no default_category is provided.
Source

pub fn lreshape( &self, groups: &BTreeMap<String, Vec<String>>, dropna: bool, ) -> Result<Self, FrameError>

Reshape wide-format data to long format by grouping specified columns into target columns.

Matches pd.lreshape(df, groups, dropna=...).

groups: mapping of target column name to list of wide source column names. All lists in groups must have identical lengths.

§Errors

Returns FrameError::CompatibilityRejected if the group column lists do not have equal lengths.

Source

pub fn wide_to_long( &self, stubnames: &[&str], i: &[&str], j: &str, sep: &str, suffix: &str, ) -> Result<Self, FrameError>

Reshape wide DataFrame to long format.

Matches pd.wide_to_long(df, stubnames, i, j, sep, suffix).

Source

pub fn squeeze(&self, axis: usize) -> Result<Series, Self>

Squeeze: pandas-named alias for squeeze_to_series.

Matches pd.DataFrame.squeeze(axis).

Source

pub fn get_column(&self, key: &str) -> Series

Get a column by name with a default if not found.

Matches pd.DataFrame.get(key, default). Returns the column as a Series, or a default Series of NaN values.

Source

pub fn where_mask_df( &self, cond_df: &Self, other: &Scalar, ) -> Result<Self, FrameError>

Replace values where condition DataFrame is True with other.

Matches pd.DataFrame.where(cond, other) with a DataFrame condition. Where cond_df is True, keep the original value; where False, use other.

Source

pub fn mask_df( &self, cond_df: &Self, other: &Scalar, ) -> Result<Self, FrameError>

Replace values where condition DataFrame is False with other.

Matches pd.DataFrame.mask(cond, other) with a DataFrame condition. Inverse of where_mask_df: where cond_df is True, replace with other.

Source

pub fn assign_column( &self, name: &str, values: Vec<Scalar>, ) -> Result<Self, FrameError>

Set or replace a column by name with given values.

Matches pd.DataFrame.assign(**kwargs) for single-column assignment. If the column already exists, it is replaced. Otherwise it is appended.

Source

pub fn pct_change(&self, periods: i64) -> Result<Self, FrameError>

Percentage change per column.

Matches pd.DataFrame.pct_change(periods).

Source

pub fn pct_change_with_fill( &self, periods: i64, fill_method: Option<&str>, limit: Option<usize>, ) -> Result<Self, FrameError>

Percentage change per column with fill options.

Matches pd.DataFrame.pct_change(periods, fill_method=..., limit=...).

Source

pub fn ffill(&self, limit: Option<usize>) -> Result<Self, FrameError>

Forward-fill missing values per column.

Matches pd.DataFrame.ffill(). Applies to all columns.

Source

pub fn ffill_axis1(&self, limit: Option<usize>) -> Result<Self, FrameError>

Forward-fill missing values across columns for each row.

Matches pd.DataFrame.ffill(axis=1).

Source

pub fn bfill(&self, limit: Option<usize>) -> Result<Self, FrameError>

Back-fill missing values per column.

Matches pd.DataFrame.bfill(). Applies to all columns.

Source

pub fn pad(&self, limit: Option<usize>) -> Result<Self, FrameError>

Deprecated pandas alias for Self::ffill. Matches pd.DataFrame.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.DataFrame.backfill(limit=None). Per br-frankenpandas-qn0bj.

Source

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

pandas-named alias for Self::bool_. Matches pd.DataFrame.bool(). Per br-frankenpandas-qn0bj. bool is a Rust keyword in type position; the public name uses the raw-identifier form so callers from Rust write df.r#bool(). The Python FFI surface exposes it as bare bool.

Source

pub fn bfill_axis1(&self, limit: Option<usize>) -> Result<Self, FrameError>

Back-fill missing values across columns for each row.

Matches pd.DataFrame.bfill(axis=1).

Source

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

Linearly interpolate missing values per numeric column.

Matches pd.DataFrame.interpolate(). Non-numeric columns are preserved.

Source

pub fn interpolate_method(&self, method: &str) -> Result<Self, FrameError>

Interpolate missing values per numeric column with the specified method.

Matches df.interpolate(method='linear'|'nearest'|'zero').

Source

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

Series::interpolate_with applied to every column, with pandas’ all-object rejection (fvsao.5).

Source

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

Convert dtypes to best-possible types.

Matches pd.DataFrame.convert_dtypes(): each column as Series::convert_dtypes converts it - numbers and bools to pandas’ nullable dtypes, text left as text. It parsed numeric-looking text into numbers (pandas keeps ['1', '2'] as strings; only to_numeric parses) and left numbers unchanged.

Source

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

Matches pd.DataFrame.convert_dtypes(infer_objects=, convert_string=, convert_integer=, convert_boolean=, convert_floating=): each column as convert_column_dtypes_with retypes it (br-frankenpandas-di8vx).

Source

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

Append rows from another DataFrame.

Uses outer join on columns, filling missing with NaN.

⚠️ REMOVED, not deprecated: pd.DataFrame.append raises AttributeError on 2.2.3 (deprecated in 1.4, dropped in 2.0). The pandas spelling is pd.concat([a, b]). FP superset, not parity.

Source

pub fn with_columns_at_positions(&self, columns: Vec<Column>) -> Self

This frame with its columns replaced, position for position, by columns (names, order, axes and labels kept). Rebuilding by POSITION keeps repeated column keys apart: a name-keyed map kept one column per key, so df.round() of columns [‘a’, ‘a’, ‘b’] - or of a column MultiIndex whose leaf names repeat, as a multi-function agg makes - lost columns (br-frankenpandas-i17d4).

Source

pub fn drop(&self, labels: &[&str], axis: usize) -> Result<Self, FrameError>

Drop labels from rows or columns.

Matches df.drop(labels, axis=0) for row removal or df.drop(columns=['a','b']) for column removal. When axis=0, removes rows whose index labels match the given labels. When axis=1, removes columns by name.

Source

pub fn drop_rows_int(&self, labels: &[i64]) -> Result<Self, FrameError>

Drop rows by integer index label (Int64).

Convenience for dropping rows with Int64 index labels.

Source

pub fn truncate( &self, before: Option<&IndexLabel>, after: Option<&IndexLabel>, ) -> Result<Self, FrameError>

Truncate the DataFrame by index label range.

Matches df.truncate(before=..., after=...). Keeps rows where the index label is >= before and <= after.

Source

pub fn first(&self, offset: &str) -> Result<Self, FrameError>

Select rows from the start of a DatetimeIndex up to an offset.

Matches pd.DataFrame.first(offset) where offset is a string like “3D” (days), “1M” (months), “2Y” (years). Selects all rows whose index label falls within the offset from the first index value.

Source

pub fn first_offset(&self, offset: &str) -> Result<Self, FrameError>

Explicit alias for Self::first.

Source

pub fn last(&self, offset: &str) -> Result<Self, FrameError>

Select rows from the end of a DatetimeIndex backward by an offset.

Matches pd.DataFrame.last(offset) where offset is a string like “3D” (days), “1M” (months), “2Y” (years).

§Panics

Panics if the DataFrame reports non-empty but its index has no last label, which indicates internal index corruption.

Source

pub fn last_offset(&self, offset: &str) -> Result<Self, FrameError>

Explicit alias for Self::last.

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 frame state instead of crashing.

Source

pub fn insert( &self, loc: usize, name: impl Into<String>, column: Column, ) -> Result<Self, FrameError>

Insert a column at a specific position.

Matches df.insert(loc, column, value). The column is placed at position loc (0-indexed) in the column order.

Source

pub fn insert_allow_duplicates( &self, loc: usize, name: impl Into<String>, column: Column, allow_duplicates: bool, ) -> Result<Self, FrameError>

Insert a column at a specific position, optionally allowing duplicate labels.

Matches df.insert(loc, column, value, allow_duplicates=...).

Source

pub fn isetitem(&self, loc: usize, column: Column) -> Result<Self, FrameError>

Replace the column at a specific integer position.

Matches pd.DataFrame.isetitem(loc, value) for a single column. This keeps the existing column label at loc and installs a new column array rather than mutating the old array in place.

Source

pub fn isetitem_values( &self, loc: usize, values: Vec<Scalar>, ) -> Result<Self, FrameError>

Replace the column at loc from scalar values.

Convenience arraylike form for Self::isetitem.

Source

pub fn isetitem_scalar( &self, loc: usize, value: Scalar, ) -> Result<Self, FrameError>

Replace the column at loc with a scalar broadcast across every row.

Convenience scalar form for Self::isetitem.

Source

pub fn pop(&self, name: &str) -> Result<(Series, Self), FrameError>

Remove and return a column as a Series.

Matches col = df.pop('column_name'). Returns the removed column as a Series and the modified DataFrame (since we use immutable semantics).

Source

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

Replace values element-wise across all columns.

Matches df.replace(to_replace, value). Applies scalar-to-scalar replacement to every cell in the DataFrame.

Source

pub fn replace_dict( &self, per_column: &BTreeMap<String, Vec<(Scalar, Scalar)>>, ) -> Result<Self, FrameError>

Replace values on a per-column basis.

Matches df.replace({'col': {old: new, ...}, ...}). Each entry maps a column name to its replacement pairs. Columns not listed in the map are left unchanged.

Source

pub fn replace_regex(&self, pat: &str, repl: &str) -> Result<Self, FrameError>

Replace string values matching a regex pattern across all columns.

Matches df.replace(regex=pat, value=repl). Only applies to Utf8 columns; non-string columns are left unchanged.

Source

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

Series::replace_regex_cells over every text column: a string cell the pattern finds becomes the non-string value whole (br-frankenpandas-otatv).

Source

pub fn align_on_index( &self, other: &Self, mode: AlignMode, ) -> Result<(Self, Self), FrameError>

Align two DataFrames on their indices.

Matches df1.align(df2, join='outer'|'inner'|'left'|'right'). Returns a tuple of two DataFrames aligned to a common index. Columns are unioned — missing columns filled with NaN.

Source

pub fn align( &self, other: &Self, mode: AlignMode, ) -> Result<(Self, Self), FrameError>

pandas-named alias for Self::align_on_index.

Matches pd.DataFrame.align(other, join=...) for index-axis alignment.

Source

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

Compare two DataFrames element-wise, showing differences.

Matches df.compare(other). Returns a DataFrame with multi-level-like columns showing self and other values where they differ. Only rows and columns with at least one difference are included.

Source

pub fn compare_with_result_names( &self, other: &Self, result_names: (&str, &str), ) -> Result<Self, FrameError>

Matches df.compare(other, result_names=(left, right)).

Source

pub fn compare_with_options( &self, other: &Self, result_names: (&str, &str), keep_shape: bool, keep_equal: bool, ) -> Result<Self, FrameError>

Matches df.compare(other, keep_shape=..., keep_equal=..., result_names=(left, right)) for align_axis=1 (the default, columns axis). keep_shape=true keeps every row and column (equal cells are NaN, or the original value when keep_equal=true); keep_equal=true renders equal cells as their value instead of NaN. (align_axis=0 row stacking is tracked separately under br-frankenpandas-lqu84.)

Source

pub fn compare_with_align_axis( &self, other: &Self, result_names: (&str, &str), keep_shape: bool, keep_equal: bool, align_axis: i64, ) -> Result<Self, FrameError>

Matches df.compare(other, align_axis=..., keep_shape=..., keep_equal=..., result_names=(left, right)).

align_axis=1 (default) lays self/other side by side as col_self/col_other columns; align_axis=0 stacks them as a 2-level row MultiIndex (label, result_name) over the original columns. keep_shape/keep_equal behave as in pandas.

Source

pub fn select_dtypes( &self, include: &[DType], exclude: &[DType], ) -> Result<Self, FrameError>

Select columns by data type.

Matches df.select_dtypes(include=['float64'], exclude=['bool']). Pass empty slices to not filter on that criterion.

Source

pub fn select_dtypes_by_name( &self, include: &[&str], exclude: &[&str], ) -> Result<Self, FrameError>

Select columns by pandas-style dtype alias names.

Matches df.select_dtypes(include='number', exclude='object') and its list-of-strings form. Each alias expands to the corresponding set of DType variants; unknown aliases return an error consistent with pandas’ TypeError: data type '...' not understood.

Recognized aliases (the crate’s expand_dtype_alias table):

  • "number" → Int64 + Float64 + Timedelta64, "integer" → Int64 + Timedelta64 (numpy’s timedelta64 is a signed integer)
  • "int", "int64", "Int64" → Int64
  • "floating", "float", "float64", "Float64" → Float64
  • "bool", "boolean" → Bool
  • "object" → the object columns, "string" pandas’ string ones
  • "category", "timedelta", "datetime" (naive), "complex"
  • a narrow numpy name ("int32", "uint8", "float32") or its masked form ("Int32") → the columns of exactly that width, while the exact 64-bit names ("int64", "int", "float64", "float") leave those out and the abstract ones ("number", "integer", "floating") keep them (fvsao.23).

Include and exclude overlap - pandas’ error - only on one canonical type (select_dtype_canonical): ‘int’ beside ‘integer’ selects the int64 columns that are not integers, none (it was refused; br-frankenpandas-cmv2p).

Source

pub fn filter_labels( &self, items: Option<&[&str]>, like: Option<&str>, regex: Option<&str>, axis: usize, ) -> Result<Self, FrameError>

Filter rows or columns by label.

Matches df.filter(items, like, regex, axis).

  • items: exact label match
  • like: substring match
  • regex: regex match

Only one of items/like/regex should be provided at a time. axis=0 filters rows by index label, axis=1 filters columns.

Source

pub fn take_columns(&self, indices: &[usize]) -> Result<Self, FrameError>

Helper for selecting columns by normalized non-negative positional indices.

Used by df.take(indices, axis=1) after negative indices have been resolved.

Source

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

Return a boolean DataFrame showing whether each element is in values.

Matches df.isin(values).

Source

pub fn isin_dict( &self, per_column: &BTreeMap<String, Vec<Scalar>>, ) -> Result<Self, FrameError>

Element-wise membership test with per-column value sets.

Matches df.isin({'col': [v1, v2], ...}). Each column is tested against its own set of allowed values. Columns not in per_column get all-False.

Source

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

Check whether this DataFrame is identical to another.

Matches df.equals(other). Compares shape, column names, index, and values.

Source

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

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

§Errors

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

Source

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

Return the index label of the first non-null row (checks all columns).

Matches df.first_valid_index().

Source

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

Return the index label of the last non-null row (checks all columns).

Matches df.last_valid_index().

Source

pub fn asof( &self, label: &IndexLabel, subset: Option<&[&str]>, ) -> Result<Series, FrameError>

Return the last row(s) without any NaNs before where.

Matches df.asof(where, subset=...).

Source

pub fn crosstab( index_series: &Series, columns_series: &Series, ) -> Result<Self, FrameError>

Compute a crosstab (contingency table) from two columns.

Matches pd.crosstab(index, columns). Counts occurrences of each (row, col) combination.

Source

pub fn crosstab_normalize( index_series: &Series, columns_series: &Series, normalize: &str, ) -> Result<Self, FrameError>

Crosstab with optional normalization.

Matches pd.crosstab(index, columns, normalize=...). normalize: “all” divides by grand total, “index” divides by row totals, “columns” divides by column totals.

Source

pub fn explode(&self, column: &str, sep: &str) -> Result<Self, FrameError>

Explode a column containing delimited strings into multiple rows.

Matches df.explode(column) for string columns. Splits the specified column by sep and replicates other columns accordingly.

Source

pub fn explode_with_ignore_index( &self, column: &str, sep: &str, ignore_index: bool, ) -> Result<Self, FrameError>

Explode a column containing delimited strings into multiple rows.

Matches df.explode(column, ignore_index=...) for the current string-delimited explode surface.

Source

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

pandas’ df.explode(columns, ignore_index) over list cells (fvsao.33): a row whose cell in columns is a list becomes one row per item (an empty list one row of NaN), a non-list value stays one row; several columns must hold lists of the same length in each row (pandas’ ValueError otherwise). The other columns repeat with their dtypes, the exploded object ones are object, as pandas’, and the index repeats its labels (a fresh RangeIndex with ignore_index). A column of another dtype holds no list and keeps its dtype, as pandas’ (it came back object, br-frankenpandas-xxryq).

Source

pub fn xs(&self, key: &IndexLabel) -> Result<Self, FrameError>

Select a cross-section of rows by index label.

Matches df.xs(key). Returns all rows whose index matches key.

Source

pub fn xs_level( &self, key: &IndexLabel, level: usize, ) -> Result<Self, FrameError>

Select a cross-section of rows by a specific row-MultiIndex level.

Matches df.xs(key, level=...) and drops the selected level from the resulting row index.

Source

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

Drop the index level (reset to default integer index).

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

Source

pub fn droplevel_level(&self, level: usize) -> Result<Self, FrameError>

Drop a specific row-MultiIndex level.

Source

pub fn swaplevel(&self) -> Self

Swap levels of a composite string index.

Matches df.swaplevel(). For indexes of the form “(a, b)”, swaps the components to produce “(b, a)”. Non-composite labels are returned unchanged.

Source

pub fn swaplevel_levels(&self, i: usize, j: usize) -> Result<Self, FrameError>

Swap two row-MultiIndex levels.

Source

pub fn reorder_levels(&self, order: &[usize]) -> Result<Self, FrameError>

Reorder row-MultiIndex levels.

Trait Implementations§

Source§

impl Add for DataFrame

Source§

type Output = Result<DataFrame, FrameError>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: DataFrame) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<&DataFrame> for &DataFrame

Source§

type Output = Result<DataFrame, FrameError>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &DataFrame) -> Self::Output

Performs the + operation. Read more
Source§

impl Clone for DataFrame

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 DataFrame

Source§

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

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

impl<'de> Deserialize<'de> for DataFrame

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 DataFrame

Source§

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

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

impl<'a> From<&'a DataFrame> for DataFrameArithmeticOperand<'a>

Source§

fn from(value: &'a DataFrame) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a DataFrame> for DataFrameComparisonOperand<'a>

Source§

fn from(value: &'a DataFrame) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for DataFrame

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 DataFrame

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 DataFrame

Auto Trait Implementations§

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more