Skip to main content

DataFrameIoExt

Trait DataFrameIoExt 

Source
pub trait DataFrameIoExt {
Show 55 methods // Required methods fn to_parquet(&self, path: &Path) -> Result<(), IoError>; fn to_parquet_bytes(&self) -> Result<Vec<u8>, IoError>; fn to_orc(&self, path: &Path) -> Result<(), IoError>; fn to_orc_file(&self, path: &Path) -> Result<(), IoError>; fn to_orc_bytes(&self) -> Result<Vec<u8>, IoError>; fn to_hdf(&self, path: &Path) -> Result<(), IoError>; fn to_hdf_file(&self, path: &Path) -> Result<(), IoError>; fn to_hdf_key(&self, path: &Path, key: &str) -> Result<(), IoError>; fn to_hdf_with_options( &self, path: &Path, options: &HdfWriteOptions, ) -> Result<(), IoError>; fn to_csv_file(&self, path: &Path) -> Result<(), IoError>; fn to_csv_string(&self) -> Result<String, IoError>; fn to_csv_string_with_options( &self, options: &CsvWriteOptions, ) -> Result<String, IoError>; fn to_markdown_string(&self) -> Result<String, IoError>; fn to_markdown_string_with_options( &self, options: &MarkdownWriteOptions, ) -> Result<String, IoError>; fn to_markdown_file(&self, path: &Path) -> Result<(), IoError>; fn to_markdown_file_with_options( &self, path: &Path, options: &MarkdownWriteOptions, ) -> Result<(), IoError>; fn to_latex_string(&self) -> Result<String, IoError>; fn to_latex_string_with_options( &self, options: &LatexWriteOptions, ) -> Result<String, IoError>; fn to_latex_file(&self, path: &Path) -> Result<(), IoError>; fn to_latex_file_with_options( &self, path: &Path, options: &LatexWriteOptions, ) -> Result<(), IoError>; fn to_html_string(&self) -> Result<String, IoError>; fn to_html_string_with_options( &self, options: &HtmlWriteOptions, ) -> Result<String, IoError>; fn to_html_file(&self, path: &Path) -> Result<(), IoError>; fn to_html_file_with_options( &self, path: &Path, options: &HtmlWriteOptions, ) -> Result<(), IoError>; fn to_xml_string(&self) -> Result<String, IoError>; fn to_xml_string_with_options( &self, options: &XmlWriteOptions, ) -> Result<String, IoError>; fn to_xml(&self, path: &Path) -> Result<(), IoError>; fn to_xml_file(&self, path: &Path) -> Result<(), IoError>; fn to_xml_file_with_options( &self, path: &Path, options: &XmlWriteOptions, ) -> Result<(), IoError>; fn to_json_file( &self, path: &Path, orient: JsonOrient, ) -> Result<(), IoError>; fn to_json_string(&self, orient: JsonOrient) -> Result<String, IoError>; fn to_pickle(&self, path: &Path) -> Result<(), IoError>; fn to_pickle_file(&self, path: &Path) -> Result<(), IoError>; fn to_pickle_with_options( &self, path: &Path, options: &PickleWriteOptions, ) -> Result<(), IoError>; fn to_pickle_bytes(&self) -> Result<Vec<u8>, IoError>; fn to_pickle_bytes_with_options( &self, options: &PickleWriteOptions, ) -> Result<Vec<u8>, IoError>; fn to_stata(&self, path: &Path) -> Result<(), IoError>; fn to_stata_file(&self, path: &Path) -> Result<(), IoError>; fn to_stata_with_options( &self, path: &Path, options: &StataWriteOptions, ) -> Result<(), IoError>; fn to_stata_bytes(&self) -> Result<Vec<u8>, IoError>; fn to_stata_bytes_with_options( &self, options: &StataWriteOptions, ) -> Result<Vec<u8>, IoError>; fn to_excel(&self, path: &Path) -> Result<(), IoError>; fn to_excel_file(&self, path: &Path) -> Result<(), IoError>; fn to_excel_with_options( &self, path: &Path, options: &ExcelWriteOptions, ) -> Result<(), IoError>; fn to_excel_bytes(&self) -> Result<Vec<u8>, IoError>; fn to_excel_bytes_with_options( &self, options: &ExcelWriteOptions, ) -> Result<Vec<u8>, IoError>; fn to_jsonl_file(&self, path: &Path) -> Result<(), IoError>; fn to_jsonl_string(&self) -> Result<String, IoError>; fn to_feather(&self, path: &Path) -> Result<(), IoError>; fn to_feather_file(&self, path: &Path) -> Result<(), IoError>; fn to_feather_bytes(&self) -> Result<Vec<u8>, IoError>; fn to_sql<C: SqlConnection>( &self, conn: &C, table_name: &str, if_exists: SqlIfExists, ) -> Result<(), IoError>; fn to_sql_with_options<C: SqlConnection>( &self, conn: &C, table_name: &str, options: &SqlWriteOptions, ) -> Result<(), IoError>; fn to_clipboard(&self) -> Result<(), IoError>; fn to_gbq( &self, destination_table: &str, project_id: Option<&str>, ) -> Result<(), IoError>;
}
Expand description

