holoviews.element Package


element Package

Inheritance diagram of holoviews.element
class holoviews.element. Table ( data , kdims=None , vdims=None , **kwargs ) [source]

Bases: holoviews.core.data.Dataset , holoviews.core.element.Tabular

Table is a Dataset type, which gets displayed in a tabular format and is convertible to most other Element types.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Table, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The group is used to describe the Table.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
cell_type ( row , col )

Type of the table cell, either ‘data’ or ‘heading’

Args:
row (int): Integer index of table row col (int): Integer index of table column
Returns:
Type of the table cell, either ‘data’ or ‘heading’
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

cols

Number of columns in table

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.Table'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.Table'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.Table'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.Table'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

pprint_cell ( row , col )

Formatted contents of table cell.

Args:
row (int): Integer index of table row col (int): Integer index of table column
Returns:
Formatted table cell contents
print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
rows

Number of rows in table (including header)

sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.Table'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.Table'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

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

Bases: holoviews.element.chart.Chart

Curve is a Chart element representing a line in a 1D coordinate system where the key dimension maps on the line x-coordinate and the first value dimension represents the height of the line along the y-axis.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Curve, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimension(s) of a Chart represent the independent variable(s).
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions of the Chart, usually corresponding to a number of dependent variables.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Curve'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Curve'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Curve'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Curve'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Curve'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Curve'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

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

Bases: holoviews.element.chart.Chart

Bars is a Chart element representing categorical observations using the height of rectangular bars. The key dimensions represent the categorical groupings of the data, but may also be used to stack the bars, while the first value dimension represents the height of each bar.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Bars, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 3), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimension(s) of a Chart represent the independent variable(s).
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions of the Chart, usually corresponding to a number of dependent variables.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Bars'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Bars'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Bars'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Bars'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Bars'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Bars'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. Histogram ( data , edges=None , **params ) [source]

Bases: holoviews.element.chart.Chart

Histogram is a Chart element representing a number of bins in a 1D coordinate system. The key dimension represents the binned values, which may be declared as bin edges or bin centers, while the value dimensions usually defines a count, frequency or density associated with each bin.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Histogram, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Dimensions on Element2Ds determine the number of indexable dimensions.
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘Frequency’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions of the Chart, usually corresponding to a number of dependent variables.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘grid’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
edges

Property to access the Histogram edges provided for backward compatibility

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Histogram'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Histogram'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Histogram'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Histogram'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Histogram'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Histogram'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
values

Property to access the Histogram values provided for backward compatibility

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. Path3D ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.element.Element3D , holoviews.element.path.Path

Path3D is a 3D element representing a line through 3D space. The key dimensions represent the position of each coordinate along the x-, y- and z-axis while the value dimensions can optionally supply additional information.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Path3D, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=False, default=[Dimension(‘x’), Dimension(‘y’), Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.
param List vdims ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Path3D can have optional value dimensions.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None, None, None), instantiate=False, length=6, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 3D space defined as (xmin, ymin, zmin, xmax, ymax, zmax).
param ObjectSelector datatype ( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’, ‘dataframe’, ‘dictionary’, ‘dask’, ‘array’], instantiate=True, names=None, objects=[], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Path3D'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Path3D'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Path3D'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Path3D'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Bypasses selection on data and sets extents based on selection.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Path3D'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Path3D'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
split ( start=None , end=None , datatype=None , **kwargs )

The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. Trisurface ( *args , **kwargs ) [source]

Bases: holoviews.element.chart3d.TriSurface

Old name for TriSurface. Retaining for backwards compatibility until holoviews 2.0.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Trisurface, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=False, default=[Dimension(‘x’), Dimension(‘y’), Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a TriSurface represent the 3D coordinates of each point.
param List vdims ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions of a TriSurface can provide additional information about each 3D coordinate.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None, None, None), instantiate=False, length=6, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 3D space defined as (xmin, ymin, zmin, xmax, ymax, zmax).
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Trisurface'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Trisurface'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Trisurface'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Trisurface'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Trisurface'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Trisurface'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

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

Bases: holoviews.core.data.Dataset , holoviews.core.element.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.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=HexTiles, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.HexTiles'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.HexTiles'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.HexTiles'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.HexTiles'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.HexTiles'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.HexTiles'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

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

Bases: holoviews.core.element.Element3D , holoviews.element.geom.Points

TriSurface represents a set of coordinates in 3D space which define a surface via a triangulation algorithm (usually Delauney triangulation). They key dimensions of a TriSurface define the position of each point along the x-, y- and z-axes, while value dimensions can provide additional information about each point.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=TriSurface, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=False, default=[Dimension(‘x’), Dimension(‘y’), Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a TriSurface represent the 3D coordinates of each point.
param List vdims ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions of a TriSurface can provide additional information about each 3D coordinate.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None, None, None), instantiate=False, length=6, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 3D space defined as (xmin, ymin, zmin, xmax, ymax, zmax).
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.TriSurface'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.TriSurface'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.TriSurface'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.TriSurface'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.TriSurface'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.TriSurface'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. HLine ( y , **params ) [source]

Bases: holoviews.element.annotation.Annotation

Horizontal line annotation at the given position.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=HLine, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ClassSelector y ( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The y-position of the VLine which make be numeric or a timestamp.
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
closest ( coords , **kwargs )

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:
dimension: The dimension to return values for expanded (bool, optional): Whether to expand values flat (bool, optional): Whether to flatten array
Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.HLine'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.HLine'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.HLine'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.HLine'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reduction )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The element after reductions have been applied.
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=False , **sample_values )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.HLine'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.HLine'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. Raster ( data , kdims=None , vdims=None , extents=None , **params ) [source]

Bases: holoviews.core.element.Element2D

Raster is a basic 2D element type for presenting either numpy or dask arrays as two dimensional raster images.

Arrays with a shape of (N,M) are valid inputs for Raster whereas subclasses of Raster (e.g. RGB) may also accept 3D arrays containing channel information.

Raster does not support slicing like the Image or RGB subclasses and the extents are in matrix coordinates if not explicitly specified.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Raster, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The label of the x- and y-dimension of the Raster in form of a string or dimension object.
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The dimension description of the data held in the matrix.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
closest ( coords , **kwargs )

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
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]

The set of samples available along a particular dimension.

dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Raster'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Raster'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Raster'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Raster'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

reduce ( dimensions=None , function=None , **reduce_map ) [source]

Reduces the Raster using functions provided via the kwargs, where the keyword is the dimension to be reduced. Optionally a label_prefix can be provided to prepend to the result Element label.

relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , **sample_values ) [source]

Sample the Raster along one or both of its dimensions, returning a reduced dimensionality type, which is either a ItemTable, Curve or Scatter. If two dimension samples and a new_xaxis is provided the sample will be the value of the sampled unit indexed by the value in the new_xaxis tuple.

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Raster'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Raster'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. Bounds ( lbrt , **params ) [source]

Bases: holoviews.element.path.BaseShape

An arbitrary axis-aligned bounding rectangle defined by the (left, bottom, right, top) coordinate positions.

If supplied a single real number as input, this value will be treated as the radius of a square, zero-center box which will be used to compute the corresponding lbrt tuple.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Bounds, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The assigned group name.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Value dimensions can be associated with a geometry.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ObjectSelector datatype ( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’, ‘dataframe’, ‘dictionary’, ‘dask’, ‘array’], instantiate=True, names=None, objects=[], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
param NumericTuple lbrt ( allow_None=False, constant=False, default=(-0.5, -0.5, 0.5, 0.5), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The (left, bottom, right, top) coordinates of the bounding box.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( *args , **overrides )

Returns a clone of the object with matching parameter values containing the specified args and kwargs.

closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Bounds'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Bounds'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Bounds'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Bounds'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Bypasses selection on data and sets extents based on selection.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Bounds'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Bounds'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
split ( start=None , end=None , datatype=None , **kwargs )

The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

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

Bases: holoviews.core.data.Dataset , holoviews.core.element.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.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=BoxWhisker, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.BoxWhisker'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.BoxWhisker'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.BoxWhisker'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.BoxWhisker'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.BoxWhisker'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.BoxWhisker'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

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

Bases: holoviews.element.chart.Curve

Area is a Chart element representing the area under a curve or between two curves in a 1D coordinate system. The key dimension represents the location of each coordinate along the x-axis, while the value dimension(s) represent the height of the area or the lower and upper bounds of the area between curves.

Multiple areas may be stacked by overlaying them an passing them to the stack method.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Area, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimension(s) of a Chart represent the independent variable(s).
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions of the Chart, usually corresponding to a number of dependent variables.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Area'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Area'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Area'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Area'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Area'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Area'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
classmethod stack ( areas ) [source]

Stacks an (Nd)Overlay of Area or Curve Elements by offsetting their baselines. To stack a HoloMap or DynamicMap use the map method.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

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

Bases: holoviews.core.element.Element3D , holoviews.element.geom.Points

Scatter3D is a 3D element representing the position of a collection of coordinates in a 3D space. The key dimensions represent the position of each coordinate along the x-, y- and z-axis while the value dimensions can optionally supply additional information.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Scatter3D, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=False, default=[Dimension(‘x’), Dimension(‘y’), Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.
param List vdims ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Scatter3D can have optional value dimensions, which may be mapped onto color and size.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None, None, None), instantiate=False, length=6, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 3D space defined as (xmin, ymin, zmin, xmax, ymax, zmax).
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Scatter3D'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Scatter3D'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Scatter3D'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Scatter3D'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Scatter3D'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Scatter3D'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. Surface ( data , kdims=None , vdims=None , extents=None , **params ) [source]

Bases: holoviews.element.raster.Image , holoviews.core.element.Element3D

A Surface represents a regularly sampled 2D grid with associated values defining the height along the z-axis. The key dimensions of a Surface represent the 2D coordinates along the x- and y-axes while the value dimension declares the height at each grid location.

The data of a Surface is usually defined as a 2D array of values and either a bounds tuple defining the extent in the 2D space or explicit x- and y-coordinate arrays.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Surface, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The Surface x and y dimensions of the space defined by the supplied extent.
param List vdims ( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The Surface height dimension.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None, None, None), instantiate=False, length=6, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 3D space defined as (xmin, ymin, zmin, xmax, ymax, zmax).
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘grid’, ‘xarray’, ‘image’, ‘cube’, ‘dataframe’, ‘dictionary’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
param ClassSelector bounds ( allow_None=False, constant=False, default=BoundingBox(radius=0.5), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The bounding region in sheet coordinates containing the data.
param Number rtol ( allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The tolerance used to enforce regular sampling for regular, gridded data where regular sampling is expected. Expressed as the maximal allowable sampling difference between sample locations.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Returns a clone of the object with matching parameter values containing the specified args and kwargs.

If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.

closest ( coords=[] , **kwargs )

Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates.

closest_cell_center ( x , y )

Given arbitrary sheet coordinates, return the sheet coordinates of the center of the closest unit.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Surface'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Surface'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Surface'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Surface'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
matrix2sheet ( float_row , float_col )

Convert a floating-point location (float_row,float_col) in matrix coordinates to its corresponding location (x,y) in sheet coordinates.

Valid for scalar or array float_row and float_col.

Inverse of sheet2matrix().

matrixidx2sheet ( row , col )

Return (x,y) where x and y are the floating point coordinates of the center of the given matrix cell (row,col). If the matrix cell represents a 0.2 by 0.2 region, then the center location returned would be 0.1,0.1.

NOTE: This is NOT the strict mathematical inverse of sheet2matrixidx(), because sheet2matrixidx() discards all but the integer portion of the continuous matrix coordinate.

Valid only for scalar or array row and col.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , **kwargs )

Allows sampling of an Image as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. On an Image the coordinates are continuously indexed and will always snap to the nearest coordinate.

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Surface'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Surface'>)
shape

Returns the shape of the data.

sheet2matrix ( x , y )

Convert a point (x,y) in Sheet coordinates to continuous matrix coordinates.

Returns (float_row,float_col), where float_row corresponds to y, and float_col to x.

Valid for scalar or array x and y.

Note about Bounds For a Sheet with BoundingBox(points=((-0.5,-0.5),(0.5,0.5))) and density=3, x=-0.5 corresponds to float_col=0.0 and x=0.5 corresponds to float_col=3.0. float_col=3.0 is not inside the matrix representing this Sheet, which has the three columns (0,1,2). That is, x=-0.5 is inside the BoundingBox but x=0.5 is outside. Similarly, y=0.5 is inside (at row 0) but y=-0.5 is outside (at row 3) (it’s the other way round for y because the matrix row index increases as y decreases).

sheet2matrixidx ( x , y )

Convert a point (x,y) in sheet coordinates to the integer row and column index of the matrix cell in which that point falls, given a bounds and density. Returns (row,column).

Note that if coordinates along the right or bottom boundary are passed into this function, the returned matrix coordinate of the boundary will be just outside the matrix, because the right and bottom boundaries are exclusive.

Valid for scalar or array x and y.

sheetcoordinates_of_matrixidx ( )

Return x,y where x is a vector of sheet coordinates representing the x-center of each matrix cell, and y represents the corresponding y-center of the cell.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

xdensity

The spacing between elements in an underlying matrix representation, in the x direction.

ydensity

The spacing between elements in an underlying matrix representation, in the y direction.

class holoviews.element. Ellipse ( x , y , spec , **params ) [source]

Bases: holoviews.element.path.BaseShape

Draw an axis-aligned ellipse at the specified x,y position with the given orientation.

The simplest (default) Ellipse is a circle, specified using:

Ellipse(x,y, diameter)

A circle is a degenerate ellipse where the width and height are equal. To specify these explicitly, you can use:

Ellipse(x,y, (width, height))

There is also an aspect parameter allowing you to generate an ellipse by specifying a multiplicating factor that will be applied to the height only.

Note that as a subclass of Path, internally an Ellipse is a sequence of (x,y) sample positions. Ellipse could also be implemented as an annotation that uses a dedicated ellipse artist.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Ellipse, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The assigned group name.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Value dimensions can be associated with a geometry.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ObjectSelector datatype ( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’, ‘dataframe’, ‘dictionary’, ‘dask’, ‘array’], instantiate=True, names=None, objects=[], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
param Number x ( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The x-position of the ellipse center.
param Number y ( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The y-position of the ellipse center.
param Number width ( allow_None=False, bounds=None, constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The width of the ellipse.
param Number height ( allow_None=False, bounds=None, constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The height of the ellipse.
param Number orientation ( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Orientation in the Cartesian coordinate system, the counterclockwise angle in radians between the first axis and the horizontal.
param Number aspect ( allow_None=False, bounds=None, constant=False, default=1.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Optional multiplier applied to the diameter to compute the width in cases where only the diameter value is set.
param Number samples ( allow_None=False, bounds=None, constant=False, default=100, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The sample count used to draw the ellipse.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( *args , **overrides )

Returns a clone of the object with matching parameter values containing the specified args and kwargs.

closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Ellipse'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Ellipse'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Ellipse'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Ellipse'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Bypasses selection on data and sets extents based on selection.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Ellipse'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Ellipse'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
split ( start=None , end=None , datatype=None , **kwargs )

The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. Image ( data , kdims=None , vdims=None , bounds=None , extents=None , xdensity=None , ydensity=None , rtol=None , **params ) [source]

Bases: holoviews.core.data.Dataset , holoviews.element.raster.Raster , holoviews.core.sheetcoords.SheetCoordinateSystem

Image represents a regularly sampled 2D grid of an underlying continuous space of intensity values, which will be colormapped on plotting. The grid of intensity values may be specified as a NxM sized array of values along with a bounds, but it may also be defined through explicit and regularly spaced x/y-coordinate arrays of shape M and N respectively. The two most basic supported constructors of an Image therefore include:

Image((X, Y, Z))

where X is a 1D array of shape M, Y is a 1D array of shape N and Z is a 2D array of shape NxM, or equivalently:

Image(Z, bounds=(x0, y0, x1, y1))

where Z is a 2D array of shape NxM defining the intensity values and the bounds define the (left, bottom, top, right) edges of four corners of the grid. Other gridded formats which support declaring of explicit x/y-coordinate arrays such as xarray are also supported.

Note that the interpretation of the orientation of the array changes depending on whether bounds or explicit coordinates are used.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Image, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The label of the x- and y-dimension of the Raster in the form of a string or dimension object.
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The dimension description of the data held in the matrix.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘grid’, ‘xarray’, ‘image’, ‘cube’, ‘dataframe’, ‘dictionary’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
param ClassSelector bounds ( allow_None=False, constant=False, default=BoundingBox(radius=0.5), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The bounding region in sheet coordinates containing the data.
param Number rtol ( allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The tolerance used to enforce regular sampling for regular, gridded data where regular sampling is expected. Expressed as the maximal allowable sampling difference between sample locations.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides ) [source]

Returns a clone of the object with matching parameter values containing the specified args and kwargs.

If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.

closest ( coords=[] , **kwargs ) [source]

Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates.

closest_cell_center ( x , y )

Given arbitrary sheet coordinates, return the sheet coordinates of the center of the closest unit.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Image'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Image'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Image'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Image'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
matrix2sheet ( float_row , float_col )

Convert a floating-point location (float_row,float_col) in matrix coordinates to its corresponding location (x,y) in sheet coordinates.

Valid for scalar or array float_row and float_col.

Inverse of sheet2matrix().

matrixidx2sheet ( row , col )

Return (x,y) where x and y are the floating point coordinates of the center of the given matrix cell (row,col). If the matrix cell represents a 0.2 by 0.2 region, then the center location returned would be 0.1,0.1.

NOTE: This is NOT the strict mathematical inverse of sheet2matrixidx(), because sheet2matrixidx() discards all but the integer portion of the continuous matrix coordinate.

Valid only for scalar or array row and col.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , **kwargs ) [source]

Allows sampling of an Image as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. On an Image the coordinates are continuously indexed and will always snap to the nearest coordinate.

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection ) [source]

Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Image'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Image'>)
shape

Returns the shape of the data.

sheet2matrix ( x , y )

Convert a point (x,y) in Sheet coordinates to continuous matrix coordinates.

Returns (float_row,float_col), where float_row corresponds to y, and float_col to x.

Valid for scalar or array x and y.

Note about Bounds For a Sheet with BoundingBox(points=((-0.5,-0.5),(0.5,0.5))) and density=3, x=-0.5 corresponds to float_col=0.0 and x=0.5 corresponds to float_col=3.0. float_col=3.0 is not inside the matrix representing this Sheet, which has the three columns (0,1,2). That is, x=-0.5 is inside the BoundingBox but x=0.5 is outside. Similarly, y=0.5 is inside (at row 0) but y=-0.5 is outside (at row 3) (it’s the other way round for y because the matrix row index increases as y decreases).

sheet2matrixidx ( x , y )

Convert a point (x,y) in sheet coordinates to the integer row and column index of the matrix cell in which that point falls, given a bounds and density. Returns (row,column).

Note that if coordinates along the right or bottom boundary are passed into this function, the returned matrix coordinate of the boundary will be just outside the matrix, because the right and bottom boundaries are exclusive.

Valid for scalar or array x and y.

sheetcoordinates_of_matrixidx ( )

Return x,y where x is a vector of sheet coordinates representing the x-center of each matrix cell, and y represents the corresponding y-center of the cell.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None ) [source]

Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

xdensity

The spacing between elements in an underlying matrix representation, in the x direction.

ydensity

The spacing between elements in an underlying matrix representation, in the y direction.

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

Bases: holoviews.element.geom.Points

Nodes is a simple Element representing Graph nodes as a set of Points. Unlike regular Points, Nodes must define a third key dimension corresponding to the node index.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Nodes, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(3, 3), constant=False, default=[Dimension(‘x’), Dimension(‘y’), Dimension(‘index’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Value dimensions can be associated with a geometry.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.Nodes'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.Nodes'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.Nodes'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.Nodes'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.Nodes'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.Nodes'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

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

Bases: holoviews.element.geom.Geometry

A VectorField represents a set of vectors in 2D spac with an associated angle, as well as an optional magnitude and any number of other value dimensions. The angles are assumed to be defined in radians and by default the magnitude is assumed to be normalized to be between 0 and 1.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=VectorField, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘Angle’), Dimension(‘Magnitude’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Value dimensions can be associated with a geometry.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.geom.VectorField'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.geom.VectorField'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.geom.VectorField'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.geom.VectorField'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.geom.VectorField'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.geom.VectorField'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

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

Bases: holoviews.element.chart.ErrorBars

Spread is a Chart element representing a spread of values or confidence band in a 1D coordinate system. The key dimension(s) corresponds to the location along the x-axis and the value dimensions define the location along the y-axis as well as the symmetric or assymetric spread.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Spread, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the quantity measured by the ErrorBars object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimension(s) of a Chart represent the independent variable(s).
param List vdims ( allow_None=False, bounds=(1, None), constant=True, default=[Dimension(‘y’), Dimension(‘yerror’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions of the Chart, usually corresponding to a number of dependent variables.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spread'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spread'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spread'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spread'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Range of the y-dimension includes the symmetric or assymetric error.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spread'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spread'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

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

Bases: holoviews.core.element.Element

Dataset provides a general baseclass for Element types that contain structured data and supports a range of data formats.

The Dataset class supports various methods offering a consistent way of working with the stored data regardless of the storage format used. These operations include indexing, selection and various ways of aggregating or collapsing the data with a supplied function.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Dataset, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs ) [source]

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs ) [source]

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides ) [source]

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs ) [source]

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None ) [source]

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

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.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.Dataset'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of 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.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.Dataset'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.Dataset'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) [source]

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.Dataset'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

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

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions ) [source]

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None ) [source]

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs ) [source]

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection ) [source]

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.Dataset'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.Dataset'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False ) [source]

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. Div ( data , **params ) [source]

