class_docstr: Helps style a DataFrame or Series according to the data with HTML and CSS.
  
  Parameters
  ----------
  data : Series or DataFrame
  precision : int
      precision to round floats to, defaults to pd.options.display.precision
  table_styles : list-like, default None
      list of {selector: (attr, value)} dicts; see Notes
  uuid : str, default None
      a unique identifier to avoid CSS collisions; generated automatically
  caption : str, default None
      caption to attach to the table
  cell_ids : bool, default True
      If True, each cell will have an ``id`` attribute in their HTML tag.
      The ``id`` takes the form ``T_<uuid>_row<num_row>_col<num_col>``
      where ``<uuid>`` is the unique identifier, ``<num_row>`` is the row
      number and ``<num_col>`` is the column number.
  
  Attributes
  ----------
  env : Jinja2 Environment
  template : Jinja2 Template
  loader : Jinja2 Loader
  
  See Also
  --------
  pandas.DataFrame.style
  
  Notes
  -----
  Most styling will be done by passing style functions into
  ``Styler.apply`` or ``Styler.applymap``. Style functions should
  return values with strings containing CSS ``'attr: value'`` that will
  be applied to the indicated cells.
  
  If using in the Jupyter notebook, Styler has defined a ``_repr_html_``
  to automatically render itself. Otherwise call Styler.render to get
  the generated HTML.
  
  CSS classes are attached to the generated HTML
  
  * Index and Column names include ``index_name`` and ``level<k>``
    where `k` is its level in a MultiIndex
  * Index label cells include
  
    * ``row_heading``
    * ``row<n>`` where `n` is the numeric position of the row
    * ``level<k>`` where `k` is the level in a MultiIndex
  
  * Column label cells include
    * ``col_heading``
    * ``col<n>`` where `n` is the numeric position of the column
    * ``evel<k>`` where `k` is the level in a MultiIndex
  
  * Blank cells include ``blank``
  * Data cells include ``data``
class_docstr_tok: ["Helps","style","a","DataFrame","or","Series","according","to","the","data","with","HTML","and","CSS",".","Parameters","--","--","--","--","--","data",":","Series","or","DataFrame","precision",":","int","precision","to","round","floats","to",",","defaults","to","pd.options.display.precision","table_styles",":","list-like",",","default","None","list","of","{","selector",":","(","attr",",","value",")","}","dicts",";","see","Notes","uuid",":","str",",","default","None","a","unique","identifier","to","avoid","CSS","collisions",";","generated","automatically","caption",":","str",",","default","None","caption","to","attach","to","the","table","cell_ids",":","bool",",","default","True","If","True",",","each","cell","will","have","an","``","id","``","attribute","in","their","HTML","tag",".","The","``","id","``","takes","the","form","``","T_","<","uuid",">","_row","<","num_row",">","_col","<","num_col",">","``","where","``","<","uuid",">","``","is","the","unique","identifier",",","``","<","num_row",">","``","is","the","row","number","and","``","<","num_col",">","``","is","the","column","number",".","Attributes","--","--","--","--","--","env",":","Jinja2","Environment","template",":","Jinja2","Template","loader",":","Jinja2","Loader","See","Also","--","--","--","--","pandas.DataFrame.style","Notes","--","--","-","Most","styling","will","be","done","by","passing","style","functions","into","``","Styler.apply","``","or","``","Styler.applymap","``",".","Style","functions","should","return","values","with","strings","containing","CSS","``","'attr",":","value","'","``","that","will","be","applied","to","the","indicated","cells",".","If","using","in","the","Jupyter","notebook",",","Styler","has","defined","a","``","_repr_html_","``","to","automatically","render","itself",".","Otherwise","call","Styler.render","to","get","the","generated","HTML",".","CSS","classes","are","attached","to","the","generated","HTML","*","Index","and","Column","names","include","``","index_name","``","and","``","level","<","k",">","``","where","`","k","`","is","its","level","in","a","MultiIndex","*","Index","label","cells","include","*","``","row_heading","``","*","``","row","<","n",">","``","where","`","n","`","is","the","numeric","position","of","the","row","*","``","level","<","k",">","``","where","`","k","`","is","the","level","in","a","MultiIndex","*","Column","label","cells","include","*","``","col_heading","``","*","``","col","<","n",">","``","where","`","n","`","is","the","numeric","position","of","the","column","*","``","evel","<","k",">","``","where","`","k","`","is","the","level","in","a","MultiIndex","*","Blank","cells","include","``","blank","``","*","Data","cells","include","``","data","``"]
docstr: Format the text display value of cells.
  
  .. versionadded:: 0.18.0
  
  Parameters
  ----------
  formatter : str, callable, or dict
  subset : IndexSlice
      An argument to ``DataFrame.loc`` that restricts which elements
      ``formatter`` is applied to.
  
  Returns
  -------
  self : Styler
  
  Notes
  -----
  
  ``formatter`` is either an ``a`` or a dict ``{column name: a}`` where
  ``a`` is one of
  
  - str: this will be wrapped in: ``a.format(x)``
  - callable: called with the value of an individual cell
  
  The default display value for numeric values is the "general" (``g``)
  format with ``pd.options.display.precision`` precision.
  
  Examples
  --------
  
  >>> df = pd.DataFrame(np.random.randn(4, 2), columns=['a', 'b'])
  >>> df.style.format("{:.2%}")
  >>> df['c'] = ['a', 'b', 'c', 'd']
  >>> df.style.format({'c': str.upper})