Extension trait that adds IO convenience methods to DataFrame.

Import this trait to call df.to_parquet(path), df.to_orc(path), df.to_hdf(path), df.to_parquet_bytes(), etc. directly on DataFrame values.

Required Methods§

Source

fn to_parquet(&self, path: &Path) -> Result<(), IoError>

Write this DataFrame to a Parquet file.

Matches pd.DataFrame.to_parquet(path).

Source

fn to_parquet_bytes(&self) -> Result<Vec<u8>, IoError>

Serialize this DataFrame to Parquet bytes in memory.

Matches pd.DataFrame.to_parquet() with no path (returns bytes).

Source

fn to_orc(&self, path: &Path) -> Result<(), IoError>

Write this DataFrame to an ORC file.

Matches the scoped DataFrame.to_orc(path) compatibility surface.

Source

fn to_orc_file(&self, path: &Path) -> Result<(), IoError>

Write this DataFrame to an ORC file.

Explicit file-suffixed form of DataFrameIoExt::to_orc.

Source

fn to_orc_bytes(&self) -> Result<Vec<u8>, IoError>

Serialize this DataFrame to ORC bytes in memory.

Source

fn to_hdf(&self, path: &Path) -> Result<(), IoError>

Write this DataFrame to an HDF5 file at the default key.

Matches the scoped DataFrame.to_hdf(path) compatibility surface.

Source

fn to_hdf_file(&self, path: &Path) -> Result<(), IoError>

Write this DataFrame to an HDF5 file at the default key.

Explicit file-suffixed form of DataFrameIoExt::to_hdf.

Source

fn to_hdf_key(&self, path: &Path, key: &str) -> Result<(), IoError>

Write this DataFrame to an HDF5 file at an explicit key.

Source

fn to_hdf_with_options( &self, path: &Path, options: &HdfWriteOptions, ) -> Result<(), IoError>

Write this DataFrame to an HDF5 file with explicit options.

Source

fn to_csv_file(&self, path: &Path) -> Result<(), IoError>

Write this DataFrame to a CSV file.

Matches pd.DataFrame.to_csv(path).

Source

fn to_csv_string(&self) -> Result<String, IoError>

Serialize this DataFrame to a CSV string.

Matches pd.DataFrame.to_csv() with no path.

Source

fn to_csv_string_with_options( &self, options: &CsvWriteOptions, ) -> Result<String, IoError>

Serialize this DataFrame to a CSV string with explicit write options.

Matches pd.DataFrame.to_csv(sep, na_rep, header, index, index_label).

Source

fn to_markdown_string(&self) -> Result<String, IoError>

Serialize this DataFrame to a Markdown table string.

Matches pd.DataFrame.to_markdown() with no buffer.

Source

fn to_markdown_string_with_options( &self, options: &MarkdownWriteOptions, ) -> Result<String, IoError>

Serialize this DataFrame to a Markdown table string with explicit options.

Source

fn to_markdown_file(&self, path: &Path) -> Result<(), IoError>

Write this DataFrame to a Markdown table file.

Uses a file-suffixed name to avoid colliding with DataFrame::to_markdown(include_index, tablefmt).

Source

fn to_markdown_file_with_options( &self, path: &Path, options: &MarkdownWriteOptions, ) -> Result<(), IoError>

Write this DataFrame to a Markdown table file with explicit options.

Source

fn to_latex_string(&self) -> Result<String, IoError>

Serialize this DataFrame to a LaTeX tabular string.

