16. Container Export

Methods for exporting alternative representations from Series and Frame.

16.1. Index

Index.to_series()[source]

Return a Series with values from this Index’s labels.

Index.to_html(config: Optional[static_frame.core.display.DisplayConfig] = None) → str

Return an HTML table representation of this Index using standard TABLE, TR, and TD tags. This is not a complete HTML page.

Parameters

config – Optional static_frame.DisplayConfig instance.

Index.to_html_datatables(fp: Union[str, pathlib.Path, TextIO, None] = None, *, show: bool = True, config: Optional[static_frame.core.display.DisplayConfig] = None) → Optional[str]

Return a complete HTML representation of this Index using the DataTables JS library for table naviagation and search. The page links to CDNs for JS resources, and thus will not fully render without an internet connection.

Parameters
  • fp – optional file path to write; if not provided, a temporary file will be created. Note: the caller is responsible for deleting this file.

  • show – if True, the file will be opened with a webbrowser.

  • config – Optional static_frame.DisplayConfig instance.

Returns

Absolute file path to the file written.

Index.to_pandas() → pandas.Index[source]

Return a Pandas Index.

16.2. Index Hierarchy

IndexHierarchy.to_frame() → Frame[source]

Return the index as a Frame.

IndexHierarchy.to_html(config: Optional[static_frame.core.display.DisplayConfig] = None) → str

Return an HTML table representation of this Index using standard TABLE, TR, and TD tags. This is not a complete HTML page.

Parameters

config – Optional static_frame.DisplayConfig instance.

IndexHierarchy.to_html_datatables(fp: Union[str, pathlib.Path, TextIO, None] = None, *, show: bool = True, config: Optional[static_frame.core.display.DisplayConfig] = None) → Optional[str]

Return a complete HTML representation of this Index using the DataTables JS library for table naviagation and search. The page links to CDNs for JS resources, and thus will not fully render without an internet connection.

Parameters
  • fp – optional file path to write; if not provided, a temporary file will be created. Note: the caller is responsible for deleting this file.

  • show – if True, the file will be opened with a webbrowser.

  • config – Optional static_frame.DisplayConfig instance.

Returns

Absolute file path to the file written.

IndexHierarchy.to_pandas() → DataFrame[source]

Return a Pandas MultiIndex.

16.3. Series

Series.to_pairs() → Iterable[Tuple[Hashable, Any]][source]

Return a tuple of tuples, where each inner tuple is a pair of index label, value.

Series.to_frame(axis: int = 1)[source]

Return a static_frame.Frame view of this static_frame.Series. As underlying data is immutable, this is a no-copy operation.

Series.to_frame_go(axis: int = 1)[source]

Return static_frame.FrameGO view of this static_frame.Series. As underlying data is immutable, this is a no-copy operation.

Series.to_pandas() → DataFrame[source]

Return a Pandas Series.

Series.to_html(config: Optional[static_frame.core.display.DisplayConfig] = None)[source]

Return an HTML table representation of this Series using standard TABLE, TR, and TD tags. This is not a complete HTML page.

Parameters

config – Optional static_frame.DisplayConfig instance.

Series.to_html_datatables(fp: Union[str, pathlib.Path, TextIO, None] = None, show: bool = True, config: Optional[static_frame.core.display.DisplayConfig] = None) → str[source]

Return a complete HTML representation of this Series using the DataTables JS library for table naviagation and search. The page links to CDNs for JS resources, and thus will not fully render without an internet connection.

Parameters
  • fp – optional file path to write; if not provided, a temporary file will be created. Note: the caller is responsible for deleting this file.

  • show – if True, the file will be opened with a webbrowser.

  • config – Optional static_frame.DisplayConfig instance.

Returns

Absolute file path to the file written.

16.4. Frame

Frame.to_pairs(axis) → Iterable[Tuple[Hashable, Iterable[Tuple[Hashable, Any]]]][source]

