bigframes._config.DisplayOptions#

class bigframes._config.DisplayOptions(max_columns: int = 20, max_rows: int = 10, precision: int = 6, progress_bar: str | None = 'auto', repr_mode: Literal['head', 'deferred', 'anywidget'] = 'head', render_mode: Literal['plaintext', 'html', 'anywidget'] = 'html', max_colwidth: int | None = 50, max_info_columns: int = 100, max_info_rows: int | None = 200000, memory_usage: bool = True, blob_display: bool = True, blob_display_width: int | None = None, blob_display_height: int | None = None)[source]#

Encapsulates the configuration for displaying objects.

Examples:

Define Repr mode to “deferred” will prevent job execution in repr.

>>> import bigframes.pandas as bpd
>>> df = bpd.read_gbq("bigquery-public-data.ml_datasets.penguins")
>>> bpd.options.display.repr_mode = "deferred"
>>> df.head(20) # will no longer run the job
Computation deferred. Computation will process 28.9 kB

Users can also get a dry run of the job by accessing the query_job property before they’ve run the job. This will return a dry run instance of the job they can inspect.

>>> df.query_job.total_bytes_processed
28947

User can execute the job by calling .to_pandas()

>>> # df.to_pandas()

Reset repr_mode option

>>> bpd.options.display.repr_mode = "head"

Can also set the progress_bar option to see the progress bar in terminal,

>>> bpd.options.display.progress_bar = "terminal"

notebook,

>>> bpd.options.display.progress_bar = "notebook"

or just remove it.

Setting to default value “auto” will detect and show progress bar automatically.

>>> bpd.options.display.progress_bar = "auto"
blob_display: bool = True#

If True, display the blob content in notebook DataFrame preview. Default True.

Examples:

>>> import bigframes.pandas as bpd
>>> bpd.options.display.blob_display = True
blob_display_height: int | None = None#

Height in pixels that the blob constrained to. Default None..

Examples:

>>> import bigframes.pandas as bpd
>>> bpd.options.display.blob_display_height = 100
blob_display_width: int | None = None#

Width in pixels that the blob constrained to. Default None..

Examples:

>>> import bigframes.pandas as bpd
>>> bpd.options.display.blob_display_width = 100
max_columns: int = 20#

Maximum number of columns to display. Default 20.

If max_columns is exceeded, switch to truncate view.

Examples:

>>> import bigframes.pandas as bpd
>>> bpd.options.display.max_columns = 50
max_colwidth: int | None = 50#

The maximum width in characters of a column in the repr. Default 50.

When the column overflows, a “…” placeholder is embedded in the output. A ‘None’ value means unlimited.

Examples:

>>> import bigframes.pandas as bpd
>>> bpd.options.display.max_colwidth = 20
max_info_columns: int = 100#

Used in DataFrame.info method to decide if information in each column will be printed. Default 100.

Examples:

>>> import bigframes.pandas as bpd
>>> bpd.options.display.max_info_columns = 50
max_info_rows: int | None = 200000#

Limit null check in df.info() only to frames with smaller dimensions than max_info_rows. Default 200,000.

df.info() will usually show null-counts for each column. For large frames, this can be quite slow. max_info_rows and max_info_cols limit this null check only to frames with smaller dimensions than specified.

Examples:

>>> import bigframes.pandas as bpd
>>> bpd.options.display.max_info_rows = 100
max_rows: int = 10#

Maximum number of rows to display. Default 10.

If max_rows is exceeded, switch to truncate view.

Examples:

>>> import bigframes.pandas as bpd
>>> bpd.options.display.max_rows = 50
memory_usage: bool = True#

If True, memory usage of a DataFrame should be displayed when df.info() is called. Default True.

Valid values True, False.

Examples:

>>> import bigframes.pandas as bpd
>>> bpd.options.display.memory_usage = False
precision: int = 6#

Controls the floating point output precision. Defaults to 6.

See pandas.options.display.precision.

Examples:

>>> import bigframes.pandas as bpd
>>> bpd.options.display.precision = 2
progress_bar: str | None = 'auto'#

Determines if progress bars are shown during job runs. Default “auto”.

Valid values are auto, notebook, and terminal. Set to None to remove progress bars.

Examples:

>>> import bigframes.pandas as bpd
>>> bpd.options.display.progress_bar = "terminal"
render_mode: Literal['plaintext', 'html', 'anywidget'] = 'html'#

Determines how to visualize a DataFrame or Series. Default “html”.

plaintext

Display as plain text.

html

Display as HTML table.

anywidget

Display as interactive widget using anywidget library.

repr_mode: Literal['head', 'deferred', 'anywidget'] = 'head'#

Determines how to display a DataFrame or Series. Default “head”.

head

Execute, download, and display results (limited to head) from Dataframe and Series objects during repr.

deferred

Prevent executions from repr statements in DataFrame and Series objects. Instead, estimated bytes processed will be shown. DataFrame and Series objects can still be computed with methods that explicitly execute and download results.

anywidget

Display as interactive widget using anywidget library.

Examples:

>>> import bigframes.pandas as bpd
>>> bpd.options.display.repr_mode = "deferred"