output_format()

Use name as the dataset output format for a with block.

Usage

Source

output_format(name)

The previous format is restored on exit, including when the block raises. The switch is context-local.

Parameters

name: OutputFormat
The format to use inside the block: "arrow", "polars" or "pandas".

Raises

ValueError
If name is not "arrow", "polars" or "pandas".

Examples

>>> with pharmadata.output_format("pandas"):
...     df = pharmadata.pharmaverseadam.adsl
...     type(df).__module__.split(".")[0]
'pandas'
>>> pharmadata.get_output_format()  # restored on exit
'polars'