Bases: holoviews.core.element.Element

The Div element represents a div DOM node in an HTML document defined as a string containing valid HTML.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Div, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
closest ( coords , **kwargs )

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Div'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Div'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Div'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Div'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reduction )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The element after reductions have been applied.
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=False , **sample_values )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Div'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Div'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. Arrow ( x , y , text='' , direction='<' , points=40 , arrowstyle='->' , **params ) [source]

Bases: holoviews.element.annotation.Annotation

Draw an arrow to the given xy position with optional text at distance ‘points’ away. The direction of the arrow may be specified as well as the arrow head style.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Arrow, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ClassSelector x ( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The x-position of the arrow which make be numeric or a timestamp.
param ClassSelector y ( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The y-position of the arrow which make be numeric or a timestamp.
param String text ( allow_None=False, basestring=<class ‘str’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Text associated with the arrow.
param ObjectSelector direction ( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=<, instantiate=False, names=None, objects=[‘<’, ‘^’, ‘>’, ‘v’], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The cardinal direction in which the arrow is pointing. Accepted arrow directions are ‘<’, ‘^’, ‘>’ and ‘v’.
param ObjectSelector arrowstyle ( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=->, instantiate=False, names=None, objects=[‘-‘, ‘->’, ‘-[‘, ‘-|>’, ‘<->’, ‘<|-|>’], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The arrowstyle used to draw the arrow. Accepted arrow styles are ‘-‘, ‘->’, ‘-[‘, ‘- |>', '<->' and '<| - | >’
param Number points ( allow_None=False, bounds=None, constant=False, default=40, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Font size of arrow text (if any).
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
closest ( coords , **kwargs )

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:
dimension: The dimension to return values for expanded (bool, optional): Whether to expand values flat (bool, optional): Whether to flatten array
Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Arrow'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Arrow'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Arrow'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Arrow'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reduction )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The element after reductions have been applied.
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=False , **sample_values )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Arrow'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Arrow'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. ItemTable ( data , **params ) [source]

Bases: holoviews.core.element.Element

A tabular element type to allow convenient visualization of either a standard Python dictionary, an OrderedDict or a list of tuples (i.e. input suitable for an OrderedDict constructor). If an OrderedDict is used, the headings will be kept in the correct order. Tables store heterogeneous data with different labels.

Dimension objects are also accepted as keys, allowing dimensional information (e.g type and units) to be associated per heading.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=ItemTable, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, 0), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
ItemTables hold an index Dimension for each value they contain, i.e. they are equivalent to the keys.
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘Default’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
ItemTables should have only index Dimensions.
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
cell_type ( row , col ) [source]

Returns the cell type given a row and column index. The common basic cell types are ‘data’ and ‘heading’.

clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
closest ( coords , **kwargs )

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.ItemTable'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.ItemTable'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.ItemTable'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.ItemTable'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

pprint_cell ( row , col ) [source]

Get the formatted cell value for the given row and column indices.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.ItemTable'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.ItemTable'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
values ( ) [source]

Deprecated method to access the ItemTable value dimension values.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. Element ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.dimension.ViewableElement , holoviews.core.layout.Composable , holoviews.core.overlay.Overlayable

Element is the atomic datastructure used to wrap some data with an associated visual representation, e.g. an element may represent a set of points, an image or a curve. Elements provide a common API for interacting with data of different types and define how the data map to a set of dimensions and how those map to the visual representation.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Element, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
array ( dimensions=None ) [source]

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
closest ( coords , **kwargs ) [source]

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
classmethod collapse_data ( data , function=None , kdims=None , **kwargs ) [source]

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

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.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Element'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Element'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Element'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs ) [source]

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Element'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs ) [source]

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reduction ) [source]

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The element after reductions have been applied.
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=False , **sample_values ) [source]

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Element'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Element'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None ) [source]

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. Graph ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.data.Dataset , holoviews.core.element.Element2D

Graph is high-level Element representing both nodes and edges. A Graph may be defined in an abstract form representing just the abstract edges between nodes and optionally may be made concrete by supplying a Nodes Element defining the concrete positions of each node. If the node positions are supplied the EdgePaths (defining the concrete edges) can be inferred automatically or supplied explicitly.

The constructor accepts regular columnar data defining the edges or a tuple of the abstract edges and nodes, or a tuple of the abstract edges, nodes, and edgepaths.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Graph, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘start’), Dimension(‘end’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
edge_type

alias of EdgePaths

edgepaths

Returns the fixed EdgePaths or computes direct connections between supplied nodes.

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.Graph'>)
classmethod from_networkx ( G , layout_function , nodes=None , **kwargs ) [source]

Generate a HoloViews Graph from a networkx.Graph object and networkx layout function. Any keyword arguments will be passed to the layout function. By default it will extract all node and edge attributes from the networkx.Graph but explicit node information may also be supplied.

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.Graph'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.Graph'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.Graph'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

node_type

alias of Nodes

nodes

Computes the node positions the first time they are requested if no explicit node information was supplied.

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , selection_mode='edges' , **selection ) [source]

Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.

Selecting by a node dimensions selects all edges and nodes that are connected to the selected nodes. To select only edges between the selected nodes set the selection_mode to ‘nodes’.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.Graph'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.Graph'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. Polygons ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.element.path.Contours

The Polygons element represents one or more polygon geometries with associated scalar values. Each polygon geometry may be split into sub-geometries on NaN-values and may be associated with scalar values. In analogy to GEOS geometry types a Polygons element is a collection of Polygon and MultiPolygon geometries. Polygon geometries are defined as a set of coordinates describing the exterior bounding ring and any number of interior holes.

Like all other elements a Polygons element may be defined through an extensible list of interfaces. Natively HoloViews provides the MultiInterface which allows representing paths as lists of regular columnar data objects including arrays, dataframes and dictionaries of column arrays and scalars.

The canonical representation is a list of dictionaries storing the x- and y-coordinates, a list-of-lists of arrays representing the holes, along with any other values:

[{‘x’: 1d-array, ‘y’: 1d-array, ‘holes’: list-of-lists-of-arrays, ‘value’: scalar}, …]

Alternatively Polygons also supports a single columnar data-structure to specify an individual polygon:

{‘x’: 1d-array, ‘y’: 1d-array, ‘holes’: list-of-lists-of-arrays, ‘value’: scalar}

The list-of-lists format of the holes corresponds to the potential for each coordinate array to be split into a multi-geometry through NaN-separators. Each sub-geometry separated by the NaNs therefore has an unambiguous mapping to a list of holes. If a (multi-)polygon has no holes, the ‘holes’ key may be ommitted.

Any value dimensions stored on a Polygons geometry must be scalar, just like the Contours element. Since not all formats allow storing scalar values as actual scalars arrays which are the same length as the coordinates but have only one unique value are also considered scalar.

The easiest way of accessing the individual geometries is using the Polygons.split method, which returns each path geometry as a separate entity, while the other methods assume a flattened representation where all paths are separated by NaN values.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Polygons, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.
param List vdims ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Polygons optionally accept a value dimension, corresponding to the supplied value.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ObjectSelector datatype ( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’, ‘dataframe’, ‘dictionary’, ‘dask’, ‘array’], instantiate=True, names=None, objects=[], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
param Number level ( allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Optional level associated with the set of Contours.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Polygons'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Polygons'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Polygons'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
has_holes

Detects whether any polygon in the Polygons element defines holes. Useful to avoid expanding Polygons unless necessary.

hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
holes ( ) [source]

Returns a list-of-lists-of-lists of hole arrays. The three levels of nesting reflects the structure of the polygons:

  1. The first level of nesting corresponds to the list of geometries
  2. The second level corresponds to each Polygon in a MultiPolygon
  3. The third level of nesting allows for multiple holes per Polygon
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Polygons'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Bypasses selection on data and sets extents based on selection.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Polygons'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Polygons'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
split ( start=None , end=None , datatype=None , **kwargs )

The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. Annotation ( data , **params ) [source]

Bases: holoviews.core.element.Element2D

An Annotation is a special type of element that is designed to be overlaid on top of any arbitrary 2D element. Annotations have neither key nor value dimensions allowing them to be overlaid over any type of data.

Note that one or more Annotations can be displayed without being overlaid on top of any other data. In such instances (by default) they will be displayed using the unit axis limits (0.0-1.0 in both directions) unless an explicit ‘extents’ parameter is supplied. The extents of the bottom Annotation in the Overlay is used when multiple Annotations are displayed together.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Annotation, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
closest ( coords , **kwargs )

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:
dimension: The dimension to return values for expanded (bool, optional): Whether to expand values flat (bool, optional): Whether to flatten array
Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Annotation'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Annotation'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Annotation'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Annotation'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reduction )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The element after reductions have been applied.
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=False , **sample_values )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Annotation'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Annotation'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

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

Bases: holoviews.element.stats.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.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Violin, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.Violin'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.Violin'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.Violin'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.Violin'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.Violin'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.Violin'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

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

Bases: holoviews.element.chart.Chart

Spikes is a Chart element which represents a number of discrete spikes, events or observations in a 1D coordinate system. The key dimension therefore represents the position of each spike along the x-axis while the first value dimension, if defined, controls the height along the y-axis. It may therefore be used to visualize the distribution of discrete events, representing a rug plot, or to draw the strength some signal.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Spikes, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimension(s) of a Chart represent the independent variable(s).
param List vdims ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions of the Chart, usually corresponding to a number of dependent variables.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spikes'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spikes'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spikes'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spikes'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spikes'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spikes'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. Sankey ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.element.graphs.Graph

