neulab/docprompting-conala huggingface dataset:
pandas.io.formats.style.Styler.highlight_quantile   Styler.highlight_quantile(subset=None, color='yellow', axis=0, q_left=0.0, q_right=1.0, interpolation='linear', inclusive='both', props=None)[source]
 
Highlight values defined by a quantile with a style.  New in version 1.3.0.   Parameters 
 
subset:label, array-like, IndexSlice, optional


A valid 2d input to DataFrame.loc[<subset>], or, in the case of a 1d input or single key, to DataFrame.loc[:, <subset>] where the columns are prioritised, to limit data to before applying the function.  
color:str, default ‘yellow’


Background color to use for highlighting.  
axis:{0 or ‘index’, 1 or ‘columns’, None}, default 0


Axis along which to determine and highlight quantiles. If None quantiles are measured over the entire DataFrame. See examples.  
q_left:float, default 0


Left bound, in [0, q_right), for the target quantile range.  
q_right:float, default 1


Right bound, in (q_left, 1], for the target quantile range.  
interpolation:{‘linear’, ‘lower’, ‘higher’, ‘midpoint’, ‘nearest’}


Argument passed to Series.quantile or DataFrame.quantile for quantile estimation.  
inclusive:{‘both’, ‘neither’, ‘left’, ‘right’}


Identify whether quantile bounds are closed or open.  
props:str, default None


CSS properties to use for highlighting. If props is given, color is not used.    Returns 
 
self:Styler

    See also  Styler.highlight_null

Highlight missing values with a style.  Styler.highlight_max

Highlight the maximum with a style.  Styler.highlight_min

Highlight the minimum with a style.  Styler.highlight_between

Highlight a defined range with a style.    Notes This function does not work with str dtypes. Examples Using axis=None and apply a quantile to all collective data 
>>> df = pd.DataFrame(np.arange(10).reshape(2,5) + 1)
>>> df.style.highlight_quantile(axis=None, q_left=0.8, color="#fffd75")
...  
     Or highlight quantiles row-wise or column-wise, in this case by row-wise 
>>> df.style.highlight_quantile(axis=1, q_left=0.8, color="#fffd75")
...  
     Use props instead of default background coloring 
>>> df.style.highlight_quantile(axis=None, q_left=0.2, q_right=0.8,
...     props='font-weight:bold;color:#e83e8c')
pandas.io.formats.style.Styler.loader   Styler.loader=<jinja2.loaders.PackageLoader object>
pandas.io.formats.style.Styler.pipe   Styler.pipe(func, *args, **kwargs)[source]
 
Apply func(self, *args, **kwargs), and return the result.  Parameters 
 
func:function


Function to apply to the Styler. Alternatively, a (callable, keyword) tuple where keyword is a string indicating the keyword of callable that expects the Styler.  
*args:optional


Arguments passed to func.  
**kwargs:optional


A dictionary of keyword arguments passed into func.    Returns 
 object :

The value returned by func.      See also  DataFrame.pipe

Analogous method for DataFrame.  Styler.apply

Apply a CSS-styling function column-wise, row-wise, or table-wise.    Notes Like DataFrame.pipe(), this method can simplify the application of several user-defined functions to a styler. Instead of writing: 
f(g(df.style.set_precision(3), arg1=a), arg2=b, arg3=c)
  users can write: 
(df.style.set_precision(3)
   .pipe(g, arg1=a)
   .pipe(f, arg2=b, arg3=c))
  In particular, this allows users to define functions that take a styler object, along with other parameters, and return the styler after making styling changes (such as calling Styler.apply() or Styler.set_properties()). Using .pipe, these user-defined style “transformations” can be interleaved with calls to the built-in Styler interface. Examples 
>>> def format_conversion(styler):
...     return (styler.set_properties(**{'text-align': 'right'})
...                   .format({'conversion': '{:.1%}'}))
  The user-defined format_conversion function above can be called within a sequence of other style modifications: 
>>> df = pd.DataFrame({'trial': list(range(5)),
...                    'conversion': [0.75, 0.85, np.nan, 0.7, 0.72]})
>>> (df.style
...    .highlight_min(subset=['conversion'], color='yellow')
...    .pipe(format_conversion)
...    .set_caption("Results with minimum conversion highlighted."))
...
pandas.io.formats.style.Styler.render   Styler.render(sparse_index=None, sparse_columns=None, **kwargs)[source]
 
Render the Styler including all applied styles to HTML.  Deprecated since version 1.4.0.   Parameters 
 
