Accessing Rows and Columns#

Columns are accessed by the column name:

    table.columns[column_name]

Rows are ordered by their integer location (iloc) within the DataFrame and can be accessed by that index:

    table.rows[idx]

the column label row can be accessed by the col_label_row attribute:

    table.col_label_row

After creating a table, you can set cell (rectangle patch) properties and textproperties by accessing functions of the Sequence, ie:

    table.columns[column_name].set_facecolor("#f0f0f0")

    table.rows[0].set_facecolor("#f0f0f0")

Available functions are:

    # rectangle patch setters
    set_alpha
    set_color
    set_edgecolor
    set_facecolor
    set_fill
    set_hatch
    set_linestyle
    set_linewidth

    # fontproperty setters
    set_fontcolor
    set_fontfamily
    set_fontsize
    set_ha
    set_ma

See also

You can find an example of accessing rows and columns in the Heatmap Example