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, 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() → pd.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, 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, 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()[source]

Return a Pandas DataFrame.

Frame.to_csv(fp: Union[str, TextIO], delimiter: str = ',', include_index: bool = True, include_columns: bool = True, encoding: Optional[str] = None, line_terminator: str = '\n')[source]

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

Parameters

delimiter – character to be used for delimiterarating elements.

Frame.to_tsv(fp: Union[str, TextIO], **kwargs)[source]

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

Frame.to_html(config: Optional[static_frame.core.display.DisplayConfig] = None)[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, 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.