sparse_index:bool, optional


Whether to sparsify the display of a hierarchical index. Setting to False will display each explicit level element in a hierarchical key for each row. Defaults to pandas.options.styler.sparse.index value.  
sparse_columns:bool, optional


Whether to sparsify the display of a hierarchical index. Setting to False will display each explicit level element in a hierarchical key for each row. Defaults to pandas.options.styler.sparse.columns value.  **kwargs

Any additional keyword arguments are passed through to self.template.render. This is useful when you need to provide additional variables for a custom template.    Returns 
 
rendered:str


The rendered HTML.     Notes This method is deprecated in favour of Styler.to_html. Styler objects have defined the _repr_html_ method which automatically calls self.to_html() when it’s the last item in a Notebook cell. When calling Styler.render() directly, wrap the result in IPython.display.HTML to view the rendered HTML in the notebook. Pandas uses the following keys in render. Arguments passed in **kwargs take precedence, so think carefully if you want to override them:  head cellstyle body uuid table_styles caption table_attributes
pandas.io.formats.style.Styler.set_caption   Styler.set_caption(caption)[source]
 
Set the text added to a <caption> HTML element.  Parameters 
 
caption:str, tuple


For HTML output either the string input is used or the first element of the tuple. For LaTeX the string input provides a caption and the additional tuple input allows for full captions and short captions, in that order.    Returns 
 
self:Styler
pandas.io.formats.style.Styler.set_na_rep   Styler.set_na_rep(na_rep)[source]
 
Set the missing data representation on a Styler.  New in version 1.0.0.   Deprecated since version 1.3.0.   Parameters 
 
na_rep:str

  Returns 
 
self:Styler

   Notes This method is deprecated. See Styler.format()
pandas.io.formats.style.Styler.set_precision   Styler.set_precision(precision)[source]
 
Set the precision used to display values.  Deprecated since version 1.3.0.   Parameters 
 
precision:int

  Returns 
 
self:Styler

   Notes This method is deprecated see Styler.format.
pandas.io.formats.style.Styler.set_properties   Styler.set_properties(subset=None, **kwargs)[source]
 
Set defined CSS-properties to each <td> HTML element within the given subset.  Parameters 
 
subset:label, array-like, IndexSlice, optional


A valid 2d input to DataFrame.loc[<subset>], or, in the case of a 1d input or single key, to DataFrame.loc[:, <subset>] where the columns are prioritised, to limit data to before applying the function.  
**kwargs:dict


A dictionary of property, value pairs to be set for each cell.    Returns 
 
self:Styler

   Notes This is a convenience methods which wraps the Styler.applymap() calling a function returning the CSS-properties independently of the data. Examples 
>>> df = pd.DataFrame(np.random.randn(10, 4))
>>> df.style.set_properties(color="white", align="right")  
>>> df.style.set_properties(**{'background-color': 'yellow'})  
  See Table Visualization user guide for more details.
pandas.io.formats.style.Styler.set_sticky   Styler.set_sticky(axis=0, pixel_size=None, levels=None)[source]
 
Add CSS to permanently display the index or column headers in a scrolling frame.  Parameters 
 
axis:{0 or ‘index’, 1 or ‘columns’}, default 0


Whether to make the index or column headers sticky.  
pixel_size:int, optional


Required to configure the width of index cells or the height of column header cells when sticking a MultiIndex (or with a named Index). Defaults to 75 and 25 respectively.  
levels:int, str, list, optional


If axis is a MultiIndex the specific levels to stick. If None will stick all levels.    Returns 
 
self:Styler

   Notes This method uses the CSS ‘position: sticky;’ property to display. It is designed to work with visible axes, therefore both:  
 styler.set_sticky(axis=”index”).hide(axis=”index”) styler.set_sticky(axis=”columns”).hide(axis=”columns”)  
 may produce strange behaviour due to CSS controls with missing elements.
pandas.io.formats.style.Styler.set_table_attributes   Styler.set_table_attributes(attributes)[source]
 
Set the table attributes added to the <table> HTML element. These are items in addition to automatic (by default) id attribute.  Parameters 
 
attributes:str

  Returns 
 
self:Styler

    See also  Styler.set_table_styles

Set the table styles included within the <style> HTML element.  Styler.set_td_classes

Set the DataFrame of strings added to the class attribute of <td> HTML elements.    Examples 
>>> df = pd.DataFrame(np.random.randn(10, 4))
>>> df.style.set_table_attributes('class="pure-table"')  
# ... <table class="pure-table"> ...
pandas.io.formats.style.Styler.set_table_styles   Styler.set_table_styles(table_styles=None, axis=0, overwrite=True, css_class_names=None)[source]
 