Matches pd.DataFrame.to_latex() with no buffer.

Source

fn to_latex_string_with_options( &self, options: &LatexWriteOptions, ) -> Result<String, IoError>

Serialize this DataFrame to a LaTeX tabular string with explicit options.

Source

fn to_latex_file(&self, path: &Path) -> Result<(), IoError>

Write this DataFrame to a LaTeX tabular file.

Uses a file-suffixed name to avoid colliding with DataFrame::to_latex(include_index).

Source

fn to_latex_file_with_options( &self, path: &Path, options: &LatexWriteOptions, ) -> Result<(), IoError>

Write this DataFrame to a LaTeX tabular file with explicit options.

Source

fn to_html_string(&self) -> Result<String, IoError>

Serialize this DataFrame to an HTML table string.

Matches pd.DataFrame.to_html() with no buffer.

Source

fn to_html_string_with_options( &self, options: &HtmlWriteOptions, ) -> Result<String, IoError>

Serialize this DataFrame to an HTML table string with explicit options.

Source

fn to_html_file(&self, path: &Path) -> Result<(), IoError>

Write this DataFrame to an HTML file.

Matches pd.DataFrame.to_html(path).

Source

fn to_html_file_with_options( &self, path: &Path, options: &HtmlWriteOptions, ) -> Result<(), IoError>

Write this DataFrame to an HTML file with explicit options.

Source

fn to_xml_string(&self) -> Result<String, IoError>

Serialize this DataFrame to an XML document string.

Matches pd.DataFrame.to_xml() with no buffer for the writer-only subset.

Source

fn to_xml_string_with_options( &self, options: &XmlWriteOptions, ) -> Result<String, IoError>

Serialize this DataFrame to an XML document string with explicit options.

Source

fn to_xml(&self, path: &Path) -> Result<(), IoError>

Write this DataFrame to an XML file.

Matches pd.DataFrame.to_xml(path).

Source

fn to_xml_file(&self, path: &Path) -> Result<(), IoError>

Write this DataFrame to an XML file.

Matches pd.DataFrame.to_xml(path).

Source

fn to_xml_file_with_options( &self, path: &Path, options: &XmlWriteOptions, ) -> Result<(), IoError>

Write this DataFrame to an XML file with explicit options.

Source

fn to_json_file(&self, path: &Path, orient: JsonOrient) -> Result<(), IoError>

Write this DataFrame to a JSON file.

Matches pd.DataFrame.to_json(path).

Source

fn to_json_string(&self, orient: JsonOrient) -> Result<String, IoError>

Serialize this DataFrame to a JSON string.

Matches pd.DataFrame.to_json() with no path.

Source

fn to_pickle(&self, path: &Path) -> Result<(), IoError>

Write this DataFrame to a Pickle file.

Matches pd.DataFrame.to_pickle(path) for the supported envelope.

Source

fn to_pickle_file(&self, path: &Path) -> Result<(), IoError>

Write this DataFrame to a Pickle file.

Explicit file-suffixed form of DataFrameIoExt::to_pickle.

Source

fn to_pickle_with_options( &self, path: &Path, options: &PickleWriteOptions, ) -> Result<(), IoError>

Write this DataFrame to a Pickle file with explicit options.

Source

fn to_pickle_bytes(&self) -> Result<Vec<u8>, IoError>

Serialize this DataFrame to Pickle bytes.

Source

fn to_pickle_bytes_with_options( &self, options: &PickleWriteOptions, ) -> Result<Vec<u8>, IoError>

Serialize this DataFrame to Pickle bytes with explicit options.

Source

fn to_stata(&self, path: &Path) -> Result<(), IoError>

Write this DataFrame to a Stata DTA file.

Matches pd.DataFrame.to_stata(path) for the supported subset.

Source

fn to_stata_file(&self, path: &Path) -> Result<(), IoError>

Write this DataFrame to a Stata DTA file.

Explicit file-suffixed form of DataFrameIoExt::to_stata.

Source

fn to_stata_with_options( &self, path: &Path, options: &StataWriteOptions, ) -> Result<(), IoError>

Write this DataFrame to a Stata DTA file with explicit options.

Source

fn to_stata_bytes(&self) -> Result<Vec<u8>, IoError>

Serialize this DataFrame to Stata DTA bytes.

Source