Return a tuple of major axis key, minor axis key vlaue pairs, where major axis is determined by the axis argument.

Frame.to_frame_go() → static_frame.core.frame.FrameGO[source]

Return a FrameGO view of this Frame. As underlying data is immutable, this is a no-copy operation.

Frame.to_pandas() → pandas.DataFrame[source]

Return a Pandas DataFrame.

Frame.to_xarray() → Dataset[source]

Return an xarray Dataset.

In order to preserve columnar types, and following the precedent of Pandas, the Frame, with a 1D index, is translated as a Dataset of 1D arrays, where each DataArray is a 1D array. If the index is an IndexHierarhcy, each column is mapped into an ND array of shape equal to the unique values found at each depth of the index.

Frame.to_arrow(*, include_index: bool = True, include_columns: bool = True) → pyarrow.Table[source]

Return a pyarrow.Table from this Frame.

Frame.to_csv(fp: Union[str, pathlib.Path, TextIO], *, include_index: bool = True, include_columns: bool = True, encoding: Optional[str] = None, line_terminator: str = '\n', store_filter: Optional[static_frame.core.store_filter.StoreFilter] = <static_frame.core.store_filter.StoreFilter object>)[source]

Given a file path or file-like object, write the Frame as tab-delimited text.

Frame.to_tsv(fp: Union[str, pathlib.Path, TextIO], *, include_index: bool = True, include_columns: bool = True, encoding: Optional[str] = None, line_terminator: str = '\n', store_filter: Optional[static_frame.core.store_filter.StoreFilter] = <static_frame.core.store_filter.StoreFilter object>)[source]

Given a file path or file-like object, write the Frame as tab-delimited text.

Frame.to_xlsx(fp: Union[str, pathlib.Path], *, label: Optional[str] = None, include_index: bool = True, include_columns: bool = True, merge_hierarchical_labels: bool = True) → None[source]

Write the Frame as single-sheet XLSX file.

Frame.to_sqlite(fp: Union[str, pathlib.Path], *, label: Optional[str] = None, include_index: bool = True, include_columns: bool = True) → None[source]

Write the Frame as single-table SQLite file.

Frame.to_hdf5(fp: Union[str, pathlib.Path], *, label: Optional[str] = None, include_index: bool = True, include_columns: bool = True) → None[source]

Write the Frame as single-table SQLite file.

Frame.to_parquet(fp: Union[str, pathlib.Path], *, include_index: bool = True, include_columns: bool = True) → None[source]

Write an Arrow Parquet binary file.

Frame.to_html(config: Optional[static_frame.core.display.DisplayConfig] = None) → str[source]

Return an HTML table representation of this Frame using standard TABLE, TR, and TD tags. This is not a complete HTML page.

Parameters

config – Optional static_frame.DisplayConfig instance.

Frame.to_html_datatables(fp: Union[str, pathlib.Path, TextIO, None] = None, show: bool = True, config: Optional[static_frame.core.display.DisplayConfig] = None) → str[source]

Return a complete HTML representation of this Frame using the DataTables JS library for table naviagation and search. The page links to CDNs for JS resources, and thus will not fully render without an internet connection.

Parameters
  • fp – optional file path to write; if not provided, a temporary file will be created. Note: the caller is responsible for deleting this file.

  • show – if True, the file will be opened with a webbrowser.

  • config – Optional static_frame.DisplayConfig instance.

Returns

Absolute file path to the file written.

Frame.to_rst(config: Optional[static_frame.core.display.DisplayConfig] = None) → str[source]

Display the Frame as an RST formatted table.

Frame.to_markdown(config: Optional[static_frame.core.display.DisplayConfig] = None) → str[source]

Display the Frame as a Markdown formatted table.

Frame.to_latex(config: Optional[static_frame.core.display.DisplayConfig] = None) → str[source]

Display the Frame as a LaTeX formatted table.