def
table
cauldron.display.table()

Adds the specified data frame to the display in a nicely formatted scrolling table.

Arguments
Required
Optional
data_frame

Any

The pandas data frame to be rendered to a table.

scale

float

The display scale with units of fractional screen height. A value of 0.5 constrains the output to a maximum height equal to half the height of browser window when viewed. Values below 1.0 are usually recommended so the entire output can be viewed without scrolling.

Default Value: 

0.7

include_index

bool

Whether or not the index column should be included in the displayed output. The index column is not included by default because it is often unnecessary extra information in the display of the data.

Default Value: 

False

max_rows

int

This argument exists to prevent accidentally writing very large data frames to a table, which can cause the notebook display to become sluggish or unresponsive. If you want to display large tables, you need only increase the value of this argument.

Default Value: 

500

sample_rows

int, NoneType

When set to a positive integer value, the DataFrame will be randomly sampled to the specified number of rows when displayed in the table. If the value here is larger than the number of rows in the DataFrame, the sampling will have no effect and the entire DataFrame will be displayed instead.

Default Value: 

None

formats

str, typing.Any, str, str, str, typing.Any, str

An optional dictionary that, when specified, should contain a mapping between column names and formatting strings to apply to that column for display purposes. For example, {'foo': '{:,.2f}%'} would transform a column foo = [12.2121, 34.987123, 42.72839] to display as foo = [12.21%, 34.99%, 42.73%]. The formatters should follow the standard Python string formatting guidelines the same as the str.format() command having the value of the column as the only positional argument in the format arguments. A string value can also be specified for uniform formatting of all columns (or if displaying a series with only a single value).

Default Value: 

None

Basic Usage
01
02
03
04
05
06
07
08
09
10
import cauldron as cd import numpy as np import pandas as pd # Create a data frame of ten rows by four columns populated with random # integers df = pd.DataFrame(np.random.randint(0,10,size=(10, 4)), columns=list('abcd')) # Show that dataframe as a table in the notebook cd.display.table(df)
Examples