pandas.io.formats.style.Styler.hide_columns

Styler.hide_columns(subset=None, level=None, names=False)[source]

Hide the column headers or specific keys in the columns from rendering.

This method has dual functionality:

  • if subset is None then the entire column headers row, or specific levels, will be hidden whilst the data-values remain visible.

  • if a subset is given then those specific columns, including the data-values will be hidden, whilst the column headers row remains visible.

Changed in version 1.3.0.

..deprecated:: 1.4.0

This method should be replaced by hide(axis="columns", **kwargs)

Parameters:
subsetlabel, array-like, IndexSlice, optional

A valid 1d input or single key along the columns axis within DataFrame.loc[:, <subset>], to limit data to before applying the function.

levelint, str, list

The level(s) to hide in a MultiIndex if hiding the entire column headers row. Cannot be used simultaneously with subset.

New in version 1.4.0.

namesbool

Whether to hide the column index name(s), in the case all column headers, or some levels, are visible.

New in version 1.4.0.

Returns:
selfStyler

See also

Styler.hide

Hide the entire index / columns, or specific rows / columns.