pandas / 1.4.0 / reference / api / pandas.io.formats.style.styler.hide_columns.html /

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
subset :label, 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.

level :int, 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.

names :bool

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
self :Styler

See also

Styler.hide

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

© 2008–2022, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/1.4.0/reference/api/pandas.io.formats.style.Styler.hide_columns.html