MCPcopy
hub / github.com/pandas-dev/pandas / style

Method style

pandas/core/frame.py:1408–1434  ·  view source on GitHub ↗

Returns a Styler object. Contains methods for building a styled HTML representation of the DataFrame. See Also -------- io.formats.style.Styler : Helps style a DataFrame or Series according to the data with HTML and CSS. Examples

(self)

Source from the content-addressed store, hash-verified

1406
1407 @property
1408 def style(self) -> Styler:
1409 """
1410 Returns a Styler object.
1411
1412 Contains methods for building a styled HTML representation of the DataFrame.
1413
1414 See Also
1415 --------
1416 io.formats.style.Styler : Helps style a DataFrame or Series according to the
1417 data with HTML and CSS.
1418
1419 Examples
1420 --------
1421 >>> df = pd.DataFrame({"A": [1, 2, 3]})
1422 >>> df.style # doctest: +SKIP
1423
1424 Please see
1425 `Table Visualization <../../user_guide/style.ipynb>`_ for more examples.
1426 """
1427 # Raise AttributeError so that inspect works even if jinja2 is not installed.
1428 has_jinja2 = import_optional_dependency("jinja2", errors="ignore")
1429 if not has_jinja2:
1430 raise AttributeError("The '.style' accessor requires jinja2")
1431
1432 from pandas.io.formats.style import Styler
1433
1434 return Styler(self)
1435
1436 _shared_docs["items"] = r"""
1437 Iterate over (column name, Series) pairs.

Callers

nothing calls this directly

Calls 2

StylerClass · 0.90

Tested by

no test coverage detected