fn to_stata_bytes_with_options( &self, options: &StataWriteOptions, ) -> Result<Vec<u8>, IoError>

Serialize this DataFrame to Stata DTA bytes with explicit options.

Source

fn to_excel(&self, path: &Path) -> Result<(), IoError>

Write this DataFrame to an Excel (.xlsx) file.

Matches pd.DataFrame.to_excel(path).

Source

fn to_excel_file(&self, path: &Path) -> Result<(), IoError>

Write this DataFrame to an Excel (.xlsx) file.

Explicit file-suffixed form of DataFrameIoExt::to_excel.

Source

fn to_excel_with_options( &self, path: &Path, options: &ExcelWriteOptions, ) -> Result<(), IoError>

Write this DataFrame to an Excel (.xlsx) file with explicit write options.

Source

fn to_excel_bytes(&self) -> Result<Vec<u8>, IoError>

Serialize this DataFrame to Excel (.xlsx) bytes in memory.

Source

fn to_excel_bytes_with_options( &self, options: &ExcelWriteOptions, ) -> Result<Vec<u8>, IoError>

Serialize this DataFrame to Excel (.xlsx) bytes with explicit write options.

Source

fn to_jsonl_file(&self, path: &Path) -> Result<(), IoError>

Write this DataFrame to a JSONL file (one JSON object per line).

Matches pd.DataFrame.to_json(path, orient='records', lines=True).

Source

fn to_jsonl_string(&self) -> Result<String, IoError>

Serialize this DataFrame to newline-delimited JSON.

Matches pd.DataFrame.to_json(orient='records', lines=True).

Source

fn to_feather(&self, path: &Path) -> Result<(), IoError>

Write this DataFrame to an Arrow IPC (Feather v2) file.

Matches pd.DataFrame.to_feather(path).

Source

fn to_feather_file(&self, path: &Path) -> Result<(), IoError>

Write this DataFrame to an Arrow IPC (Feather v2) file.

Explicit file-suffixed form of DataFrameIoExt::to_feather.

Source

fn to_feather_bytes(&self) -> Result<Vec<u8>, IoError>

Serialize this DataFrame to Arrow IPC (Feather v2) bytes.

Source

fn to_sql<C: SqlConnection>( &self, conn: &C, table_name: &str, if_exists: SqlIfExists, ) -> Result<(), IoError>

Write this DataFrame to a SQL table.

Matches pd.DataFrame.to_sql(name, con).

Source

fn to_sql_with_options<C: SqlConnection>( &self, conn: &C, table_name: &str, options: &SqlWriteOptions, ) -> Result<(), IoError>

Write this DataFrame to a SQL table with pandas-style SQL write options.

Source

fn to_clipboard(&self) -> Result<(), IoError>

Reject-closed clipboard writer, matching pd.DataFrame.to_clipboard() shape.

Source

fn to_gbq( &self, destination_table: &str, project_id: Option<&str>, ) -> Result<(), IoError>

Reject-closed BigQuery writer, matching pd.DataFrame.to_gbq(destination_table, project_id).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl DataFrameIoExt for DataFrame

Source§

fn to_parquet(&self, path: &Path) -> Result<(), IoError>

Source§

fn to_parquet_bytes(&self) -> Result<Vec<u8>, IoError>

Source§

fn to_orc(&self, path: &Path) -> Result<(), IoError>

Source§

fn to_orc_file(&self, path: &Path) -> Result<(), IoError>

Source§

fn to_orc_bytes(&self) -> Result<Vec<u8>, IoError>

Source§

fn to_hdf(&self, path: &Path) -> Result<(), IoError>

Source§

fn to_hdf_file(&self, path: &Path) -> Result<(), IoError>

Source§

fn to_hdf_key(&self, path: &Path, key: &str) -> Result<(), IoError>

Source§

fn to_hdf_with_options( &self, path: &Path, options: &HdfWriteOptions, ) -> Result<(), IoError>

Source§

fn to_csv_file(&self, path: &Path) -> Result<(), IoError>

Source§

fn to_csv_string(&self) -> Result<String, IoError>

Source§

fn to_csv_string_with_options( &self, options: &CsvWriteOptions, ) -> Result<String, IoError>

Source§

fn to_markdown_string(&self) -> Result<String, IoError>

Source§

fn to_markdown_string_with_options( &self, options: &MarkdownWriteOptions, ) -> Result<String, IoError>