Sankey is an acyclic, directed Graph type that represents the flow of some quantity between its nodes.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Sankey, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘start’), Dimension(‘end’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=False, default=[Dimension(‘Value’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
edge_type

alias of holoviews.element.graphs.EdgePaths

edgepaths

Returns the fixed EdgePaths or computes direct connections between supplied nodes.

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.sankey.Sankey'>)
from_networkx ( G , layout_function , nodes=None , **kwargs )

Generate a HoloViews Graph from a networkx.Graph object and networkx layout function. Any keyword arguments will be passed to the layout function. By default it will extract all node and edge attributes from the networkx.Graph but explicit node information may also be supplied.

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.sankey.Sankey'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.sankey.Sankey'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.sankey.Sankey'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

node_type

alias of holoviews.element.graphs.Nodes

nodes

Computes the node positions the first time they are requested if no explicit node information was supplied.

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , selection_mode='edges' , **selection )

Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.

Selecting by a node dimensions selects all edges and nodes that are connected to the selected nodes. To select only edges between the selected nodes set the selection_mode to ‘nodes’.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.sankey.Sankey'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.sankey.Sankey'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. Contours ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.element.path.Path

The Contours element is a subtype of a Path which is characterized by the fact that each path geometry may only be associated with scalar values. It supports all the same data formats as a Path but does not allow continuously varying values along the path geometry’s coordinates. Conceptually Contours therefore represent iso-contours or isoclines, i.e. a function of two variables which describes a curve along which the function has a constant value.

The canonical representation is a list of dictionaries storing the x- and y-coordinates along with any other (scalar) values:

[{‘x’: 1d-array, ‘y’: 1d-array, ‘value’: scalar}, …]

Alternatively Contours also supports a single columnar data-structure to specify an individual contour:

{‘x’: 1d-array, ‘y’: 1d-array, ‘value’: scalar, ‘continuous’: 1d-array}

Since not all formats allow storing scalar values as actual scalars arrays which are the same length as the coordinates but have only one unique value are also considered scalar. This is strictly enforced, ensuring that each path geometry represents a valid iso-contour.

The easiest way of accessing the individual geometries is using the Contours.split method, which returns each path geometry as a separate entity, while the other methods assume a flattened representation where all paths are separated by NaN values.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Contours, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Contours optionally accept a value dimension, corresponding to the supplied values.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ObjectSelector datatype ( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’, ‘dataframe’, ‘dictionary’, ‘dask’, ‘array’], instantiate=True, names=None, objects=[], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
param Number level ( allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Optional level associated with the set of Contours.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Contours'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Contours'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Contours'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Contours'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Bypasses selection on data and sets extents based on selection.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Contours'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Contours'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
split ( start=None , end=None , datatype=None , **kwargs )

The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

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

Bases: holoviews.element.stats.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.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Bivariate, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, 1), constant=False, default=[Dimension(‘Density’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
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 )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.Bivariate'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.Bivariate'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.Bivariate'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.Bivariate'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.Bivariate'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.Bivariate'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. RGB ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.element.raster.Image

RGB represents a regularly spaced 2D grid of an underlying continuous space of RGB(A) (red, green, blue and alpha) color space values. The definition of the grid closely matches the semantics of an Image and in the simplest case the grid may be specified as a NxMx3 or NxMx4 array of values along with a bounds, but it may also be defined through explicit and regularly spaced x/y-coordinate arrays. The two most basic supported constructors of an RGB element therefore include:

RGB((X, Y, R, G, B))

where X is a 1D array of shape M, Y is a 1D array of shape N and R/G/B are 2D array of shape NxM, or equivalently:

RGB(Z, bounds=(x0, y0, x1, y1))

where Z is a 3D array of stacked R/G/B arrays with shape NxMx3/4 and the bounds define the (left, bottom, top, right) edges of the four corners of the grid. Other gridded formats which support declaring of explicit x/y-coordinate arrays such as xarray are also supported.

Note that the interpretation of the orientation changes depending on whether bounds or explicit coordinates are used.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=RGB, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The label of the x- and y-dimension of the Raster in the form of a string or dimension object.
param List vdims ( allow_None=False, bounds=(3, 4), constant=False, default=[Dimension(‘R’), Dimension(‘G’), Dimension(‘B’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The dimension description of the data held in the matrix. If an alpha channel is supplied, the defined alpha_dimension is automatically appended to this list.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘grid’, ‘xarray’, ‘image’, ‘cube’, ‘dataframe’, ‘dictionary’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
param ClassSelector bounds ( allow_None=False, constant=False, default=BoundingBox(radius=0.5), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The bounding region in sheet coordinates containing the data.
param Number rtol ( allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The tolerance used to enforce regular sampling for regular, gridded data where regular sampling is expected. Expressed as the maximal allowable sampling difference between sample locations.
param ClassSelector alpha_dimension ( allow_None=False, constant=False, default=A, instantiate=False, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The alpha dimension definition to add the value dimensions if an alpha channel is supplied.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Returns a clone of the object with matching parameter values containing the specified args and kwargs.

If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.

closest ( coords=[] , **kwargs )

Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates.

closest_cell_center ( x , y )

Given arbitrary sheet coordinates, return the sheet coordinates of the center of the closest unit.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.RGB'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.RGB'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.RGB'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.RGB'>)
classmethod load_image ( filename , height=1 , array=False , bounds=None , bare=False , **kwargs ) [source]

Returns an raster element or raw numpy array from a PNG image file, using matplotlib.

The specified height determines the bounds of the raster object in sheet coordinates: by default the height is 1 unit with the width scaled appropriately by the image aspect ratio.

Note that as PNG images are encoded as RGBA, the red component maps to the first channel, the green component maps to the second component etc. For RGB elements, this mapping is trivial but may be important for subclasses e.g. for HSV elements.

Setting bare=True will apply options disabling axis labels displaying just the bare image. Any additional keyword arguments will be passed to the Image object.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
matrix2sheet ( float_row , float_col )

Convert a floating-point location (float_row,float_col) in matrix coordinates to its corresponding location (x,y) in sheet coordinates.

Valid for scalar or array float_row and float_col.

Inverse of sheet2matrix().

matrixidx2sheet ( row , col )

Return (x,y) where x and y are the floating point coordinates of the center of the given matrix cell (row,col). If the matrix cell represents a 0.2 by 0.2 region, then the center location returned would be 0.1,0.1.

NOTE: This is NOT the strict mathematical inverse of sheet2matrixidx(), because sheet2matrixidx() discards all but the integer portion of the continuous matrix coordinate.

Valid only for scalar or array row and col.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
rgb

Returns the corresponding RGB element.

Other than the updating parameter definitions, this is the only change needed to implemented an arbitrary colorspace as a subclass of RGB.

sample ( samples=[] , **kwargs )

Allows sampling of an Image as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. On an Image the coordinates are continuously indexed and will always snap to the nearest coordinate.

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.RGB'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.RGB'>)
shape

Returns the shape of the data.

sheet2matrix ( x , y )

Convert a point (x,y) in Sheet coordinates to continuous matrix coordinates.

Returns (float_row,float_col), where float_row corresponds to y, and float_col to x.

Valid for scalar or array x and y.

Note about Bounds For a Sheet with BoundingBox(points=((-0.5,-0.5),(0.5,0.5))) and density=3, x=-0.5 corresponds to float_col=0.0 and x=0.5 corresponds to float_col=3.0. float_col=3.0 is not inside the matrix representing this Sheet, which has the three columns (0,1,2). That is, x=-0.5 is inside the BoundingBox but x=0.5 is outside. Similarly, y=0.5 is inside (at row 0) but y=-0.5 is outside (at row 3) (it’s the other way round for y because the matrix row index increases as y decreases).

sheet2matrixidx ( x , y )

Convert a point (x,y) in sheet coordinates to the integer row and column index of the matrix cell in which that point falls, given a bounds and density. Returns (row,column).

Note that if coordinates along the right or bottom boundary are passed into this function, the returned matrix coordinate of the boundary will be just outside the matrix, because the right and bottom boundaries are exclusive.

Valid for scalar or array x and y.

sheetcoordinates_of_matrixidx ( )

Return x,y where x is a vector of sheet coordinates representing the x-center of each matrix cell, and y represents the corresponding y-center of the cell.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

xdensity

The spacing between elements in an underlying matrix representation, in the x direction.

ydensity

The spacing between elements in an underlying matrix representation, in the y direction.

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

Bases: holoviews.core.data.Dataset , holoviews.core.element.Element2D

Labels represents a collection of text labels associated with 2D coordinates. Unlike the Text annotation, Labels is a Dataset type which allows drawing vectorized labels from tabular or gridded data.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Labels, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The label of the x- and y-dimension of the Labels element in form of a string or dimension object.
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘Label’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Defines the value dimension corresponding to the label text.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Labels'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Labels'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Labels'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Labels'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Labels'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Labels'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

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

Bases: holoviews.element.geom.Geometry

Points represents a set of coordinates in 2D space, which may optionally be associated with any number of value dimensions.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Points, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Value dimensions can be associated with a geometry.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.geom.Points'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.geom.Points'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.geom.Points'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.geom.Points'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.geom.Points'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.geom.Points'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. VLine ( x , **params ) [source]

Bases: holoviews.element.annotation.Annotation

Vertical line annotation at the given position.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=VLine, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ClassSelector x ( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The x-position of the VLine which make be numeric or a timestamp.
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
closest ( coords , **kwargs )

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:
dimension: The dimension to return values for expanded (bool, optional): Whether to expand values flat (bool, optional): Whether to flatten array
Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.VLine'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.VLine'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.VLine'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.VLine'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reduction )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The element after reductions have been applied.
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=False , **sample_values )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.VLine'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.VLine'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. Spline ( spline_points , **params ) [source]

Bases: holoviews.element.annotation.Annotation

Draw a spline using the given handle coordinates and handle codes. The constructor accepts a tuple in format (coords, codes).

Follows format of matplotlib spline definitions as used in matplotlib.path.Path with the following codes:

Path.STOP : 0 Path.MOVETO : 1 Path.LINETO : 2 Path.CURVE3 : 3 Path.CURVE4 : 4 Path.CLOSEPLOY: 79

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Spline, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides ) [source]

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned Spline
closest ( coords , **kwargs )

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:
dimension: The dimension to return values for expanded (bool, optional): Whether to expand values flat (bool, optional): Whether to flatten array
Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Spline'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Spline'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Spline'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Spline'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reduction )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The element after reductions have been applied.
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=False , **sample_values )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Spline'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Spline'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. Text ( x , y , text , fontsize=12 , halign='center' , valign='center' , rotation=0 , **params ) [source]

Bases: holoviews.element.annotation.Annotation

Draw a text annotation at the specified position with custom fontsize, alignment and rotation.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Text, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ClassSelector x ( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The x-position of the arrow which make be numeric or a timestamp.
param ClassSelector y ( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The y-position of the arrow which make be numeric or a timestamp.
param String text ( allow_None=False, basestring=<class ‘str’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The text to be displayed.
param Number fontsize ( allow_None=False, bounds=None, constant=False, default=12, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Font size of the text.
param Number rotation ( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Text rotation angle in degrees.
param ObjectSelector halign ( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=center, instantiate=False, names=None, objects=[‘left’, ‘right’, ‘center’], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The horizontal alignment position of the displayed text. Allowed values are ‘left’, ‘right’ and ‘center’.
param ObjectSelector valign ( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=center, instantiate=False, names=None, objects=[‘top’, ‘bottom’, ‘center’], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The vertical alignment position of the displayed text. Allowed values are ‘center’, ‘top’ and ‘bottom’.
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
closest ( coords , **kwargs )

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:
dimension: The dimension to return values for expanded (bool, optional): Whether to expand values flat (bool, optional): Whether to flatten array
Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Text'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Text'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Text'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Text'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reduction )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The element after reductions have been applied.
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=False , **sample_values )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Text'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Text'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. Box ( x , y , spec , **params ) [source]

Bases: holoviews.element.path.BaseShape

Draw a centered box of a given width at the given position with the specified aspect ratio (if any).

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Box, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The assigned group name.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Value dimensions can be associated with a geometry.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ObjectSelector datatype ( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’, ‘dataframe’, ‘dictionary’, ‘dask’, ‘array’], instantiate=True, names=None, objects=[], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
param Number x ( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The x-position of the box center.
param Number y ( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The y-position of the box center.
param Number width ( allow_None=False, bounds=None, constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The width of the box.
param Number height ( allow_None=False, bounds=None, constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The height of the box.
param Number orientation ( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Orientation in the Cartesian coordinate system, the counterclockwise angle in radians between the first axis and the horizontal.
param Number aspect ( allow_None=False, bounds=None, constant=False, default=1.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Optional multiplier applied to the box size to compute the width in cases where only the length value is set.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( *args , **overrides )

Returns a clone of the object with matching parameter values containing the specified args and kwargs.

closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Box'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Box'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Box'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Box'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Bypasses selection on data and sets extents based on selection.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Box'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Box'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
split ( start=None , end=None , datatype=None , **kwargs )

The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. HeatMap ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.data.Dataset , holoviews.core.element.Element2D

HeatMap represents a 2D grid of categorical coordinates which can be computed from a sparse tabular representation. A HeatMap does not automatically aggregate the supplied values, so if the data contains multiple entries for the same coordinate on the 2D grid it should be aggregated using the aggregate method before display.

The HeatMap constructor will support any tabular or gridded data format with 2 coordinates and at least one value dimension. A simple example:

HeatMap([(x1, y1, z1), (x2, y2, z2), …])

However any tabular and gridded format, including pandas DataFrames, dictionaries of columns, xarray DataArrays and more are supported if the library is importable.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=HeatMap, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HeatMap'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HeatMap'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HeatMap'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HeatMap'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HeatMap'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HeatMap'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

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

Bases: holoviews.element.chart.Chart

Scatter is a Chart element representing a set of points in a 1D coordinate system where the key dimension maps to the points location along the x-axis while the first value dimension represents the location of the point along the y-axis.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Scatter, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimension(s) of a Chart represent the independent variable(s).
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions of the Chart, usually corresponding to a number of dependent variables.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Scatter'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Scatter'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Scatter'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Scatter'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Scatter'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Scatter'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. Path ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.element.geom.Geometry

The Path element represents one or more of path geometries with associated values. Each path geometry may be split into sub-geometries on NaN-values and may be associated with scalar values or array values varying along its length. In analogy to GEOS geometry types a Path is a collection of LineString and MultiLineString geometries with associated values.

Like all other elements a Path may be defined through an extensible list of interfaces. Natively, HoloViews provides the MultiInterface which allows representing paths as lists of regular columnar data objects including arrays, dataframes and dictionaries of column arrays and scalars.

The canonical representation is a list of dictionaries storing the x- and y-coordinates along with any other values:

[{‘x’: 1d-array, ‘y’: 1d-array, ‘value’: scalar, ‘continuous’: 1d-array}, …]

Alternatively Path also supports a single columnar data-structure to specify an individual path:

{‘x’: 1d-array, ‘y’: 1d-array, ‘value’: scalar, ‘continuous’: 1d-array}

Both scalar values and values continuously varying along the geometries coordinates a Path may be used vary visual properties of the paths such as the color. Since not all formats allow storing scalar values as actual scalars, arrays that are the same length as the coordinates but have only one unique value are also considered scalar.

The easiest way of accessing the individual geometries is using the Path.split method, which returns each path geometry as a separate entity, while the other methods assume a flattened representation where all paths are separated by NaN values.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Path, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Value dimensions can be associated with a geometry.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ObjectSelector datatype ( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’, ‘dataframe’, ‘dictionary’, ‘dask’, ‘array’], instantiate=True, names=None, objects=[], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Path'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Path'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Path'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Path'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs ) [source]

Bypasses selection on data and sets extents based on selection.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Path'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Path'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
split ( start=None , end=None , datatype=None , **kwargs ) [source]

The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

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

Bases: holoviews.element.chart.Chart

ErrorBars is a Chart element representing error bars in a 1D coordinate system where the key dimension corresponds to the location along the x-axis and the value dimensions define the location along the y-axis and the symmetric or assymetric spread.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=ErrorBars, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the quantity measured by the ErrorBars object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimension(s) of a Chart represent the independent variable(s).
param List vdims ( allow_None=False, bounds=(1, None), constant=True, default=[Dimension(‘y’), Dimension(‘yerror’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions of the Chart, usually corresponding to a number of dependent variables.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.ErrorBars'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.ErrorBars'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.ErrorBars'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.ErrorBars'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

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

Return the lower and upper bounds of values along dimension.

Range of the y-dimension includes the symmetric or assymetric error.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.ErrorBars'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.ErrorBars'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. QuadMesh ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.data.Dataset , holoviews.core.element.Element2D

A QuadMesh represents 2D rectangular grid expressed as x- and y-coordinates defined as 1D or 2D arrays. Unlike the Image type a QuadMesh may be regularly or irregularly spaced and contain either bin edges or bin centers. If bin edges are supplied the shape of the x/y-coordinate arrays should be one greater than the shape of the value array.

The default interface expects data to be specified in the form:

QuadMesh((X, Y, Z))

where X and Y may be 1D or 2D arrays of the shape N(+1) and M(+1) respectively or N(+1)xM(+1) and the Z value array should be of shape NxM. Other gridded formats such as xarray are also supported if installed.

The grid orientation follows the standard matrix convention: An array Z with shape (nrows, ncolumns) is plotted with the column number as X and the row number as Y.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=QuadMesh, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.QuadMesh'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.QuadMesh'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.QuadMesh'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.QuadMesh'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.QuadMesh'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.QuadMesh'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
trimesh ( ) [source]

Converts a QuadMesh into a TriMesh.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. Chord ( data , kdims=None , vdims=None , compute=True , **params ) [source]

Bases: holoviews.element.graphs.Graph

Chord is a special type of Graph which computes the locations of each node on a circle and the chords connecting them. The amount of radial angle devoted to each node and the number of chords are scaled by a weight supplied as a value dimension.

If the values are integers then the number of chords is directly scaled by the value, if the values are floats then the number of chords are apportioned such that the lowest value edge is given one chord and all other nodes are given nodes proportional to their weight.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Chord, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘start’), Dimension(‘end’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
edge_type

alias of EdgePaths

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.Chord'>)
from_networkx ( G , layout_function , nodes=None , **kwargs )

Generate a HoloViews Graph from a networkx.Graph object and networkx layout function. Any keyword arguments will be passed to the layout function. By default it will extract all node and edge attributes from the networkx.Graph but explicit node information may also be supplied.

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.Chord'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.Chord'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.Chord'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

node_type

alias of Nodes

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , selection_mode='edges' , **selection )

Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.

Selecting by a node dimensions selects all edges and nodes that are connected to the selected nodes. To select only edges between the selected nodes set the selection_mode to ‘nodes’.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.Chord'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.Chord'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. HSV ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.element.raster.RGB

HSV represents a regularly spaced 2D grid of an underlying continuous space of HSV (hue, saturation and value) color space values. The definition of the grid closely matches the semantics of an Image or RGB element and in the simplest case the grid may be specified as a NxMx3 or NxMx4 array of values along with a bounds, but it may also be defined through explicit and regularly spaced x/y-coordinate arrays. The two most basic supported constructors of an HSV element therefore include:

HSV((X, Y, H, S, V))

where X is a 1D array of shape M, Y is a 1D array of shape N and H/S/V are 2D array of shape NxM, or equivalently:

HSV(Z, bounds=(x0, y0, x1, y1))

where Z is a 3D array of stacked H/S/V arrays with shape NxMx3/4 and the bounds define the (left, bottom, top, right) edges of the four corners of the grid. Other gridded formats which support declaring of explicit x/y-coordinate arrays such as xarray are also supported.

Note that the interpretation of the orientation changes depending on whether bounds or explicit coordinates are used.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=HSV, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The label of the x- and y-dimension of the Raster in the form of a string or dimension object.
param List vdims ( allow_None=False, bounds=(3, 4), constant=False, default=[Dimension(‘H’), Dimension(‘S’), Dimension(‘V’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The dimension description of the data held in the array. If an alpha channel is supplied, the defined alpha_dimension is automatically appended to this list.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘grid’, ‘xarray’, ‘image’, ‘cube’, ‘dataframe’, ‘dictionary’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
param ClassSelector bounds ( allow_None=False, constant=False, default=BoundingBox(radius=0.5), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The bounding region in sheet coordinates containing the data.
param Number rtol ( allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The tolerance used to enforce regular sampling for regular, gridded data where regular sampling is expected. Expressed as the maximal allowable sampling difference between sample locations.
param ClassSelector alpha_dimension ( allow_None=False, constant=False, default=A, instantiate=False, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The alpha dimension definition to add the value dimensions if an alpha channel is supplied.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Returns a clone of the object with matching parameter values containing the specified args and kwargs.

If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.

closest ( coords=[] , **kwargs )

Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates.

closest_cell_center ( x , y )

Given arbitrary sheet coordinates, return the sheet coordinates of the center of the closest unit.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HSV'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HSV'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HSV'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HSV'>)
load_image ( filename , height=1 , array=False , bounds=None , bare=False , **kwargs )

Returns an raster element or raw numpy array from a PNG image file, using matplotlib.

The specified height determines the bounds of the raster object in sheet coordinates: by default the height is 1 unit with the width scaled appropriately by the image aspect ratio.

Note that as PNG images are encoded as RGBA, the red component maps to the first channel, the green component maps to the second component etc. For RGB elements, this mapping is trivial but may be important for subclasses e.g. for HSV elements.

Setting bare=True will apply options disabling axis labels displaying just the bare image. Any additional keyword arguments will be passed to the Image object.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
matrix2sheet ( float_row , float_col )

Convert a floating-point location (float_row,float_col) in matrix coordinates to its corresponding location (x,y) in sheet coordinates.

Valid for scalar or array float_row and float_col.

Inverse of sheet2matrix().

matrixidx2sheet ( row , col )

Return (x,y) where x and y are the floating point coordinates of the center of the given matrix cell (row,col). If the matrix cell represents a 0.2 by 0.2 region, then the center location returned would be 0.1,0.1.

NOTE: This is NOT the strict mathematical inverse of sheet2matrixidx(), because sheet2matrixidx() discards all but the integer portion of the continuous matrix coordinate.

Valid only for scalar or array row and col.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
rgb

Conversion from HSV to RGB.

sample ( samples=[] , **kwargs )

Allows sampling of an Image as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. On an Image the coordinates are continuously indexed and will always snap to the nearest coordinate.

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HSV'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HSV'>)
shape

Returns the shape of the data.

sheet2matrix ( x , y )

Convert a point (x,y) in Sheet coordinates to continuous matrix coordinates.

Returns (float_row,float_col), where float_row corresponds to y, and float_col to x.

Valid for scalar or array x and y.

Note about Bounds For a Sheet with BoundingBox(points=((-0.5,-0.5),(0.5,0.5))) and density=3, x=-0.5 corresponds to float_col=0.0 and x=0.5 corresponds to float_col=3.0. float_col=3.0 is not inside the matrix representing this Sheet, which has the three columns (0,1,2). That is, x=-0.5 is inside the BoundingBox but x=0.5 is outside. Similarly, y=0.5 is inside (at row 0) but y=-0.5 is outside (at row 3) (it’s the other way round for y because the matrix row index increases as y decreases).

sheet2matrixidx ( x , y )

Convert a point (x,y) in sheet coordinates to the integer row and column index of the matrix cell in which that point falls, given a bounds and density. Returns (row,column).

Note that if coordinates along the right or bottom boundary are passed into this function, the returned matrix coordinate of the boundary will be just outside the matrix, because the right and bottom boundaries are exclusive.

Valid for scalar or array x and y.

sheetcoordinates_of_matrixidx ( )

Return x,y where x is a vector of sheet coordinates representing the x-center of each matrix cell, and y represents the corresponding y-center of the cell.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

xdensity

The spacing between elements in an underlying matrix representation, in the x direction.

ydensity

The spacing between elements in an underlying matrix representation, in the y direction.

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

Bases: holoviews.element.stats.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.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Distribution, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘Value’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, 1), constant=False, default=[Dimension(‘Density’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
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 )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.Distribution'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.Distribution'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.Distribution'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.Distribution'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.Distribution'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.Distribution'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. TriMesh ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.element.graphs.Graph

A TriMesh represents a mesh of triangles represented as the simplices and nodes. The simplices represent a indices into the nodes array. The mesh therefore follows a datastructure very similar to a graph, with the abstract connectivity between nodes stored on the TriMesh element itself, the node positions stored on a Nodes element and the concrete paths making up each triangle generated when required by accessing the edgepaths.

Unlike a Graph each simplex is represented as the node indices of the three corners of each triangle.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=TriMesh, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(3, 3), constant=False, default=[‘node1’, ‘node2’, ‘node3’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Dimensions declaring the node indices of each triangle.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
edge_type

alias of EdgePaths

edgepaths

Returns the EdgePaths by generating a triangle for each simplex.

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.TriMesh'>)
from_networkx ( G , layout_function , nodes=None , **kwargs )

Generate a HoloViews Graph from a networkx.Graph object and networkx layout function. Any keyword arguments will be passed to the layout function. By default it will extract all node and edge attributes from the networkx.Graph but explicit node information may also be supplied.

classmethod from_vertices ( data ) [source]

Uses Delauney triangulation to compute triangle simplices for each point.

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.TriMesh'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.TriMesh'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.TriMesh'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

node_type

alias of Nodes

nodes

Computes the node positions the first time they are requested if no explicit node information was supplied.

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

point_type

alias of holoviews.element.geom.Points

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection ) [source]

Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.TriMesh'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.TriMesh'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element. EdgePaths ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.element.path.Path

EdgePaths is a simple Element representing the paths of edges connecting nodes in a graph.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=EdgePaths, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Value dimensions can be associated with a geometry.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ObjectSelector datatype ( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’, ‘dataframe’, ‘dictionary’, ‘dask’, ‘array’], instantiate=True, names=None, objects=[], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.EdgePaths'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.EdgePaths'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.EdgePaths'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.EdgePaths'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Bypasses selection on data and sets extents based on selection.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.EdgePaths'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.EdgePaths'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
split ( start=None , end=None , datatype=None , **kwargs )

The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring


annotation Module

Inheritance diagram of holoviews.element.annotation
class holoviews.element.annotation. Annotation ( data , **params ) [source]

Bases: holoviews.core.element.Element2D

An Annotation is a special type of element that is designed to be overlaid on top of any arbitrary 2D element. Annotations have neither key nor value dimensions allowing them to be overlaid over any type of data.

Note that one or more Annotations can be displayed without being overlaid on top of any other data. In such instances (by default) they will be displayed using the unit axis limits (0.0-1.0 in both directions) unless an explicit ‘extents’ parameter is supplied. The extents of the bottom Annotation in the Overlay is used when multiple Annotations are displayed together.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Annotation, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
closest ( coords , **kwargs )

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:
dimension: The dimension to return values for expanded (bool, optional): Whether to expand values flat (bool, optional): Whether to flatten array
Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Annotation'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Annotation'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Annotation'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Annotation'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reduction )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The element after reductions have been applied.
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=False , **sample_values )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Annotation'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Annotation'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.annotation. Arrow ( x , y , text='' , direction='<' , points=40 , arrowstyle='->' , **params ) [source]

Bases: holoviews.element.annotation.Annotation

Draw an arrow to the given xy position with optional text at distance ‘points’ away. The direction of the arrow may be specified as well as the arrow head style.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Arrow, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ClassSelector x ( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The x-position of the arrow which make be numeric or a timestamp.
param ClassSelector y ( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The y-position of the arrow which make be numeric or a timestamp.
param String text ( allow_None=False, basestring=<class ‘str’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Text associated with the arrow.
param ObjectSelector direction ( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=<, instantiate=False, names=None, objects=[‘<’, ‘^’, ‘>’, ‘v’], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The cardinal direction in which the arrow is pointing. Accepted arrow directions are ‘<’, ‘^’, ‘>’ and ‘v’.
param ObjectSelector arrowstyle ( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=->, instantiate=False, names=None, objects=[‘-‘, ‘->’, ‘-[‘, ‘-|>’, ‘<->’, ‘<|-|>’], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The arrowstyle used to draw the arrow. Accepted arrow styles are ‘-‘, ‘->’, ‘-[‘, ‘- |>', '<->' and '<| - | >’
param Number points ( allow_None=False, bounds=None, constant=False, default=40, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Font size of arrow text (if any).
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
closest ( coords , **kwargs )

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:
dimension: The dimension to return values for expanded (bool, optional): Whether to expand values flat (bool, optional): Whether to flatten array
Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Arrow'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Arrow'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Arrow'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Arrow'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reduction )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The element after reductions have been applied.
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=False , **sample_values )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Arrow'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Arrow'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.annotation. Div ( data , **params ) [source]

Bases: holoviews.core.element.Element

The Div element represents a div DOM node in an HTML document defined as a string containing valid HTML.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Div, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
closest ( coords , **kwargs )

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Div'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Div'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Div'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Div'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reduction )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The element after reductions have been applied.
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=False , **sample_values )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Div'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Div'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.annotation. HLine ( y , **params ) [source]

Bases: holoviews.element.annotation.Annotation

Horizontal line annotation at the given position.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=HLine, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ClassSelector y ( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The y-position of the VLine which make be numeric or a timestamp.
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
closest ( coords , **kwargs )

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:
dimension: The dimension to return values for expanded (bool, optional): Whether to expand values flat (bool, optional): Whether to flatten array
Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.HLine'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.HLine'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.HLine'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.HLine'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reduction )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The element after reductions have been applied.
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=False , **sample_values )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.HLine'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.HLine'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.annotation. Labels ( data , kdims=None , vdims=None , **kwargs ) [source]

Bases: holoviews.core.data.Dataset , holoviews.core.element.Element2D

Labels represents a collection of text labels associated with 2D coordinates. Unlike the Text annotation, Labels is a Dataset type which allows drawing vectorized labels from tabular or gridded data.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Labels, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The label of the x- and y-dimension of the Labels element in form of a string or dimension object.
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘Label’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Defines the value dimension corresponding to the label text.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Labels'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Labels'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Labels'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Labels'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Labels'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Labels'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.annotation. Spline ( spline_points , **params ) [source]

Bases: holoviews.element.annotation.Annotation

Draw a spline using the given handle coordinates and handle codes. The constructor accepts a tuple in format (coords, codes).

Follows format of matplotlib spline definitions as used in matplotlib.path.Path with the following codes:

Path.STOP : 0 Path.MOVETO : 1 Path.LINETO : 2 Path.CURVE3 : 3 Path.CURVE4 : 4 Path.CLOSEPLOY: 79

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Spline, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides ) [source]

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned Spline
closest ( coords , **kwargs )

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:
dimension: The dimension to return values for expanded (bool, optional): Whether to expand values flat (bool, optional): Whether to flatten array
Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Spline'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Spline'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Spline'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Spline'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reduction )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The element after reductions have been applied.
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=False , **sample_values )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Spline'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Spline'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.annotation. Text ( x , y , text , fontsize=12 , halign='center' , valign='center' , rotation=0 , **params ) [source]

Bases: holoviews.element.annotation.Annotation

Draw a text annotation at the specified position with custom fontsize, alignment and rotation.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Text, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ClassSelector x ( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The x-position of the arrow which make be numeric or a timestamp.
param ClassSelector y ( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The y-position of the arrow which make be numeric or a timestamp.
param String text ( allow_None=False, basestring=<class ‘str’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The text to be displayed.
param Number fontsize ( allow_None=False, bounds=None, constant=False, default=12, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Font size of the text.
param Number rotation ( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Text rotation angle in degrees.
param ObjectSelector halign ( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=center, instantiate=False, names=None, objects=[‘left’, ‘right’, ‘center’], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The horizontal alignment position of the displayed text. Allowed values are ‘left’, ‘right’ and ‘center’.
param ObjectSelector valign ( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=center, instantiate=False, names=None, objects=[‘top’, ‘bottom’, ‘center’], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The vertical alignment position of the displayed text. Allowed values are ‘center’, ‘top’ and ‘bottom’.
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
closest ( coords , **kwargs )

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:
dimension: The dimension to return values for expanded (bool, optional): Whether to expand values flat (bool, optional): Whether to flatten array
Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Text'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Text'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Text'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Text'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reduction )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The element after reductions have been applied.
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=False , **sample_values )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Text'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Text'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.annotation. VLine ( x , **params ) [source]

Bases: holoviews.element.annotation.Annotation

Vertical line annotation at the given position.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=VLine, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ClassSelector x ( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The x-position of the VLine which make be numeric or a timestamp.
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
closest ( coords , **kwargs )

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:
dimension: The dimension to return values for expanded (bool, optional): Whether to expand values flat (bool, optional): Whether to flatten array
Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.VLine'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.VLine'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.VLine'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.VLine'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reduction )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The element after reductions have been applied.
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=False , **sample_values )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.VLine'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.VLine'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring


chart Module

Inheritance diagram of holoviews.element.chart
class holoviews.element.chart. Area ( data , kdims=None , vdims=None , **kwargs ) [source]

Bases: holoviews.element.chart.Curve

Area is a Chart element representing the area under a curve or between two curves in a 1D coordinate system. The key dimension represents the location of each coordinate along the x-axis, while the value dimension(s) represent the height of the area or the lower and upper bounds of the area between curves.

Multiple areas may be stacked by overlaying them an passing them to the stack method.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Area, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimension(s) of a Chart represent the independent variable(s).
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions of the Chart, usually corresponding to a number of dependent variables.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Area'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Area'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Area'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Area'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Area'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Area'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
classmethod stack ( areas ) [source]

Stacks an (Nd)Overlay of Area or Curve Elements by offsetting their baselines. To stack a HoloMap or DynamicMap use the map method.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.chart. Bars ( data , kdims=None , vdims=None , **kwargs ) [source]

Bases: holoviews.element.chart.Chart

Bars is a Chart element representing categorical observations using the height of rectangular bars. The key dimensions represent the categorical groupings of the data, but may also be used to stack the bars, while the first value dimension represents the height of each bar.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Bars, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 3), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimension(s) of a Chart represent the independent variable(s).
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions of the Chart, usually corresponding to a number of dependent variables.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Bars'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Bars'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Bars'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Bars'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Bars'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Bars'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.chart. Chart ( data , kdims=None , vdims=None , **kwargs ) [source]

Bases: holoviews.core.data.Dataset , holoviews.core.element.Element2D

A Chart is an abstract baseclass for elements representing one or more independent and dependent variables defining a 1D coordinate system with associated values. The independent variables or key dimensions map onto the x-axis while the dependent variables are usually mapped to the location, height or spread along the y-axis. Any number of additional value dimensions may be associated with a Chart.

If a chart’s independent variable (or key dimension) is numeric the chart will represent a discretely sampled version of the underlying continuously sampled 1D space. Therefore indexing along this variable will automatically snap to the closest coordinate.

Since a Chart is a subclass of a Dataset it supports the full set of data interfaces but usually each dimension of a chart represents a column stored in a dictionary, array or DataFrame.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Chart, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimension(s) of a Chart represent the independent variable(s).
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions of the Chart, usually corresponding to a number of dependent variables.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Chart'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Chart'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Chart'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Chart'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Chart'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Chart'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.chart. Curve ( data , kdims=None , vdims=None , **kwargs ) [source]

Bases: holoviews.element.chart.Chart

Curve is a Chart element representing a line in a 1D coordinate system where the key dimension maps on the line x-coordinate and the first value dimension represents the height of the line along the y-axis.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Curve, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimension(s) of a Chart represent the independent variable(s).
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions of the Chart, usually corresponding to a number of dependent variables.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Curve'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Curve'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Curve'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Curve'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Curve'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Curve'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.chart. ErrorBars ( data , kdims=None , vdims=None , **kwargs ) [source]

Bases: holoviews.element.chart.Chart

ErrorBars is a Chart element representing error bars in a 1D coordinate system where the key dimension corresponds to the location along the x-axis and the value dimensions define the location along the y-axis and the symmetric or assymetric spread.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=ErrorBars, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the quantity measured by the ErrorBars object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimension(s) of a Chart represent the independent variable(s).
param List vdims ( allow_None=False, bounds=(1, None), constant=True, default=[Dimension(‘y’), Dimension(‘yerror’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions of the Chart, usually corresponding to a number of dependent variables.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.ErrorBars'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.ErrorBars'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.ErrorBars'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.ErrorBars'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

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

Return the lower and upper bounds of values along dimension.

Range of the y-dimension includes the symmetric or assymetric error.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.ErrorBars'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.ErrorBars'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.chart. Histogram ( data , edges=None , **params ) [source]

Bases: holoviews.element.chart.Chart

Histogram is a Chart element representing a number of bins in a 1D coordinate system. The key dimension represents the binned values, which may be declared as bin edges or bin centers, while the value dimensions usually defines a count, frequency or density associated with each bin.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Histogram, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Dimensions on Element2Ds determine the number of indexable dimensions.
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘Frequency’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions of the Chart, usually corresponding to a number of dependent variables.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘grid’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
edges

Property to access the Histogram edges provided for backward compatibility

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Histogram'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Histogram'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Histogram'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Histogram'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Histogram'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Histogram'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
values

Property to access the Histogram values provided for backward compatibility

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.chart. Scatter ( data , kdims=None , vdims=None , **kwargs ) [source]

Bases: holoviews.element.chart.Chart

Scatter is a Chart element representing a set of points in a 1D coordinate system where the key dimension maps to the points location along the x-axis while the first value dimension represents the location of the point along the y-axis.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Scatter, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimension(s) of a Chart represent the independent variable(s).
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions of the Chart, usually corresponding to a number of dependent variables.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Scatter'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Scatter'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Scatter'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Scatter'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Scatter'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Scatter'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.chart. Spikes ( data , kdims=None , vdims=None , **kwargs ) [source]

Bases: holoviews.element.chart.Chart

Spikes is a Chart element which represents a number of discrete spikes, events or observations in a 1D coordinate system. The key dimension therefore represents the position of each spike along the x-axis while the first value dimension, if defined, controls the height along the y-axis. It may therefore be used to visualize the distribution of discrete events, representing a rug plot, or to draw the strength some signal.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Spikes, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimension(s) of a Chart represent the independent variable(s).
param List vdims ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions of the Chart, usually corresponding to a number of dependent variables.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spikes'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spikes'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spikes'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spikes'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spikes'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spikes'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.chart. Spread ( data , kdims=None , vdims=None , **kwargs ) [source]

Bases: holoviews.element.chart.ErrorBars

Spread is a Chart element representing a spread of values or confidence band in a 1D coordinate system. The key dimension(s) corresponds to the location along the x-axis and the value dimensions define the location along the y-axis as well as the symmetric or assymetric spread.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Spread, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the quantity measured by the ErrorBars object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimension(s) of a Chart represent the independent variable(s).
param List vdims ( allow_None=False, bounds=(1, None), constant=True, default=[Dimension(‘y’), Dimension(‘yerror’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions of the Chart, usually corresponding to a number of dependent variables.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spread'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spread'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spread'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spread'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Range of the y-dimension includes the symmetric or assymetric error.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spread'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spread'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring


chart3d Module

Inheritance diagram of holoviews.element.chart3d
class holoviews.element.chart3d. Path3D ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.element.Element3D , holoviews.element.path.Path

Path3D is a 3D element representing a line through 3D space. The key dimensions represent the position of each coordinate along the x-, y- and z-axis while the value dimensions can optionally supply additional information.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Path3D, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=False, default=[Dimension(‘x’), Dimension(‘y’), Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.
param List vdims ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Path3D can have optional value dimensions.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None, None, None), instantiate=False, length=6, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 3D space defined as (xmin, ymin, zmin, xmax, ymax, zmax).
param ObjectSelector datatype ( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’, ‘dataframe’, ‘dictionary’, ‘dask’, ‘array’], instantiate=True, names=None, objects=[], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Path3D'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Path3D'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Path3D'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Path3D'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Bypasses selection on data and sets extents based on selection.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Path3D'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Path3D'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
split ( start=None , end=None , datatype=None , **kwargs )

The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.chart3d. Scatter3D ( data , kdims=None , vdims=None , **kwargs ) [source]

Bases: holoviews.core.element.Element3D , holoviews.element.geom.Points

Scatter3D is a 3D element representing the position of a collection of coordinates in a 3D space. The key dimensions represent the position of each coordinate along the x-, y- and z-axis while the value dimensions can optionally supply additional information.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Scatter3D, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=False, default=[Dimension(‘x’), Dimension(‘y’), Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.
param List vdims ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Scatter3D can have optional value dimensions, which may be mapped onto color and size.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None, None, None), instantiate=False, length=6, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 3D space defined as (xmin, ymin, zmin, xmax, ymax, zmax).
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Scatter3D'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Scatter3D'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Scatter3D'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Scatter3D'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Scatter3D'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Scatter3D'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.chart3d. Surface ( data , kdims=None , vdims=None , extents=None , **params ) [source]

Bases: holoviews.element.raster.Image , holoviews.core.element.Element3D

A Surface represents a regularly sampled 2D grid with associated values defining the height along the z-axis. The key dimensions of a Surface represent the 2D coordinates along the x- and y-axes while the value dimension declares the height at each grid location.

The data of a Surface is usually defined as a 2D array of values and either a bounds tuple defining the extent in the 2D space or explicit x- and y-coordinate arrays.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Surface, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The Surface x and y dimensions of the space defined by the supplied extent.
param List vdims ( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The Surface height dimension.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None, None, None), instantiate=False, length=6, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 3D space defined as (xmin, ymin, zmin, xmax, ymax, zmax).
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘grid’, ‘xarray’, ‘image’, ‘cube’, ‘dataframe’, ‘dictionary’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
param ClassSelector bounds ( allow_None=False, constant=False, default=BoundingBox(radius=0.5), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The bounding region in sheet coordinates containing the data.
param Number rtol ( allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The tolerance used to enforce regular sampling for regular, gridded data where regular sampling is expected. Expressed as the maximal allowable sampling difference between sample locations.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Returns a clone of the object with matching parameter values containing the specified args and kwargs.

If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.

closest ( coords=[] , **kwargs )

Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates.

closest_cell_center ( x , y )

Given arbitrary sheet coordinates, return the sheet coordinates of the center of the closest unit.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Surface'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Surface'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Surface'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Surface'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
matrix2sheet ( float_row , float_col )

Convert a floating-point location (float_row,float_col) in matrix coordinates to its corresponding location (x,y) in sheet coordinates.

Valid for scalar or array float_row and float_col.

Inverse of sheet2matrix().

matrixidx2sheet ( row , col )

Return (x,y) where x and y are the floating point coordinates of the center of the given matrix cell (row,col). If the matrix cell represents a 0.2 by 0.2 region, then the center location returned would be 0.1,0.1.

NOTE: This is NOT the strict mathematical inverse of sheet2matrixidx(), because sheet2matrixidx() discards all but the integer portion of the continuous matrix coordinate.

Valid only for scalar or array row and col.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , **kwargs )

Allows sampling of an Image as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. On an Image the coordinates are continuously indexed and will always snap to the nearest coordinate.

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Surface'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Surface'>)
shape

Returns the shape of the data.

sheet2matrix ( x , y )

Convert a point (x,y) in Sheet coordinates to continuous matrix coordinates.

Returns (float_row,float_col), where float_row corresponds to y, and float_col to x.

Valid for scalar or array x and y.

Note about Bounds For a Sheet with BoundingBox(points=((-0.5,-0.5),(0.5,0.5))) and density=3, x=-0.5 corresponds to float_col=0.0 and x=0.5 corresponds to float_col=3.0. float_col=3.0 is not inside the matrix representing this Sheet, which has the three columns (0,1,2). That is, x=-0.5 is inside the BoundingBox but x=0.5 is outside. Similarly, y=0.5 is inside (at row 0) but y=-0.5 is outside (at row 3) (it’s the other way round for y because the matrix row index increases as y decreases).

sheet2matrixidx ( x , y )

Convert a point (x,y) in sheet coordinates to the integer row and column index of the matrix cell in which that point falls, given a bounds and density. Returns (row,column).

Note that if coordinates along the right or bottom boundary are passed into this function, the returned matrix coordinate of the boundary will be just outside the matrix, because the right and bottom boundaries are exclusive.

Valid for scalar or array x and y.

sheetcoordinates_of_matrixidx ( )

Return x,y where x is a vector of sheet coordinates representing the x-center of each matrix cell, and y represents the corresponding y-center of the cell.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

xdensity

The spacing between elements in an underlying matrix representation, in the x direction.

ydensity

The spacing between elements in an underlying matrix representation, in the y direction.

class holoviews.element.chart3d. TriSurface ( data , kdims=None , vdims=None , **kwargs ) [source]

Bases: holoviews.core.element.Element3D , holoviews.element.geom.Points

TriSurface represents a set of coordinates in 3D space which define a surface via a triangulation algorithm (usually Delauney triangulation). They key dimensions of a TriSurface define the position of each point along the x-, y- and z-axes, while value dimensions can provide additional information about each point.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=TriSurface, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=False, default=[Dimension(‘x’), Dimension(‘y’), Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a TriSurface represent the 3D coordinates of each point.
param List vdims ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions of a TriSurface can provide additional information about each 3D coordinate.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None, None, None), instantiate=False, length=6, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 3D space defined as (xmin, ymin, zmin, xmax, ymax, zmax).
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.TriSurface'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.TriSurface'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.TriSurface'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.TriSurface'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.TriSurface'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.TriSurface'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.chart3d. Trisurface ( *args , **kwargs ) [source]

Bases: holoviews.element.chart3d.TriSurface

Old name for TriSurface. Retaining for backwards compatibility until holoviews 2.0.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Trisurface, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=False, default=[Dimension(‘x’), Dimension(‘y’), Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a TriSurface represent the 3D coordinates of each point.
param List vdims ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions of a TriSurface can provide additional information about each 3D coordinate.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None, None, None), instantiate=False, length=6, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 3D space defined as (xmin, ymin, zmin, xmax, ymax, zmax).
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Trisurface'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Trisurface'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Trisurface'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Trisurface'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Trisurface'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Trisurface'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring


comparison Module

Inheritance diagram of holoviews.element.comparison

Helper classes for comparing the equality of two HoloViews objects.

These classes are designed to integrate with unittest.TestCase (see the tests directory) while making equality testing easily accessible to the user.

For instance, to test if two Matrix objects are equal you can use:

Comparison.assertEqual(matrix1, matrix2)

This will raise an AssertionError if the two matrix objects are not equal, including information regarding what exactly failed to match.

Note that this functionality could not be provided using comparison methods on all objects as comparison operators only return Booleans and thus would not supply any information regarding why two elements are considered different.

class holoviews.element.comparison. Comparison [source]

Bases: holoviews.element.comparison.ComparisonInterface

Class used for comparing two HoloViews objects, including complex composite objects. Comparisons are available as classmethods, the most general being the assertEqual method that is intended to work with any input.

For instance, to test if two Image objects are equal you can use:

Comparison.assertEqual(matrix1, matrix2)

assertEqual ( first , second , msg=None )

Classmethod equivalent to unittest.TestCase method

failureException

alias of builtins.AssertionError

simple_equality ( first , second , msg=None )

Classmethod equivalent to unittest.TestCase method (longMessage = False.)

class holoviews.element.comparison. ComparisonInterface [source]

Bases: object

This class is designed to allow equality testing to work seamlessly with unittest.TestCase as a mix-in by implementing a compatible interface (namely the assertEqual method).

The assertEqual class method is to be overridden by an instance method of the same name when used as a mix-in with TestCase. The contents of the equality_type_funcs dictionary is suitable for use with TestCase.addTypeEqualityFunc.

classmethod assertEqual ( first , second , msg=None ) [source]

Classmethod equivalent to unittest.TestCase method

failureException

alias of builtins.AssertionError

classmethod simple_equality ( first , second , msg=None ) [source]

Classmethod equivalent to unittest.TestCase method (longMessage = False.)

class holoviews.element.comparison. ComparisonTestCase ( *args , **kwargs ) [source]

Bases: holoviews.element.comparison.Comparison , unittest.case.TestCase

Class to integrate the Comparison class with unittest.TestCase.

addCleanup ( function , *args , **kwargs )

Add a function, with arguments, to be called when the test is completed. Functions added are called on a LIFO basis and are called after tearDown on test failure or success.

Cleanup items are called even if setUp fails (unlike tearDown).

addTypeEqualityFunc ( typeobj , function )

Add a type specific assertEqual style function to compare a type.

This method is for use by TestCase subclasses that need to register their own type equality functions to provide nicer error messages.

Args:
typeobj: The data type to call this function on when both values
are of the same type in assertEqual().
function: The callable taking two arguments and an optional
msg= argument that raises self.failureException with a useful error message when the two arguments are not equal.
assertAlmostEqual ( first , second , places=None , msg=None , delta=None )

Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero, or by comparing that the difference between the two objects is more than the given delta.

Note that decimal places (from zero) are usually not the same as significant digits (measured from the most significant digit).

If the two objects compare equal then they will automatically compare almost equal.

assertCountEqual ( first , second , msg=None )

An unordered sequence comparison asserting that the same elements, regardless of order. If the same element occurs more than once, it verifies that the elements occur the same number of times.

self.assertEqual(Counter(list(first)),
Counter(list(second)))
Example:
  • [0, 1, 1] and [1, 0, 1] compare equal.
  • [0, 0, 1] and [0, 1] compare unequal.
assertDictContainsSubset ( subset , dictionary , msg=None )

Checks whether dictionary is a superset of subset.

assertEqual ( first , second , msg=None )

Classmethod equivalent to unittest.TestCase method

assertFalse ( expr , msg=None )

Check that the expression is false.

assertGreater ( a , b , msg=None )

Just like self.assertTrue(a > b), but with a nicer default message.

assertGreaterEqual ( a , b , msg=None )

Just like self.assertTrue(a >= b), but with a nicer default message.

assertIn ( member , container , msg=None )

Just like self.assertTrue(a in b), but with a nicer default message.

assertIs ( expr1 , expr2 , msg=None )

Just like self.assertTrue(a is b), but with a nicer default message.

assertIsInstance ( obj , cls , msg=None )

Same as self.assertTrue(isinstance(obj, cls)), with a nicer default message.

assertIsNone ( obj , msg=None )

Same as self.assertTrue(obj is None), with a nicer default message.

assertIsNot ( expr1 , expr2 , msg=None )

Just like self.assertTrue(a is not b), but with a nicer default message.

assertIsNotNone ( obj , msg=None )

Included for symmetry with assertIsNone.

assertLess ( a , b , msg=None )

Just like self.assertTrue(a < b), but with a nicer default message.

assertLessEqual ( a , b , msg=None )

Just like self.assertTrue(a <= b), but with a nicer default message.

assertListEqual ( list1 , list2 , msg=None )

A list-specific equality assertion.

Args:

list1: The first list to compare. list2: The second list to compare. msg: Optional message to use on failure instead of a list of

differences.
assertLogs ( logger=None , level=None )

Fail unless a log message of level level or higher is emitted on logger_name or its children. If omitted, level defaults to INFO and logger defaults to the root logger.

This method must be used as a context manager, and will yield a recording object with two attributes: output and records . At the end of the context manager, the output attribute will be a list of the matching formatted log messages and the records attribute will be a list of the corresponding LogRecord objects.

Example:

with self.assertLogs('foo', level='INFO') as cm:
    logging.getLogger('foo').info('first message')
    logging.getLogger('foo.bar').error('second message')
self.assertEqual(cm.output, ['INFO:foo:first message',
                             'ERROR:foo.bar:second message'])
assertMultiLineEqual ( first , second , msg=None )

Assert that two multi-line strings are equal.

assertNotAlmostEqual ( first , second , places=None , msg=None , delta=None )

Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero, or by comparing that the difference between the two objects is less than the given delta.

Note that decimal places (from zero) are usually not the same as significant digits (measured from the most significant digit).

Objects that are equal automatically fail.

assertNotEqual ( first , second , msg=None )

Fail if the two objects are equal as determined by the ‘!=’ operator.

assertNotIn ( member , container , msg=None )

Just like self.assertTrue(a not in b), but with a nicer default message.

assertNotIsInstance ( obj , cls , msg=None )

Included for symmetry with assertIsInstance.

assertNotRegex ( text , unexpected_regex , msg=None )

Fail the test if the text matches the regular expression.

assertRaises ( expected_exception , *args , **kwargs )

Fail unless an exception of class expected_exception is raised by the callable when invoked with specified positional and keyword arguments. If a different type of exception is raised, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception.

If called with the callable and arguments omitted, will return a context object used like this:

with self.assertRaises(SomeException):
    do_something()

An optional keyword argument ‘msg’ can be provided when assertRaises is used as a context object.

The context manager keeps a reference to the exception as the ‘exception’ attribute. This allows you to inspect the exception after the assertion:

with self.assertRaises(SomeException) as cm:
    do_something()
the_exception = cm.exception
self.assertEqual(the_exception.error_code, 3)
assertRaisesRegex ( expected_exception , expected_regex , *args , **kwargs )

Asserts that the message in a raised exception matches a regex.

Args:

expected_exception: Exception class expected to be raised. expected_regex: Regex (re pattern object or string) expected

to be found in error message.

args: Function to be called and extra positional args. kwargs: Extra kwargs. msg: Optional message used in case of failure. Can only be used

when assertRaisesRegex is used as a context manager.
assertRegex ( text , expected_regex , msg=None )

Fail the test unless the text matches the regular expression.

assertSequenceEqual ( seq1 , seq2 , msg=None , seq_type=None )

An equality assertion for ordered sequences (like lists and tuples).

For the purposes of this function, a valid ordered sequence type is one which can be indexed, has a length, and has an equality operator.

Args:

seq1: The first sequence to compare. seq2: The second sequence to compare. seq_type: The expected datatype of the sequences, or None if no

datatype should be enforced.
msg: Optional message to use on failure instead of a list of
differences.
assertSetEqual ( set1 , set2 , msg=None )

A set-specific equality assertion.

Args:

set1: The first set to compare. set2: The second set to compare. msg: Optional message to use on failure instead of a list of

differences.

assertSetEqual uses ducktyping to support different types of sets, and is optimized for sets specifically (parameters must support a difference method).

assertTrue ( expr , msg=None )

Check that the expression is true.

assertTupleEqual ( tuple1 , tuple2 , msg=None )

A tuple-specific equality assertion.

Args:

tuple1: The first tuple to compare. tuple2: The second tuple to compare. msg: Optional message to use on failure instead of a list of

differences.
assertWarns ( expected_warning , *args , **kwargs )

Fail unless a warning of class warnClass is triggered by the callable when invoked with specified positional and keyword arguments. If a different type of warning is triggered, it will not be handled: depending on the other warning filtering rules in effect, it might be silenced, printed out, or raised as an exception.

If called with the callable and arguments omitted, will return a context object used like this:

with self.assertWarns(SomeWarning):
    do_something()

An optional keyword argument ‘msg’ can be provided when assertWarns is used as a context object.

The context manager keeps a reference to the first matching warning as the ‘warning’ attribute; similarly, the ‘filename’ and ‘lineno’ attributes give you information about the line of Python code from which the warning was triggered. This allows you to inspect the warning after the assertion:

with self.assertWarns(SomeWarning) as cm:
    do_something()
the_warning = cm.warning
self.assertEqual(the_warning.some_attribute, 147)
assertWarnsRegex ( expected_warning , expected_regex , *args , **kwargs )

Asserts that the message in a triggered warning matches a regexp. Basic functioning is similar to assertWarns() with the addition that only warnings whose messages also match the regular expression are considered successful matches.

Args:

expected_warning: Warning class expected to be triggered. expected_regex: Regex (re pattern object or string) expected

to be found in error message.

args: Function to be called and extra positional args. kwargs: Extra kwargs. msg: Optional message used in case of failure. Can only be used

when assertWarnsRegex is used as a context manager.
debug ( )

Run the test without collecting errors in a TestResult

doCleanups ( )

Execute all cleanup functions. Normally called for you after tearDown.

fail ( msg=None )

Fail immediately, with the given message.

failureException

alias of builtins.AssertionError

setUp ( )

Hook method for setting up the test fixture before exercising it.

setUpClass ( )

Hook method for setting up class fixture before running tests in the class.

shortDescription ( )

Returns a one-line description of the test, or None if no description has been provided.

The default implementation of this method returns the first line of the specified test method’s docstring.

simple_equality ( first , second , msg=None )

Classmethod equivalent to unittest.TestCase method (longMessage = False.)

skipTest ( reason )

Skip this test.

subTest ( msg=<object object> , **params )

Return a context manager that will return the enclosed block of code in a subtest identified by the optional message and keyword parameters. A failure in the subtest marks the test case as failed but resumes execution at the end of the enclosed block, allowing further test code to be executed.

tearDown ( )

Hook method for deconstructing the test fixture after testing it.

tearDownClass ( )

Hook method for deconstructing the class fixture after running all tests in the class.


path Module

Inheritance diagram of holoviews.element.path

The path module provides a set of elements to draw paths and polygon geometries in 2D space. In addition to three general elements are Path, Contours and Polygons, it defines a number of elements to quickly draw common shapes.

class holoviews.element.path. BaseShape ( **params ) [source]

Bases: holoviews.element.path.Path

A BaseShape is a Path that can be succinctly expressed by a small number of parameters instead of a full path specification. For instance, a circle may be expressed by the center position and radius instead of an explicit list of path coordinates.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Path, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Value dimensions can be associated with a geometry.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ObjectSelector datatype ( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’, ‘dataframe’, ‘dictionary’, ‘dask’, ‘array’], instantiate=True, names=None, objects=[], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( *args , **overrides ) [source]

Returns a clone of the object with matching parameter values containing the specified args and kwargs.

closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.BaseShape'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.BaseShape'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.BaseShape'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.BaseShape'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Bypasses selection on data and sets extents based on selection.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.BaseShape'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.BaseShape'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
split ( start=None , end=None , datatype=None , **kwargs )

The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.path. Bounds ( lbrt , **params ) [source]

Bases: holoviews.element.path.BaseShape

An arbitrary axis-aligned bounding rectangle defined by the (left, bottom, right, top) coordinate positions.

If supplied a single real number as input, this value will be treated as the radius of a square, zero-center box which will be used to compute the corresponding lbrt tuple.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Bounds, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The assigned group name.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Value dimensions can be associated with a geometry.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ObjectSelector datatype ( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’, ‘dataframe’, ‘dictionary’, ‘dask’, ‘array’], instantiate=True, names=None, objects=[], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
param NumericTuple lbrt ( allow_None=False, constant=False, default=(-0.5, -0.5, 0.5, 0.5), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The (left, bottom, right, top) coordinates of the bounding box.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( *args , **overrides )

Returns a clone of the object with matching parameter values containing the specified args and kwargs.

closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Bounds'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Bounds'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Bounds'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Bounds'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Bypasses selection on data and sets extents based on selection.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Bounds'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Bounds'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
split ( start=None , end=None , datatype=None , **kwargs )

The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.path. Box ( x , y , spec , **params ) [source]

Bases: holoviews.element.path.BaseShape

Draw a centered box of a given width at the given position with the specified aspect ratio (if any).

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Box, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The assigned group name.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Value dimensions can be associated with a geometry.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ObjectSelector datatype ( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’, ‘dataframe’, ‘dictionary’, ‘dask’, ‘array’], instantiate=True, names=None, objects=[], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
param Number x ( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The x-position of the box center.
param Number y ( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The y-position of the box center.
param Number width ( allow_None=False, bounds=None, constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The width of the box.
param Number height ( allow_None=False, bounds=None, constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The height of the box.
param Number orientation ( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Orientation in the Cartesian coordinate system, the counterclockwise angle in radians between the first axis and the horizontal.
param Number aspect ( allow_None=False, bounds=None, constant=False, default=1.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Optional multiplier applied to the box size to compute the width in cases where only the length value is set.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( *args , **overrides )

Returns a clone of the object with matching parameter values containing the specified args and kwargs.

closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Box'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Box'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Box'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Box'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Bypasses selection on data and sets extents based on selection.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Box'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Box'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
split ( start=None , end=None , datatype=None , **kwargs )

The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.path. Contours ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.element.path.Path

The Contours element is a subtype of a Path which is characterized by the fact that each path geometry may only be associated with scalar values. It supports all the same data formats as a Path but does not allow continuously varying values along the path geometry’s coordinates. Conceptually Contours therefore represent iso-contours or isoclines, i.e. a function of two variables which describes a curve along which the function has a constant value.

The canonical representation is a list of dictionaries storing the x- and y-coordinates along with any other (scalar) values:

[{‘x’: 1d-array, ‘y’: 1d-array, ‘value’: scalar}, …]

Alternatively Contours also supports a single columnar data-structure to specify an individual contour:

{‘x’: 1d-array, ‘y’: 1d-array, ‘value’: scalar, ‘continuous’: 1d-array}

Since not all formats allow storing scalar values as actual scalars arrays which are the same length as the coordinates but have only one unique value are also considered scalar. This is strictly enforced, ensuring that each path geometry represents a valid iso-contour.

The easiest way of accessing the individual geometries is using the Contours.split method, which returns each path geometry as a separate entity, while the other methods assume a flattened representation where all paths are separated by NaN values.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Contours, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Contours optionally accept a value dimension, corresponding to the supplied values.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ObjectSelector datatype ( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’, ‘dataframe’, ‘dictionary’, ‘dask’, ‘array’], instantiate=True, names=None, objects=[], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
param Number level ( allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Optional level associated with the set of Contours.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Contours'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Contours'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Contours'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Contours'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Bypasses selection on data and sets extents based on selection.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Contours'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Contours'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
split ( start=None , end=None , datatype=None , **kwargs )

The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.path. Ellipse ( x , y , spec , **params ) [source]

Bases: holoviews.element.path.BaseShape

Draw an axis-aligned ellipse at the specified x,y position with the given orientation.

The simplest (default) Ellipse is a circle, specified using:

Ellipse(x,y, diameter)

A circle is a degenerate ellipse where the width and height are equal. To specify these explicitly, you can use:

Ellipse(x,y, (width, height))

There is also an aspect parameter allowing you to generate an ellipse by specifying a multiplicating factor that will be applied to the height only.

Note that as a subclass of Path, internally an Ellipse is a sequence of (x,y) sample positions. Ellipse could also be implemented as an annotation that uses a dedicated ellipse artist.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Ellipse, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The assigned group name.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Value dimensions can be associated with a geometry.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ObjectSelector datatype ( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’, ‘dataframe’, ‘dictionary’, ‘dask’, ‘array’], instantiate=True, names=None, objects=[], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
param Number x ( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The x-position of the ellipse center.
param Number y ( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The y-position of the ellipse center.
param Number width ( allow_None=False, bounds=None, constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The width of the ellipse.
param Number height ( allow_None=False, bounds=None, constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The height of the ellipse.
param Number orientation ( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Orientation in the Cartesian coordinate system, the counterclockwise angle in radians between the first axis and the horizontal.
param Number aspect ( allow_None=False, bounds=None, constant=False, default=1.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Optional multiplier applied to the diameter to compute the width in cases where only the diameter value is set.
param Number samples ( allow_None=False, bounds=None, constant=False, default=100, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The sample count used to draw the ellipse.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( *args , **overrides )

Returns a clone of the object with matching parameter values containing the specified args and kwargs.

closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Ellipse'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Ellipse'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Ellipse'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Ellipse'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Bypasses selection on data and sets extents based on selection.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Ellipse'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Ellipse'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
split ( start=None , end=None , datatype=None , **kwargs )

The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.path. Path ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.element.geom.Geometry

The Path element represents one or more of path geometries with associated values. Each path geometry may be split into sub-geometries on NaN-values and may be associated with scalar values or array values varying along its length. In analogy to GEOS geometry types a Path is a collection of LineString and MultiLineString geometries with associated values.

Like all other elements a Path may be defined through an extensible list of interfaces. Natively, HoloViews provides the MultiInterface which allows representing paths as lists of regular columnar data objects including arrays, dataframes and dictionaries of column arrays and scalars.

The canonical representation is a list of dictionaries storing the x- and y-coordinates along with any other values:

[{‘x’: 1d-array, ‘y’: 1d-array, ‘value’: scalar, ‘continuous’: 1d-array}, …]

Alternatively Path also supports a single columnar data-structure to specify an individual path:

{‘x’: 1d-array, ‘y’: 1d-array, ‘value’: scalar, ‘continuous’: 1d-array}

Both scalar values and values continuously varying along the geometries coordinates a Path may be used vary visual properties of the paths such as the color. Since not all formats allow storing scalar values as actual scalars, arrays that are the same length as the coordinates but have only one unique value are also considered scalar.

The easiest way of accessing the individual geometries is using the Path.split method, which returns each path geometry as a separate entity, while the other methods assume a flattened representation where all paths are separated by NaN values.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Path, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Value dimensions can be associated with a geometry.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ObjectSelector datatype ( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’, ‘dataframe’, ‘dictionary’, ‘dask’, ‘array’], instantiate=True, names=None, objects=[], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Path'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Path'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Path'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Path'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs ) [source]

Bypasses selection on data and sets extents based on selection.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Path'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Path'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
split ( start=None , end=None , datatype=None , **kwargs ) [source]

The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.path. Polygons ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.element.path.Contours

The Polygons element represents one or more polygon geometries with associated scalar values. Each polygon geometry may be split into sub-geometries on NaN-values and may be associated with scalar values. In analogy to GEOS geometry types a Polygons element is a collection of Polygon and MultiPolygon geometries. Polygon geometries are defined as a set of coordinates describing the exterior bounding ring and any number of interior holes.

Like all other elements a Polygons element may be defined through an extensible list of interfaces. Natively HoloViews provides the MultiInterface which allows representing paths as lists of regular columnar data objects including arrays, dataframes and dictionaries of column arrays and scalars.

The canonical representation is a list of dictionaries storing the x- and y-coordinates, a list-of-lists of arrays representing the holes, along with any other values:

[{‘x’: 1d-array, ‘y’: 1d-array, ‘holes’: list-of-lists-of-arrays, ‘value’: scalar}, …]

Alternatively Polygons also supports a single columnar data-structure to specify an individual polygon:

{‘x’: 1d-array, ‘y’: 1d-array, ‘holes’: list-of-lists-of-arrays, ‘value’: scalar}

The list-of-lists format of the holes corresponds to the potential for each coordinate array to be split into a multi-geometry through NaN-separators. Each sub-geometry separated by the NaNs therefore has an unambiguous mapping to a list of holes. If a (multi-)polygon has no holes, the ‘holes’ key may be ommitted.

Any value dimensions stored on a Polygons geometry must be scalar, just like the Contours element. Since not all formats allow storing scalar values as actual scalars arrays which are the same length as the coordinates but have only one unique value are also considered scalar.

The easiest way of accessing the individual geometries is using the Polygons.split method, which returns each path geometry as a separate entity, while the other methods assume a flattened representation where all paths are separated by NaN values.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Polygons, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.
param List vdims ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Polygons optionally accept a value dimension, corresponding to the supplied value.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param ObjectSelector datatype ( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’, ‘dataframe’, ‘dictionary’, ‘dask’, ‘array’], instantiate=True, names=None, objects=[], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
param Number level ( allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Optional level associated with the set of Contours.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Polygons'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Polygons'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Polygons'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
has_holes

Detects whether any polygon in the Polygons element defines holes. Useful to avoid expanding Polygons unless necessary.

hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
holes ( ) [source]

Returns a list-of-lists-of-lists of hole arrays. The three levels of nesting reflects the structure of the polygons:

  1. The first level of nesting corresponds to the list of geometries
  2. The second level corresponds to each Polygon in a MultiPolygon
  3. The third level of nesting allows for multiple holes per Polygon
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Polygons'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Bypasses selection on data and sets extents based on selection.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Polygons'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Polygons'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
split ( start=None , end=None , datatype=None , **kwargs )

The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring


raster Module

Inheritance diagram of holoviews.element.raster
class holoviews.element.raster. HSV ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.element.raster.RGB

HSV represents a regularly spaced 2D grid of an underlying continuous space of HSV (hue, saturation and value) color space values. The definition of the grid closely matches the semantics of an Image or RGB element and in the simplest case the grid may be specified as a NxMx3 or NxMx4 array of values along with a bounds, but it may also be defined through explicit and regularly spaced x/y-coordinate arrays. The two most basic supported constructors of an HSV element therefore include:

HSV((X, Y, H, S, V))

where X is a 1D array of shape M, Y is a 1D array of shape N and H/S/V are 2D array of shape NxM, or equivalently:

HSV(Z, bounds=(x0, y0, x1, y1))

where Z is a 3D array of stacked H/S/V arrays with shape NxMx3/4 and the bounds define the (left, bottom, top, right) edges of the four corners of the grid. Other gridded formats which support declaring of explicit x/y-coordinate arrays such as xarray are also supported.

Note that the interpretation of the orientation changes depending on whether bounds or explicit coordinates are used.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=HSV, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The label of the x- and y-dimension of the Raster in the form of a string or dimension object.
param List vdims ( allow_None=False, bounds=(3, 4), constant=False, default=[Dimension(‘H’), Dimension(‘S’), Dimension(‘V’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The dimension description of the data held in the array. If an alpha channel is supplied, the defined alpha_dimension is automatically appended to this list.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘grid’, ‘xarray’, ‘image’, ‘cube’, ‘dataframe’, ‘dictionary’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
param ClassSelector bounds ( allow_None=False, constant=False, default=BoundingBox(radius=0.5), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The bounding region in sheet coordinates containing the data.
param Number rtol ( allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The tolerance used to enforce regular sampling for regular, gridded data where regular sampling is expected. Expressed as the maximal allowable sampling difference between sample locations.
param ClassSelector alpha_dimension ( allow_None=False, constant=False, default=A, instantiate=False, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The alpha dimension definition to add the value dimensions if an alpha channel is supplied.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Returns a clone of the object with matching parameter values containing the specified args and kwargs.

If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.

closest ( coords=[] , **kwargs )

Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates.

closest_cell_center ( x , y )

Given arbitrary sheet coordinates, return the sheet coordinates of the center of the closest unit.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HSV'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HSV'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HSV'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HSV'>)
load_image ( filename , height=1 , array=False , bounds=None , bare=False , **kwargs )

Returns an raster element or raw numpy array from a PNG image file, using matplotlib.

The specified height determines the bounds of the raster object in sheet coordinates: by default the height is 1 unit with the width scaled appropriately by the image aspect ratio.

Note that as PNG images are encoded as RGBA, the red component maps to the first channel, the green component maps to the second component etc. For RGB elements, this mapping is trivial but may be important for subclasses e.g. for HSV elements.

Setting bare=True will apply options disabling axis labels displaying just the bare image. Any additional keyword arguments will be passed to the Image object.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
matrix2sheet ( float_row , float_col )

Convert a floating-point location (float_row,float_col) in matrix coordinates to its corresponding location (x,y) in sheet coordinates.

Valid for scalar or array float_row and float_col.

Inverse of sheet2matrix().

matrixidx2sheet ( row , col )

Return (x,y) where x and y are the floating point coordinates of the center of the given matrix cell (row,col). If the matrix cell represents a 0.2 by 0.2 region, then the center location returned would be 0.1,0.1.

NOTE: This is NOT the strict mathematical inverse of sheet2matrixidx(), because sheet2matrixidx() discards all but the integer portion of the continuous matrix coordinate.

Valid only for scalar or array row and col.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
rgb

Conversion from HSV to RGB.

sample ( samples=[] , **kwargs )

Allows sampling of an Image as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. On an Image the coordinates are continuously indexed and will always snap to the nearest coordinate.

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HSV'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HSV'>)
shape

Returns the shape of the data.

sheet2matrix ( x , y )

Convert a point (x,y) in Sheet coordinates to continuous matrix coordinates.

Returns (float_row,float_col), where float_row corresponds to y, and float_col to x.

Valid for scalar or array x and y.

Note about Bounds For a Sheet with BoundingBox(points=((-0.5,-0.5),(0.5,0.5))) and density=3, x=-0.5 corresponds to float_col=0.0 and x=0.5 corresponds to float_col=3.0. float_col=3.0 is not inside the matrix representing this Sheet, which has the three columns (0,1,2). That is, x=-0.5 is inside the BoundingBox but x=0.5 is outside. Similarly, y=0.5 is inside (at row 0) but y=-0.5 is outside (at row 3) (it’s the other way round for y because the matrix row index increases as y decreases).

sheet2matrixidx ( x , y )

Convert a point (x,y) in sheet coordinates to the integer row and column index of the matrix cell in which that point falls, given a bounds and density. Returns (row,column).

Note that if coordinates along the right or bottom boundary are passed into this function, the returned matrix coordinate of the boundary will be just outside the matrix, because the right and bottom boundaries are exclusive.

Valid for scalar or array x and y.

sheetcoordinates_of_matrixidx ( )

Return x,y where x is a vector of sheet coordinates representing the x-center of each matrix cell, and y represents the corresponding y-center of the cell.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

xdensity

The spacing between elements in an underlying matrix representation, in the x direction.

ydensity

The spacing between elements in an underlying matrix representation, in the y direction.

class holoviews.element.raster. HeatMap ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.data.Dataset , holoviews.core.element.Element2D

HeatMap represents a 2D grid of categorical coordinates which can be computed from a sparse tabular representation. A HeatMap does not automatically aggregate the supplied values, so if the data contains multiple entries for the same coordinate on the 2D grid it should be aggregated using the aggregate method before display.

The HeatMap constructor will support any tabular or gridded data format with 2 coordinates and at least one value dimension. A simple example:

HeatMap([(x1, y1, z1), (x2, y2, z2), …])

However any tabular and gridded format, including pandas DataFrames, dictionaries of columns, xarray DataArrays and more are supported if the library is importable.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=HeatMap, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HeatMap'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HeatMap'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HeatMap'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HeatMap'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HeatMap'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.HeatMap'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.raster. Image ( data , kdims=None , vdims=None , bounds=None , extents=None , xdensity=None , ydensity=None , rtol=None , **params ) [source]

Bases: holoviews.core.data.Dataset , holoviews.element.raster.Raster , holoviews.core.sheetcoords.SheetCoordinateSystem

Image represents a regularly sampled 2D grid of an underlying continuous space of intensity values, which will be colormapped on plotting. The grid of intensity values may be specified as a NxM sized array of values along with a bounds, but it may also be defined through explicit and regularly spaced x/y-coordinate arrays of shape M and N respectively. The two most basic supported constructors of an Image therefore include:

Image((X, Y, Z))

where X is a 1D array of shape M, Y is a 1D array of shape N and Z is a 2D array of shape NxM, or equivalently:

Image(Z, bounds=(x0, y0, x1, y1))

where Z is a 2D array of shape NxM defining the intensity values and the bounds define the (left, bottom, top, right) edges of four corners of the grid. Other gridded formats which support declaring of explicit x/y-coordinate arrays such as xarray are also supported.

Note that the interpretation of the orientation of the array changes depending on whether bounds or explicit coordinates are used.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Image, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The label of the x- and y-dimension of the Raster in the form of a string or dimension object.
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The dimension description of the data held in the matrix.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘grid’, ‘xarray’, ‘image’, ‘cube’, ‘dataframe’, ‘dictionary’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
param ClassSelector bounds ( allow_None=False, constant=False, default=BoundingBox(radius=0.5), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The bounding region in sheet coordinates containing the data.
param Number rtol ( allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The tolerance used to enforce regular sampling for regular, gridded data where regular sampling is expected. Expressed as the maximal allowable sampling difference between sample locations.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides ) [source]

Returns a clone of the object with matching parameter values containing the specified args and kwargs.

If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.

closest ( coords=[] , **kwargs ) [source]

Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates.

closest_cell_center ( x , y )

Given arbitrary sheet coordinates, return the sheet coordinates of the center of the closest unit.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Image'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Image'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Image'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Image'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
matrix2sheet ( float_row , float_col )

Convert a floating-point location (float_row,float_col) in matrix coordinates to its corresponding location (x,y) in sheet coordinates.

Valid for scalar or array float_row and float_col.

Inverse of sheet2matrix().

matrixidx2sheet ( row , col )

Return (x,y) where x and y are the floating point coordinates of the center of the given matrix cell (row,col). If the matrix cell represents a 0.2 by 0.2 region, then the center location returned would be 0.1,0.1.

NOTE: This is NOT the strict mathematical inverse of sheet2matrixidx(), because sheet2matrixidx() discards all but the integer portion of the continuous matrix coordinate.

Valid only for scalar or array row and col.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , **kwargs ) [source]

Allows sampling of an Image as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. On an Image the coordinates are continuously indexed and will always snap to the nearest coordinate.

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection ) [source]

Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Image'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Image'>)
shape

Returns the shape of the data.

sheet2matrix ( x , y )

Convert a point (x,y) in Sheet coordinates to continuous matrix coordinates.

Returns (float_row,float_col), where float_row corresponds to y, and float_col to x.

Valid for scalar or array x and y.

Note about Bounds For a Sheet with BoundingBox(points=((-0.5,-0.5),(0.5,0.5))) and density=3, x=-0.5 corresponds to float_col=0.0 and x=0.5 corresponds to float_col=3.0. float_col=3.0 is not inside the matrix representing this Sheet, which has the three columns (0,1,2). That is, x=-0.5 is inside the BoundingBox but x=0.5 is outside. Similarly, y=0.5 is inside (at row 0) but y=-0.5 is outside (at row 3) (it’s the other way round for y because the matrix row index increases as y decreases).

sheet2matrixidx ( x , y )

Convert a point (x,y) in sheet coordinates to the integer row and column index of the matrix cell in which that point falls, given a bounds and density. Returns (row,column).

Note that if coordinates along the right or bottom boundary are passed into this function, the returned matrix coordinate of the boundary will be just outside the matrix, because the right and bottom boundaries are exclusive.

Valid for scalar or array x and y.

sheetcoordinates_of_matrixidx ( )

Return x,y where x is a vector of sheet coordinates representing the x-center of each matrix cell, and y represents the corresponding y-center of the cell.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None ) [source]

Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

xdensity

The spacing between elements in an underlying matrix representation, in the x direction.

ydensity

The spacing between elements in an underlying matrix representation, in the y direction.

class holoviews.element.raster. QuadMesh ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.data.Dataset , holoviews.core.element.Element2D

A QuadMesh represents 2D rectangular grid expressed as x- and y-coordinates defined as 1D or 2D arrays. Unlike the Image type a QuadMesh may be regularly or irregularly spaced and contain either bin edges or bin centers. If bin edges are supplied the shape of the x/y-coordinate arrays should be one greater than the shape of the value array.

The default interface expects data to be specified in the form:

QuadMesh((X, Y, Z))

where X and Y may be 1D or 2D arrays of the shape N(+1) and M(+1) respectively or N(+1)xM(+1) and the Z value array should be of shape NxM. Other gridded formats such as xarray are also supported if installed.

The grid orientation follows the standard matrix convention: An array Z with shape (nrows, ncolumns) is plotted with the column number as X and the row number as Y.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=QuadMesh, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.QuadMesh'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.QuadMesh'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.QuadMesh'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.QuadMesh'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.QuadMesh'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.QuadMesh'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
trimesh ( ) [source]

Converts a QuadMesh into a TriMesh.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.raster. RGB ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.element.raster.Image

RGB represents a regularly spaced 2D grid of an underlying continuous space of RGB(A) (red, green, blue and alpha) color space values. The definition of the grid closely matches the semantics of an Image and in the simplest case the grid may be specified as a NxMx3 or NxMx4 array of values along with a bounds, but it may also be defined through explicit and regularly spaced x/y-coordinate arrays. The two most basic supported constructors of an RGB element therefore include:

RGB((X, Y, R, G, B))

where X is a 1D array of shape M, Y is a 1D array of shape N and R/G/B are 2D array of shape NxM, or equivalently:

RGB(Z, bounds=(x0, y0, x1, y1))

where Z is a 3D array of stacked R/G/B arrays with shape NxMx3/4 and the bounds define the (left, bottom, top, right) edges of the four corners of the grid. Other gridded formats which support declaring of explicit x/y-coordinate arrays such as xarray are also supported.

Note that the interpretation of the orientation changes depending on whether bounds or explicit coordinates are used.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=RGB, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The label of the x- and y-dimension of the Raster in the form of a string or dimension object.
param List vdims ( allow_None=False, bounds=(3, 4), constant=False, default=[Dimension(‘R’), Dimension(‘G’), Dimension(‘B’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The dimension description of the data held in the matrix. If an alpha channel is supplied, the defined alpha_dimension is automatically appended to this list.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘grid’, ‘xarray’, ‘image’, ‘cube’, ‘dataframe’, ‘dictionary’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
param ClassSelector bounds ( allow_None=False, constant=False, default=BoundingBox(radius=0.5), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The bounding region in sheet coordinates containing the data.
param Number rtol ( allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The tolerance used to enforce regular sampling for regular, gridded data where regular sampling is expected. Expressed as the maximal allowable sampling difference between sample locations.
param ClassSelector alpha_dimension ( allow_None=False, constant=False, default=A, instantiate=False, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The alpha dimension definition to add the value dimensions if an alpha channel is supplied.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Returns a clone of the object with matching parameter values containing the specified args and kwargs.

If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.

closest ( coords=[] , **kwargs )

Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates.

closest_cell_center ( x , y )

Given arbitrary sheet coordinates, return the sheet coordinates of the center of the closest unit.

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.RGB'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.RGB'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.RGB'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.RGB'>)
classmethod load_image ( filename , height=1 , array=False , bounds=None , bare=False , **kwargs ) [source]

Returns an raster element or raw numpy array from a PNG image file, using matplotlib.

The specified height determines the bounds of the raster object in sheet coordinates: by default the height is 1 unit with the width scaled appropriately by the image aspect ratio.

Note that as PNG images are encoded as RGBA, the red component maps to the first channel, the green component maps to the second component etc. For RGB elements, this mapping is trivial but may be important for subclasses e.g. for HSV elements.

Setting bare=True will apply options disabling axis labels displaying just the bare image. Any additional keyword arguments will be passed to the Image object.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
matrix2sheet ( float_row , float_col )

Convert a floating-point location (float_row,float_col) in matrix coordinates to its corresponding location (x,y) in sheet coordinates.

Valid for scalar or array float_row and float_col.

Inverse of sheet2matrix().

matrixidx2sheet ( row , col )

Return (x,y) where x and y are the floating point coordinates of the center of the given matrix cell (row,col). If the matrix cell represents a 0.2 by 0.2 region, then the center location returned would be 0.1,0.1.

NOTE: This is NOT the strict mathematical inverse of sheet2matrixidx(), because sheet2matrixidx() discards all but the integer portion of the continuous matrix coordinate.

Valid only for scalar or array row and col.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
rgb

Returns the corresponding RGB element.

Other than the updating parameter definitions, this is the only change needed to implemented an arbitrary colorspace as a subclass of RGB.

sample ( samples=[] , **kwargs )

Allows sampling of an Image as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. On an Image the coordinates are continuously indexed and will always snap to the nearest coordinate.

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.RGB'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.RGB'>)
shape

Returns the shape of the data.

sheet2matrix ( x , y )

Convert a point (x,y) in Sheet coordinates to continuous matrix coordinates.

Returns (float_row,float_col), where float_row corresponds to y, and float_col to x.

Valid for scalar or array x and y.

Note about Bounds For a Sheet with BoundingBox(points=((-0.5,-0.5),(0.5,0.5))) and density=3, x=-0.5 corresponds to float_col=0.0 and x=0.5 corresponds to float_col=3.0. float_col=3.0 is not inside the matrix representing this Sheet, which has the three columns (0,1,2). That is, x=-0.5 is inside the BoundingBox but x=0.5 is outside. Similarly, y=0.5 is inside (at row 0) but y=-0.5 is outside (at row 3) (it’s the other way round for y because the matrix row index increases as y decreases).

sheet2matrixidx ( x , y )

Convert a point (x,y) in sheet coordinates to the integer row and column index of the matrix cell in which that point falls, given a bounds and density. Returns (row,column).

Note that if coordinates along the right or bottom boundary are passed into this function, the returned matrix coordinate of the boundary will be just outside the matrix, because the right and bottom boundaries are exclusive.

Valid for scalar or array x and y.

sheetcoordinates_of_matrixidx ( )

Return x,y where x is a vector of sheet coordinates representing the x-center of each matrix cell, and y represents the corresponding y-center of the cell.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

xdensity

The spacing between elements in an underlying matrix representation, in the x direction.

ydensity

The spacing between elements in an underlying matrix representation, in the y direction.

class holoviews.element.raster. Raster ( data , kdims=None , vdims=None , extents=None , **params ) [source]

Bases: holoviews.core.element.Element2D

Raster is a basic 2D element type for presenting either numpy or dask arrays as two dimensional raster images.

Arrays with a shape of (N,M) are valid inputs for Raster whereas subclasses of Raster (e.g. RGB) may also accept 3D arrays containing channel information.

Raster does not support slicing like the Image or RGB subclasses and the extents are in matrix coordinates if not explicitly specified.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Raster, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The label of the x- and y-dimension of the Raster in form of a string or dimension object.
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The dimension description of the data held in the matrix.
param Tuple extents ( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
closest ( coords , **kwargs )

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
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]

The set of samples available along a particular dimension.

dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Raster'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Raster'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Raster'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Raster'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

reduce ( dimensions=None , function=None , **reduce_map ) [source]

Reduces the Raster using functions provided via the kwargs, where the keyword is the dimension to be reduced. Optionally a label_prefix can be provided to prepend to the result Element label.

relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , **sample_values ) [source]

Sample the Raster along one or both of its dimensions, returning a reduced dimensionality type, which is either a ItemTable, Curve or Scatter. If two dimension samples and a new_xaxis is provided the sample will be the value of the sampled unit indexed by the value in the new_xaxis tuple.

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Raster'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.raster.Raster'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring


tabular Module

Inheritance diagram of holoviews.element.tabular
class holoviews.element.tabular. ItemTable ( data , **params ) [source]

Bases: holoviews.core.element.Element

A tabular element type to allow convenient visualization of either a standard Python dictionary, an OrderedDict or a list of tuples (i.e. input suitable for an OrderedDict constructor). If an OrderedDict is used, the headings will be kept in the correct order. Tables store heterogeneous data with different labels.

Dimension objects are also accepted as keys, allowing dimensional information (e.g type and units) to be associated per heading.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=ItemTable, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, 0), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
ItemTables hold an index Dimension for each value they contain, i.e. they are equivalent to the keys.
param List vdims ( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘Default’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
ItemTables should have only index Dimensions.
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
cell_type ( row , col ) [source]

Returns the cell type given a row and column index. The common basic cell types are ‘data’ and ‘heading’.

clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
closest ( coords , **kwargs )

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.ItemTable'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.ItemTable'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.ItemTable'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.ItemTable'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

pprint_cell ( row , col ) [source]

Get the formatted cell value for the given row and column indices.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.ItemTable'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.ItemTable'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
values ( ) [source]

Deprecated method to access the ItemTable value dimension values.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.element.tabular. Table ( data , kdims=None , vdims=None , **kwargs ) [source]

Bases: holoviews.core.data.Dataset , holoviews.core.element.Tabular

Table is a Dataset type, which gets displayed in a tabular format and is convertible to most other Element types.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Table, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The group is used to describe the Table.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs )

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
cell_type ( row , col )

Type of the table cell, either ‘data’ or ‘heading’

Args:
row (int): Integer index of table row col (int): Integer index of table column
Returns:
Type of the table cell, either ‘data’ or ‘heading’
clone ( data=None , shared_data=True , new_type=None , *args , **overrides )

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs )

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

cols

Number of columns in table

columns ( dimensions=None )

Convert dimension values to a dictionary.

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

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

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

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, 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

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.Table'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

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

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.Table'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.Table'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.Table'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

pprint_cell ( row , col )

Formatted contents of table cell.

Args:
row (int): Integer index of table row col (int): Integer index of table column
Returns:
Formatted table cell contents
print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None )

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
rows

Number of rows in table (including header)

sample ( samples=[] , bounds=None , closest=True , **kwargs )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.Table'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.Table'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False )

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring


util Module

Inheritance diagram of holoviews.element.util
class holoviews.element.util. categorical_aggregate2d ( **params ) [source]

Bases: holoviews.core.operation.Operation

Generates a gridded Dataset of 2D aggregate arrays indexed by the first two dimensions of the passed Element, turning all remaining dimensions into value dimensions. The key dimensions of the gridded array are treated as categorical indices. Useful for data indexed by two independent categorical variables such as a table of population values indexed by country and year. Data that is indexed by continuous dimensions should be binned before aggregation. The aggregation will retain the global sorting order of both dimensions.

>> table = Table([(‘USA’, 2000, 282.2), (‘UK’, 2005, 58.89)],
kdims=[‘Country’, ‘Year’], vdims=[‘Population’])

>> categorical_aggregate2d(table) Dataset({‘Country’: [‘USA’, ‘UK’], ‘Year’: [2000, 2005],

‘Population’: [[ 282.2 , np.NaN], [np.NaN, 58.89]]},

kdims=[‘Country’, ‘Year’], vdims=[‘Population’])

param String group ( allow_None=False, basestring=<class ‘str’>, constant=False, default=Operation, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The group string used to identify the output of the Operation. By default this should match the operation name.
param ObjectSelector dynamic ( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=default, instantiate=False, names=None, objects=[‘default’, True, False], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the operation should be applied dynamically when a specific frame is requested, specified as a Boolean. If set to ‘default’ the mode will be determined based on the input type, i.e. if the data is a DynamicMap it will stay dynamic.
param ClassSelector input_ranges ( allow_None=True, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Ranges to be used for input normalization (if applicable) in a format appropriate for the Normalization.ranges parameter. By default, no normalization is applied. If key-wise normalization is required, a 2-tuple may be supplied where the first component is a Normalization.ranges list and the second component is Normalization.keys.
param Boolean link_inputs ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
If the operation is dynamic, whether or not linked streams should be transferred from the operation inputs for backends that support linked streams. For example if an operation is applied to a DynamicMap with an RangeXY, this switch determines whether the corresponding visualization should update this stream with range changes originating from the newly generated axes.
param List streams ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
List of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘xarray’, ‘grid’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The grid interface types to use when constructing the gridded Dataset.
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.util.categorical_aggregate2d'>)
get_overlay_bounds ( overlay )

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

get_overlay_label ( overlay , default_label='' )

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.util.categorical_aggregate2d'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.util.categorical_aggregate2d'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.util.categorical_aggregate2d'>)
instance = functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.element.util.categorical_aggregate2d'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix='\n ' , unknown_value='<?>' , qualify=False , separator='' )

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

process_element ( element , key , **params )

The process_element method allows a single element to be operated on given an externally supplied key.

script_repr ( imports=[] , prefix=' ' )

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

search ( element , pattern )

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.util.categorical_aggregate2d'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.util.categorical_aggregate2d'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

holoviews.element.util. circular_layout ( nodes ) [source]

Lay out nodes on a circle and add node index.

holoviews.element.util. compute_slice_bounds ( slices , scs , shape ) [source]

Given a 2D selection consisting of slices/coordinates, a SheetCoordinateSystem and the shape of the array returns a new BoundingBox representing the sliced region.

holoviews.element.util. connect_edges ( graph ) [source]

Given a Graph element containing abstract edges compute edge segments directly connecting the source and target nodes. This operation just uses internal HoloViews operations and will be a lot slower than the pandas equivalent.

holoviews.element.util. connect_edges_pd ( graph ) [source]

Given a Graph element containing abstract edges compute edge segments directly connecting the source and target nodes. This operation depends on pandas and is a lot faster than the pure NumPy equivalent.

holoviews.element.util. quadratic_bezier ( start , end , c0=(0 , 0) , c1=(0 , 0) , steps=50 ) [source]

Compute quadratic bezier spline given start and end coordinate and two control points.

holoviews.element.util. reduce_fn ( x ) [source]

Aggregation function to get the first non-zero value.

holoviews.element.util. split_path ( path ) [source]

Split a Path type containing a single NaN separated path into multiple subpaths.