Set the table styles included within the <style> HTML element. This function can be used to style the entire table, columns, rows or specific HTML selectors.  Parameters 
 
table_styles:list or dict


If supplying a list, each individual table_style should be a dictionary with selector and props keys. selector should be a CSS selector that the style will be applied to (automatically prefixed by the table’s UUID) and props should be a list of tuples with (attribute, value). If supplying a dict, the dict keys should correspond to column names or index values, depending upon the specified axis argument. These will be mapped to row or col CSS selectors. MultiIndex values as dict keys should be in their respective tuple form. The dict values should be a list as specified in the form with CSS selectors and props that will be applied to the specified row or column.  Changed in version 1.2.0.   
axis:{0 or ‘index’, 1 or ‘columns’, None}, default 0


Apply to each column (axis=0 or 'index'), to each row (axis=1 or 'columns'). Only used if table_styles is dict.  New in version 1.2.0.   
overwrite:bool, default True


Styles are replaced if True, or extended if False. CSS rules are preserved so most recent styles set will dominate if selectors intersect.  New in version 1.2.0.   
css_class_names:dict, optional


A dict of strings used to replace the default CSS classes described below.  New in version 1.4.0.     Returns 
 
self:Styler

    See also  Styler.set_td_classes

Set the DataFrame of strings added to the class attribute of <td> HTML elements.  Styler.set_table_attributes

