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)

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.


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.


See also


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