holoviews.element.stats module#

class holoviews.element.stats.Bivariate(data=None, kdims=None, vdims=None, **kwargs)[source]#

Bases: Selection2DExpr, StatisticsElement

Bivariate elements are containers for two dimensional data, which is to be visualized as a kernel density estimate. The data should be supplied in a tabular format of x- and y-columns.

Parameter Definitions


Parameters inherited from:

group = String(constant=True, default='Bivariate', label='Group')

A string describing the data wrapped by the object.

kdims = List(bounds=(2, 2), default=[Dimension('x'), Dimension('y')], label='Kdims')

The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.

vdims = List(bounds=(0, 1), default=[Dimension('Density')], label='Vdims')

The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.

class holoviews.element.stats.BoxWhisker(data=None, kdims=None, vdims=None, **kwargs)[source]#

Bases: Selection1DExpr, Dataset, Element2D

BoxWhisker represent data as a distributions highlighting the median, mean and various percentiles. It may have a single value dimension and any number of key dimensions declaring the grouping of each violin.

Parameter Definitions


Parameters inherited from:

group = String(constant=True, default='BoxWhisker', label='Group')

A string describing the data wrapped by the object.

kdims = List(bounds=(0, None), default=[], label='Kdims')

The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.

vdims = List(bounds=(1, 1), default=[Dimension('y')], label='Vdims')

The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.

class holoviews.element.stats.Distribution(data=None, kdims=None, vdims=None, **kwargs)[source]#

Bases: Selection1DExpr, StatisticsElement

Distribution elements provides a representation for a one-dimensional distribution which can be visualized as a kernel density estimate. The data should be supplied in a tabular format and will use the first column.

Parameter Definitions


Parameters inherited from:

group = String(constant=True, default='Distribution', label='Group')

A string describing the data wrapped by the object.

kdims = List(bounds=(1, 1), default=[Dimension('Value')], label='Kdims')

The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.

vdims = List(bounds=(0, 1), default=[Dimension('Density')], label='Vdims')

The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.

class holoviews.element.stats.HexTiles(data=None, kdims=None, vdims=None, **kwargs)[source]#

Bases: Selection2DExpr, Dataset, Element2D

HexTiles is a statistical element with a visual representation that renders a density map of the data values as a hexagonal grid.

Before display the data is aggregated either by counting the values in each hexagonal bin or by computing aggregates.

Parameter Definitions


Parameters inherited from:

group = String(constant=True, default='HexTiles', label='Group')

A string describing the data wrapped by the object.

kdims = List(bounds=(2, 2), default=[Dimension('x'), Dimension('y')], label='Kdims')

The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.

class holoviews.element.stats.StatisticsElement(data=None, kdims=None, vdims=None, **kwargs)[source]#

Bases: Dataset, Element2D

StatisticsElement provides a baseclass for Element types that compute statistics based on the input data, usually a density. The value dimension of such elements are therefore usually virtual and not computed until the element is plotted.

Parameter Definitions


Parameters inherited from:

columns(dimensions=None)[source]#

Convert dimension values to a dictionary.

Returns a dictionary of column arrays along each dimension of the element.

Parameters#

dimensions

Dimensions to return as columns

Returns#

Dictionary of arrays for each dimension

property dataset#

The Dataset that this object was created from

dframe(dimensions=None, multi_index=False)[source]#

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Parameters#

dimensions

Dimensions to return as columns

multi_index

Convert key dimensions to (multi-)index

Returns#

DataFrame of columns corresponding to each dimension

dimension_values(dim, expanded=True, flat=True)[source]#

Return the values along the requested dimension.

Parameters#

dimension

The dimension to return values for

expandedbool, optional

Whether to expand values Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values

  • Geometry: If false returns scalar values per geometry

  • Gridded: If false returns 1D coordinates

flatbool, optional

Whether to flatten array

Returns#

NumPy array of values along the requested dimension

get_dimension_type(dim)[source]#

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Parameters#

dimension

Dimension to look up by name or by index

Returns#

Declared type of values along the dimension

range(dim, data_range=True, dimension_range=True)[source]#

Return the lower and upper bounds of values along dimension.

Parameters#

dimension

The dimension to compute the range on.

data_rangebool

Compute range from data values

dimension_rangebool

Include Dimension ranges Whether to include Dimension range and soft_range in range calculation

Returns#

Tuple containing the lower and upper bound

class holoviews.element.stats.Violin(data=None, kdims=None, vdims=None, **kwargs)[source]#

Bases: BoxWhisker

Violin elements represent data as 1D distributions visualized as a kernel-density estimate. It may have a single value dimension and any number of key dimensions declaring the grouping of each violin.

Parameter Definitions


Parameters inherited from:

group = String(constant=True, default='Violin', label='Group')

A string describing the data wrapped by the object.