Set the table attributes added to the <table> HTML element.    Notes The default CSS classes dict, whose values can be replaced is as follows: 
css_class_names = {"row_heading": "row_heading",
                   "col_heading": "col_heading",
                   "index_name": "index_name",
                   "col": "col",
                   "col_trim": "col_trim",
                   "row_trim": "row_trim",
                   "level": "level",
                   "data": "data",
                   "blank": "blank}
  Examples 
>>> df = pd.DataFrame(np.random.randn(10, 4),
...                   columns=['A', 'B', 'C', 'D'])
>>> df.style.set_table_styles(
...     [{'selector': 'tr:hover',
...       'props': [('background-color', 'yellow')]}]
... )  
  Or with CSS strings 
>>> df.style.set_table_styles(
...     [{'selector': 'tr:hover',
...       'props': 'background-color: yellow; font-size: 1em;'}]
... )  
  Adding column styling by name 
>>> df.style.set_table_styles({
...     'A': [{'selector': '',
...            'props': [('color', 'red')]}],
...     'B': [{'selector': 'td',
...            'props': 'color: blue;'}]
... }, overwrite=False)  
  Adding row styling 
>>> df.style.set_table_styles({
...     0: [{'selector': 'td:hover',
...          'props': [('font-size', '25px')]}]
... }, axis=1, overwrite=False)  
  See Table Visualization user guide for more details.
pandas.io.formats.style.Styler.set_td_classes   Styler.set_td_classes(classes)[source]
 
Set the DataFrame of strings added to the class attribute of <td> HTML elements.  Parameters 
 
classes:DataFrame


DataFrame containing strings that will be translated to CSS classes, mapped by identical column and index key values that must exist on the underlying Styler data. None, NaN values, and empty strings will be ignored and not affect the rendered HTML.    Returns 
 
self:Styler

    See also  Styler.set_table_styles

Set the table styles included within the <style> HTML element.  Styler.set_table_attributes

Set the table attributes added to the <table> HTML element.    Notes Can be used in combination with Styler.set_table_styles to define an internal CSS solution without reference to external CSS files. Examples 
>>> df = pd.DataFrame(data=[[1, 2, 3], [4, 5, 6]], columns=["A", "B", "C"])
>>> classes = pd.DataFrame([
...     ["min-val red", "", "blue"],
...     ["red", None, "blue max-val"]
... ], index=df.index, columns=df.columns)
>>> df.style.set_td_classes(classes)  
  Using MultiIndex columns and a classes DataFrame as a subset of the underlying, 
>>> df = pd.DataFrame([[1,2],[3,4]], index=["a", "b"],
...     columns=[["level0", "level0"], ["level1a", "level1b"]])
>>> classes = pd.DataFrame(["min-val"], index=["a"],
...     columns=[["level0"],["level1a"]])
>>> df.style.set_td_classes(classes)  
  Form of the output with new additional css classes, 
>>> df = pd.DataFrame([[1]])
>>> css = pd.DataFrame([["other-class"]])
>>> s = Styler(df, uuid="_", cell_ids=False).set_td_classes(css)
>>> s.hide(axis=0).to_html()  
'<style type="text/css"></style>'
'<table id="T__">'
'  <thead>'
'    <tr><th class="col_heading level0 col0" >0</th></tr>'
'  </thead>'
'  <tbody>'
'    <tr><td class="data row0 col0 other-class" >1</td></tr>'
'  </tbody>'
'</table>'
pandas.io.formats.style.Styler.set_tooltips   Styler.set_tooltips(ttips, props=None, css_class=None)[source]
 
Set the DataFrame of strings on Styler generating :hover tooltips. These string based tooltips are only applicable to <td> HTML elements, and cannot be used for column or index headers.  New in version 1.3.0.   Parameters 
 
ttips:DataFrame


DataFrame containing strings that will be translated to tooltips, mapped by identical column and index values that must exist on the underlying Styler data. None, NaN values, and empty strings will be ignored and not affect the rendered HTML.  
props:list-like or str, optional


List of (attr, value) tuples or a valid CSS string. If None adopts the internal default values described in notes.  
css_class:str, optional


Name of the tooltip class used in CSS, should conform to HTML standards. Only useful if integrating tooltips with external CSS. If None uses the internal default value ‘pd-t’.    Returns 
 
self:Styler

   Notes Tooltips are created by adding <span class=”pd-t”></span> to each data cell and then manipulating the table level CSS to attach pseudo hover and pseudo after selectors to produce the required the results. The default properties for the tooltip CSS class are:  visibility: hidden position: absolute z-index: 1 background-color: black color: white transform: translate(-20px, -20px)  The property ‘visibility: hidden;’ is a key prerequisite to the hover functionality, and should always be included in any manual properties specification, using the props argument. Tooltips are not designed to be efficient, and can add large amounts of additional HTML for larger tables, since they also require that cell_ids is forced to True. Examples Basic application 
>>> df = pd.DataFrame(data=[[0, 1], [2, 3]])
>>> ttips = pd.DataFrame(
...    data=[["Min", ""], [np.nan, "Max"]], columns=df.columns, index=df.index
... )
>>> s = df.style.set_tooltips(ttips).to_html()
  Optionally controlling the tooltip visual display 
>>> df.style.set_tooltips(ttips, css_class='tt-add', props=[
...     ('visibility', 'hidden'),
...     ('position', 'absolute'),
...     ('z-index', 1)])  
>>> df.style.set_tooltips(ttips, css_class='tt-add',
...     props='visibility:hidden; position:absolute; z-index:1;')
...
pandas.io.formats.style.Styler.set_uuid   Styler.set_uuid(uuid)[source]
 
Set the uuid applied to id attributes of HTML elements.  Parameters 
 
uuid:str

  Returns 
 
self:Styler

   Notes Almost all HTML elements within the table, and including the <table> element are assigned id attributes. The format is T_uuid_<extra> where <extra> is typically a more specific identifier, such as row1_col2.
pandas.io.formats.style.Styler.template_html   Styler.template_html=<Template 'html.tpl'>
pandas.io.formats.style.Styler.template_html_style   Styler.template_html_style=<Template 'html_style.tpl'>
pandas.io.formats.style.Styler.template_html_table   Styler.template_html_table=<Template 'html_table.tpl'>
pandas.io.formats.style.Styler.template_latex   Styler.template_latex=<Template 'latex.tpl'>
pandas.io.formats.style.Styler.to_html   Styler.to_html(buf=None, *, table_uuid=None, table_attributes=None, sparse_index=None, sparse_columns=None, bold_headers=False, caption=None, max_rows=None, max_columns=None, encoding=None, doctype_html=False, exclude_styles=False, **kwargs)[source]
 
Write Styler to a file, buffer or string in HTML-CSS format.  New in version 1.3.0.   Parameters 
 
buf:str, path object, file-like object, or None, default None


String, path object (implementing os.PathLike[str]), or file-like object implementing a string write() function. If None, the result is returned as a string.  
table_uuid:str, optional


Id attribute assigned to the <table> HTML element in the format: <table id="T_<table_uuid>" ..> If not given uses Styler’s initially assigned value.  
table_attributes:str, optional


Attributes to assign within the <table> HTML element in the format: <table .. <table_attributes> > If not given defaults to Styler’s preexisting value.  
sparse_index:bool, optional


Whether to sparsify the display of a hierarchical index. Setting to False will display each explicit level element in a hierarchical key for each row. Defaults to pandas.options.styler.sparse.index value.  New in version 1.4.0.   
sparse_columns:bool, optional


Whether to sparsify the display of a hierarchical index. Setting to False will display each explicit level element in a hierarchical key for each column. Defaults to pandas.options.styler.sparse.columns value.  New in version 1.4.0.   
bold_headers:bool, optional


Adds “font-weight: bold;” as a CSS property to table style header cells.  New in version 1.4.0.   
caption:str, optional


Set, or overwrite, the caption on Styler before rendering.  New in version 1.4.0.   
max_rows:int, optional


The maximum number of rows that will be rendered. Defaults to pandas.options.styler.render.max_rows/max_columns.  New in version 1.4.0.   
max_columns:int, optional


The maximum number of columns that will be rendered. Defaults to pandas.options.styler.render.max_columns, which is None. Rows and columns may be reduced if the number of total elements is large. This value is set to pandas.options.styler.render.max_elements, which is 262144 (18 bit browser rendering).  New in version 1.4.0.   
encoding:str, optional


Character encoding setting for file output, and HTML meta tags. Defaults to pandas.options.styler.render.encoding value of “utf-8”.  
doctype_html:bool, default False


Whether to output a fully structured HTML file including all HTML elements, or just the core <style> and <table> elements.  
exclude_styles:bool, default False


Whether to include the <style> element and all associated element class and id identifiers, or solely the <table> element without styling identifiers.  **kwargs

Any additional keyword arguments are passed through to the jinja2 self.template.render process. This is useful when you need to provide additional variables for a custom template.    Returns 
 str or None

If buf is None, returns the result as a string. Otherwise returns None.      See also  DataFrame.to_html

Write a DataFrame to a file, buffer or string in HTML format.
pandas.io.formats.style.Styler.use   Styler.use(styles)[source]
 
Set the styles on the current Styler. Possibly uses styles from Styler.export.  Parameters 
 
styles:dict(str, Any)


 List of attributes to add to Styler. Dict keys should contain only:

 “apply”: list of styler functions, typically added with apply or applymap. “table_attributes”: HTML attributes, typically added with set_table_attributes. “table_styles”: CSS selectors and properties, typically added with set_table_styles. “hide_index”: whether the index is hidden, typically added with hide_index, or a boolean list for hidden levels. “hide_columns”: whether column headers are hidden, typically added with hide_columns, or a boolean list for hidden levels. “hide_index_names”: whether index names are hidden. “hide_column_names”: whether column header names are hidden. “css”: the css class names used.       Returns 
 
self:Styler

    See also  Styler.export

Export the non data dependent attributes to the current Styler.    Examples 
>>> styler = DataFrame([[1, 2], [3, 4]]).style
>>> styler2 = DataFrame([[9, 9, 9]]).style
>>> styler.hide(axis=0).highlight_max(axis=1)  
>>> export = styler.export()
>>> styler2.use(export)
pandas.io.formats.style.Styler.where   Styler.where(cond, value, other=None, subset=None, **kwargs)[source]
 
Apply CSS-styles based on a conditional function elementwise.  Deprecated since version 1.3.0.  Updates the HTML representation with a style which is selected in accordance with the return value of a function.  Parameters 
 
cond:callable


cond should take a scalar, and optional keyword arguments, and return a boolean.  
value:str


Applied when cond returns true.  
other:str


Applied when cond returns false.  
subset:label, array-like, IndexSlice, optional


A valid 2d input to DataFrame.loc[<subset>], or, in the case of a 1d input or single key, to DataFrame.loc[:, <subset>] where the columns are prioritised, to limit data to before applying the function.  
**kwargs:dict


Pass along to cond.    Returns 
 
self:Styler

    See also  Styler.applymap

Apply a CSS-styling function elementwise.  Styler.apply

Apply a CSS-styling function column-wise, row-wise, or table-wise.    Notes This method is deprecated. This method is a convenience wrapper for Styler.applymap(), which we recommend using instead. The example: 
>>> df = pd.DataFrame([[1, 2], [3, 4]])
>>> def cond(v, limit=4):
...     return v > 1 and v != limit
>>> df.style.where(cond, value='color:green;', other='color:red;')
...  
  should be refactored to: 
>>> def style_func(v, value, other, limit=4):
...     cond = v > 1 and v != limit
...     return value if cond else other
>>> df.style.applymap(style_func, value='color:green;', other='color:red;')
...