Source§

fn to_markdown_file(&self, path: &Path) -> Result<(), IoError>

Source§

fn to_markdown_file_with_options( &self, path: &Path, options: &MarkdownWriteOptions, ) -> Result<(), IoError>

Source§

fn to_latex_string(&self) -> Result<String, IoError>

Source§

fn to_latex_string_with_options( &self, options: &LatexWriteOptions, ) -> Result<String, IoError>

Source§

fn to_latex_file(&self, path: &Path) -> Result<(), IoError>

Source§

fn to_latex_file_with_options( &self, path: &Path, options: &LatexWriteOptions, ) -> Result<(), IoError>

Source§

fn to_html_string(&self) -> Result<String, IoError>

Source§

fn to_html_string_with_options( &self, options: &HtmlWriteOptions, ) -> Result<String, IoError>

Source§

fn to_html_file(&self, path: &Path) -> Result<(), IoError>

Source§

fn to_html_file_with_options( &self, path: &Path, options: &HtmlWriteOptions, ) -> Result<(), IoError>

Source§

fn to_xml_string(&self) -> Result<String, IoError>

Source§

fn to_xml_string_with_options( &self, options: &XmlWriteOptions, ) -> Result<String, IoError>

Source§

fn to_xml(&self, path: &Path) -> Result<(), IoError>

Source§

fn to_xml_file(&self, path: &Path) -> Result<(), IoError>

Source§

fn to_xml_file_with_options( &self, path: &Path, options: &XmlWriteOptions, ) -> Result<(), IoError>

Source§

fn to_json_file(&self, path: &Path, orient: JsonOrient) -> Result<(), IoError>

Source§

fn to_json_string(&self, orient: JsonOrient) -> Result<String, IoError>

Source§

fn to_pickle(&self, path: &Path) -> Result<(), IoError>

Source§

fn to_pickle_file(&self, path: &Path) -> Result<(), IoError>

Source§

fn to_pickle_with_options( &self, path: &Path, options: &PickleWriteOptions, ) -> Result<(), IoError>

Source§

fn to_pickle_bytes(&self) -> Result<Vec<u8>, IoError>

Source§

fn to_pickle_bytes_with_options( &self, options: &PickleWriteOptions, ) -> Result<Vec<u8>, IoError>

Source§

fn to_stata(&self, path: &Path) -> Result<(), IoError>

Source§

fn to_stata_file(&self, path: &Path) -> Result<(), IoError>

Source§

fn to_stata_with_options( &self, path: &Path, options: &StataWriteOptions, ) -> Result<(), IoError>

Source§

fn to_stata_bytes(&self) -> Result<Vec<u8>, IoError>

Source§

fn to_stata_bytes_with_options( &self, options: &StataWriteOptions, ) -> Result<Vec<u8>, IoError>

Source§

fn to_excel(&self, path: &Path) -> Result<(), IoError>

Source§

fn to_excel_file(&self, path: &Path) -> Result<(), IoError>

Source§

fn to_excel_with_options( &self, path: &Path, options: &ExcelWriteOptions, ) -> Result<(), IoError>

Source§

fn to_excel_bytes(&self) -> Result<Vec<u8>, IoError>

Source§

fn to_excel_bytes_with_options( &self, options: &ExcelWriteOptions, ) -> Result<Vec<u8>, IoError>

Source§

fn to_jsonl_file(&self, path: &Path) -> Result<(), IoError>

Source§

fn to_jsonl_string(&self) -> Result<String, IoError>

Source§

fn to_feather(&self, path: &Path) -> Result<(), IoError>

Source§

fn to_feather_file(&self, path: &Path) -> Result<(), IoError>

Source§

fn to_feather_bytes(&self) -> Result<Vec<u8>, IoError>

Source§

fn to_sql<C: SqlConnection>( &self, conn: &C, table_name: &str, if_exists: SqlIfExists, ) -> Result<(), IoError>

Source§

fn to_sql_with_options<C: SqlConnection>( &self, conn: &C, table_name: &str, options: &SqlWriteOptions, ) -> Result<(), IoError>

Source§

fn to_clipboard(&self) -> Result<(), IoError>

Source§

fn to_gbq( &self, _destination_table: &str, _project_id: Option<&str>, ) -> Result<(), IoError>

Implementors§