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§
Sourcefn to_parquet(&self, path: &Path) -> Result<(), IoError>
fn to_parquet(&self, path: &Path) -> Result<(), IoError>
Write this DataFrame to a Parquet file.
Matches pd.DataFrame.to_parquet(path).
Sourcefn to_parquet_bytes(&self) -> Result<Vec<u8>, IoError>
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).
Sourcefn to_orc(&self, path: &Path) -> Result<(), IoError>
fn to_orc(&self, path: &Path) -> Result<(), IoError>
Write this DataFrame to an ORC file.
Matches the scoped DataFrame.to_orc(path) compatibility surface.
Sourcefn to_orc_file(&self, path: &Path) -> Result<(), IoError>
fn to_orc_file(&self, path: &Path) -> Result<(), IoError>
Write this DataFrame to an ORC file.
Explicit file-suffixed form of DataFrameIoExt::to_orc.
Sourcefn to_orc_bytes(&self) -> Result<Vec<u8>, IoError>
fn to_orc_bytes(&self) -> Result<Vec<u8>, IoError>
Serialize this DataFrame to ORC bytes in memory.
Sourcefn to_hdf(&self, path: &Path) -> Result<(), IoError>
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.
Sourcefn to_hdf_file(&self, path: &Path) -> Result<(), IoError>
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.
Sourcefn to_hdf_key(&self, path: &Path, key: &str) -> Result<(), IoError>
fn to_hdf_key(&self, path: &Path, key: &str) -> Result<(), IoError>
Write this DataFrame to an HDF5 file at an explicit key.
Sourcefn to_hdf_with_options(
&self,
path: &Path,
options: &HdfWriteOptions,
) -> Result<(), IoError>
fn to_hdf_with_options( &self, path: &Path, options: &HdfWriteOptions, ) -> Result<(), IoError>
Write this DataFrame to an HDF5 file with explicit options.
Sourcefn to_csv_file(&self, path: &Path) -> Result<(), IoError>
fn to_csv_file(&self, path: &Path) -> Result<(), IoError>
Write this DataFrame to a CSV file.
Matches pd.DataFrame.to_csv(path).
Sourcefn to_csv_string(&self) -> Result<String, IoError>
fn to_csv_string(&self) -> Result<String, IoError>
Serialize this DataFrame to a CSV string.
Matches pd.DataFrame.to_csv() with no path.
Sourcefn to_csv_string_with_options(
&self,
options: &CsvWriteOptions,
) -> Result<String, IoError>
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).
Sourcefn to_markdown_string(&self) -> Result<String, IoError>
fn to_markdown_string(&self) -> Result<String, IoError>
Serialize this DataFrame to a Markdown table string.
Matches pd.DataFrame.to_markdown() with no buffer.
Sourcefn to_markdown_string_with_options(
&self,
options: &MarkdownWriteOptions,
) -> Result<String, IoError>
fn to_markdown_string_with_options( &self, options: &MarkdownWriteOptions, ) -> Result<String, IoError>
Serialize this DataFrame to a Markdown table string with explicit options.
Sourcefn to_markdown_file(&self, path: &Path) -> Result<(), IoError>
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).
Sourcefn to_markdown_file_with_options(
&self,
path: &Path,
options: &MarkdownWriteOptions,
) -> Result<(), IoError>
fn to_markdown_file_with_options( &self, path: &Path, options: &MarkdownWriteOptions, ) -> Result<(), IoError>
Write this DataFrame to a Markdown table file with explicit options.
Sourcefn to_latex_string(&self) -> Result<String, IoError>
fn to_latex_string(&self) -> Result<String, IoError>
Serialize this DataFrame to a LaTeX tabular string.
Matches pd.DataFrame.to_latex() with no buffer.
Sourcefn to_latex_string_with_options(
&self,
options: &LatexWriteOptions,
) -> Result<String, IoError>
fn to_latex_string_with_options( &self, options: &LatexWriteOptions, ) -> Result<String, IoError>
Serialize this DataFrame to a LaTeX tabular string with explicit options.
Sourcefn to_latex_file(&self, path: &Path) -> Result<(), IoError>
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).
Sourcefn to_latex_file_with_options(
&self,
path: &Path,
options: &LatexWriteOptions,
) -> Result<(), IoError>
fn to_latex_file_with_options( &self, path: &Path, options: &LatexWriteOptions, ) -> Result<(), IoError>
Write this DataFrame to a LaTeX tabular file with explicit options.
Sourcefn to_html_string(&self) -> Result<String, IoError>
fn to_html_string(&self) -> Result<String, IoError>
Serialize this DataFrame to an HTML table string.
Matches pd.DataFrame.to_html() with no buffer.
Sourcefn to_html_string_with_options(
&self,
options: &HtmlWriteOptions,
) -> Result<String, IoError>
fn to_html_string_with_options( &self, options: &HtmlWriteOptions, ) -> Result<String, IoError>
Serialize this DataFrame to an HTML table string with explicit options.
Sourcefn to_html_file(&self, path: &Path) -> Result<(), IoError>
fn to_html_file(&self, path: &Path) -> Result<(), IoError>
Write this DataFrame to an HTML file.
Matches pd.DataFrame.to_html(path).
Sourcefn to_html_file_with_options(
&self,
path: &Path,
options: &HtmlWriteOptions,
) -> Result<(), IoError>
fn to_html_file_with_options( &self, path: &Path, options: &HtmlWriteOptions, ) -> Result<(), IoError>
Write this DataFrame to an HTML file with explicit options.
Sourcefn to_xml_string(&self) -> Result<String, IoError>
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.
Sourcefn to_xml_string_with_options(
&self,
options: &XmlWriteOptions,
) -> Result<String, IoError>
fn to_xml_string_with_options( &self, options: &XmlWriteOptions, ) -> Result<String, IoError>
Serialize this DataFrame to an XML document string with explicit options.
Sourcefn to_xml(&self, path: &Path) -> Result<(), IoError>
fn to_xml(&self, path: &Path) -> Result<(), IoError>
Write this DataFrame to an XML file.
Matches pd.DataFrame.to_xml(path).
Sourcefn to_xml_file(&self, path: &Path) -> Result<(), IoError>
fn to_xml_file(&self, path: &Path) -> Result<(), IoError>
Write this DataFrame to an XML file.
Matches pd.DataFrame.to_xml(path).
Sourcefn to_xml_file_with_options(
&self,
path: &Path,
options: &XmlWriteOptions,
) -> Result<(), IoError>
fn to_xml_file_with_options( &self, path: &Path, options: &XmlWriteOptions, ) -> Result<(), IoError>
Write this DataFrame to an XML file with explicit options.
Sourcefn to_json_file(&self, path: &Path, orient: JsonOrient) -> Result<(), IoError>
fn to_json_file(&self, path: &Path, orient: JsonOrient) -> Result<(), IoError>
Write this DataFrame to a JSON file.
Matches pd.DataFrame.to_json(path).
Sourcefn to_json_string(&self, orient: JsonOrient) -> Result<String, IoError>
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.
Sourcefn to_pickle(&self, path: &Path) -> Result<(), IoError>
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.
Sourcefn to_pickle_file(&self, path: &Path) -> Result<(), IoError>
fn to_pickle_file(&self, path: &Path) -> Result<(), IoError>
Write this DataFrame to a Pickle file.
Explicit file-suffixed form of DataFrameIoExt::to_pickle.
Sourcefn to_pickle_with_options(
&self,
path: &Path,
options: &PickleWriteOptions,
) -> Result<(), IoError>
fn to_pickle_with_options( &self, path: &Path, options: &PickleWriteOptions, ) -> Result<(), IoError>
Write this DataFrame to a Pickle file with explicit options.
Sourcefn to_pickle_bytes(&self) -> Result<Vec<u8>, IoError>
fn to_pickle_bytes(&self) -> Result<Vec<u8>, IoError>
Serialize this DataFrame to Pickle bytes.
Sourcefn to_pickle_bytes_with_options(
&self,
options: &PickleWriteOptions,
) -> Result<Vec<u8>, IoError>
fn to_pickle_bytes_with_options( &self, options: &PickleWriteOptions, ) -> Result<Vec<u8>, IoError>
Serialize this DataFrame to Pickle bytes with explicit options.
Sourcefn to_stata(&self, path: &Path) -> Result<(), IoError>
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.
Sourcefn to_stata_file(&self, path: &Path) -> Result<(), IoError>
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.
Sourcefn to_stata_with_options(
&self,
path: &Path,
options: &StataWriteOptions,
) -> Result<(), IoError>
fn to_stata_with_options( &self, path: &Path, options: &StataWriteOptions, ) -> Result<(), IoError>
Write this DataFrame to a Stata DTA file with explicit options.
Sourcefn to_stata_bytes(&self) -> Result<Vec<u8>, IoError>
fn to_stata_bytes(&self) -> Result<Vec<u8>, IoError>
Serialize this DataFrame to Stata DTA bytes.
Sourcefn to_stata_bytes_with_options(
&self,
options: &StataWriteOptions,
) -> Result<Vec<u8>, IoError>
fn to_stata_bytes_with_options( &self, options: &StataWriteOptions, ) -> Result<Vec<u8>, IoError>
Serialize this DataFrame to Stata DTA bytes with explicit options.
Sourcefn to_excel(&self, path: &Path) -> Result<(), IoError>
fn to_excel(&self, path: &Path) -> Result<(), IoError>
Write this DataFrame to an Excel (.xlsx) file.
Matches pd.DataFrame.to_excel(path).
Sourcefn to_excel_file(&self, path: &Path) -> Result<(), IoError>
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.
Sourcefn to_excel_with_options(
&self,
path: &Path,
options: &ExcelWriteOptions,
) -> Result<(), IoError>
fn to_excel_with_options( &self, path: &Path, options: &ExcelWriteOptions, ) -> Result<(), IoError>
Write this DataFrame to an Excel (.xlsx) file with explicit write options.
Sourcefn to_excel_bytes(&self) -> Result<Vec<u8>, IoError>
fn to_excel_bytes(&self) -> Result<Vec<u8>, IoError>
Serialize this DataFrame to Excel (.xlsx) bytes in memory.
Sourcefn to_excel_bytes_with_options(
&self,
options: &ExcelWriteOptions,
) -> Result<Vec<u8>, IoError>
fn to_excel_bytes_with_options( &self, options: &ExcelWriteOptions, ) -> Result<Vec<u8>, IoError>
Serialize this DataFrame to Excel (.xlsx) bytes with explicit write options.
Sourcefn to_jsonl_file(&self, path: &Path) -> Result<(), IoError>
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).
Sourcefn to_jsonl_string(&self) -> Result<String, IoError>
fn to_jsonl_string(&self) -> Result<String, IoError>
Serialize this DataFrame to newline-delimited JSON.
Matches pd.DataFrame.to_json(orient='records', lines=True).
Sourcefn to_feather(&self, path: &Path) -> Result<(), IoError>
fn to_feather(&self, path: &Path) -> Result<(), IoError>
Write this DataFrame to an Arrow IPC (Feather v2) file.
Matches pd.DataFrame.to_feather(path).
Sourcefn to_feather_file(&self, path: &Path) -> Result<(), IoError>
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.
Sourcefn to_feather_bytes(&self) -> Result<Vec<u8>, IoError>
fn to_feather_bytes(&self) -> Result<Vec<u8>, IoError>
Serialize this DataFrame to Arrow IPC (Feather v2) bytes.
Sourcefn to_sql<C: SqlConnection>(
&self,
conn: &C,
table_name: &str,
if_exists: SqlIfExists,
) -> Result<(), IoError>
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).
Sourcefn to_sql_with_options<C: SqlConnection>(
&self,
conn: &C,
table_name: &str,
options: &SqlWriteOptions,
) -> Result<(), IoError>
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.
Sourcefn to_clipboard(&self) -> Result<(), IoError>
fn to_clipboard(&self) -> Result<(), IoError>
Reject-closed clipboard writer, matching pd.DataFrame.to_clipboard() shape.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".