code: def format(self, formatter, subset=None):
      """
      Format the text display value of cells.
  
      .. versionadded:: 0.18.0
  
      Parameters
      ----------
      formatter : str, callable, or dict
      subset : IndexSlice
          An argument to ``DataFrame.loc`` that restricts which elements
          ``formatter`` is applied to.
  
      Returns
      -------
      self : Styler
  
      Notes
      -----
  
      ``formatter`` is either an ``a`` or a dict ``{column name: a}`` where
      ``a`` is one of
  
      - str: this will be wrapped in: ``a.format(x)``
      - callable: called with the value of an individual cell
  
      The default display value for numeric values is the "general" (``g``)
      format with ``pd.options.display.precision`` precision.
  
      Examples
      --------
  
      >>> df = pd.DataFrame(np.random.randn(4, 2), columns=['a', 'b'])
      >>> df.style.format("{:.2%}")
      >>> df['c'] = ['a', 'b', 'c', 'd']
      >>> df.style.format({'c': str.upper})
      """
      if subset is None:
          row_locs = range(len(self.data))
          col_locs = range(len(self.data.columns))
      else:
          subset = _non_reducing_slice(subset)
          if len(subset) == 1:
              subset = subset, self.data.columns
  
          sub_df = self.data.loc[subset]
          row_locs = self.data.index.get_indexer_for(sub_df.index)
          col_locs = self.data.columns.get_indexer_for(sub_df.columns)
  
      if is_dict_like(formatter):
          for col, col_formatter in formatter.items():
              # formatter must be callable, so '{}' are converted to lambdas
              col_formatter = _maybe_wrap_formatter(col_formatter)
              col_num = self.data.columns.get_indexer_for([col])[0]
  
              for row_num in row_locs:
                  self._display_funcs[
                      (row_num, col_num)
                  ] = col_formatter
      else:
          # single scalar to format all cells with
          locs = product(*(row_locs, col_locs))
          for i, j in locs:
              formatter = _maybe_wrap_formatter(formatter)
              self._display_funcs[(i, j)] = formatter
      return self
  
imports: from collections import defaultdict
  from contextlib import contextmanager
  import copy
  from functools import partial
  from itertools import product
  from uuid import uuid1
  import numpy
  from pandas.compat import range
  from pandas.util._decorators import Appender
  from pandas.core.dtypes.common import is_float, is_string_like
  from pandas.core.dtypes.generic import ABCSeries
  import pandas
  from pandas.api.types import is_dict_like, is_list_like
  import pandas.core.common
  from pandas.core.config import get_option
  from pandas.core.generic import _shared_docs
  from pandas.core.indexing import _maybe_numeric_slice, _non_reducing_slice
label_desc: Use image node_id 5 for calling the Styler obj's underlying member method code with example usage: obj.format(formatter, subset) and returns: self