holoviews.element Package


element Package

digraph inheritance144c62051f { fontsize=18; rankdir=LR; size="12.0, 12.0"; "holoviews.core.data.DataConversion" [URL="holoviews.core.data.html#holoviews.core.data.DataConversion",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="DataConversion is a very simple container object which can be"]; "holoviews.element.ElementConversion" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",tooltip="ElementConversion is a subclass of DataConversion providing"]; "holoviews.core.data.DataConversion" -> "holoviews.element.ElementConversion" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
class holoviews.element.VSpan(x1=None, x2=None, **params)[source]

Bases: holoviews.element.annotation.Annotation

Vertical span annotation at the given position.

group = param.String(default=’VSpan’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(2, 2), default=[Dimension(‘x’), Dimension(‘y’)])

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

vdims = param.List(bounds=(0, None), default=[])

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.

extents = param.Tuple(default=(None, None, None, None), length=4)

Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.

x1 = param.ClassSelector(class_=(<class ‘numbers.Number’>, <class ‘numpy.datetime64’>, <class ‘datetime.datetime’>, <class ‘datetime.date’>, <class ‘datetime.time’>, <class ‘pandas._libs.tslibs.timestamps.Timestamp’>, <class ‘pandas.core.dtypes.dtypes.DatetimeTZDtype’>, <class ‘pandas._libs.tslibs.period.Period’>, <class ‘cftime._cftime.datetime’>), default=0)

The start x-position of the VSpan which must be numeric or a timestamp.

x2 = param.ClassSelector(class_=(<class ‘numbers.Number’>, <class ‘numpy.datetime64’>, <class ‘datetime.datetime’>, <class ‘datetime.date’>, <class ‘datetime.time’>, <class ‘pandas._libs.tslibs.timestamps.Timestamp’>, <class ‘pandas.core.dtypes.dtypes.DatetimeTZDtype’>, <class ‘pandas._libs.tslibs.period.Period’>, <class ‘cftime._cftime.datetime’>), default=0)

The end x-position of the VSpan which must 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

clone(*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

classmethod collapse_data(data, function=None, kdims=None, **kwargs)

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

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**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.VSpan'>)
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.VSpan'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.VSpan'>)
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.VSpan'>)
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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.VSpan'>)
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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**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

classmethod 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.VSpan'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.VSpan'>)
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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**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.

group = param.String(default=’Text’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(2, 2), default=[Dimension(‘x’), Dimension(‘y’)])

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

vdims = param.List(bounds=(0, None), default=[])

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.

extents = param.Tuple(default=(None, None, None, None), length=4)

Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.

x = param.ClassSelector(class_=(<class ‘numbers.Number’>, <class ‘str’>, <class ‘numpy.datetime64’>, <class ‘datetime.datetime’>, <class ‘datetime.date’>, <class ‘datetime.time’>, <class ‘pandas._libs.tslibs.timestamps.Timestamp’>, <class ‘pandas.core.dtypes.dtypes.DatetimeTZDtype’>, <class ‘pandas._libs.tslibs.period.Period’>, <class ‘cftime._cftime.datetime’>), default=0)

The x-position of the arrow which make be numeric or a timestamp.

y = param.ClassSelector(class_=(<class ‘numbers.Number’>, <class ‘str’>, <class ‘numpy.datetime64’>, <class ‘datetime.datetime’>, <class ‘datetime.date’>, <class ‘datetime.time’>, <class ‘pandas._libs.tslibs.timestamps.Timestamp’>, <class ‘pandas.core.dtypes.dtypes.DatetimeTZDtype’>, <class ‘pandas._libs.tslibs.period.Period’>, <class ‘cftime._cftime.datetime’>), default=0)

The y-position of the arrow which make be numeric or a timestamp.

text = param.String(default=’’)

The text to be displayed.

fontsize = param.Number(default=12, inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Font size of the text.

rotation = param.Number(default=0, inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Text rotation angle in degrees.

halign = param.ObjectSelector(default=’center’, objects=[‘left’, ‘right’, ‘center’])

The horizontal alignment position of the displayed text. Allowed values are ‘left’, ‘right’ and ‘center’.

valign = param.ObjectSelector(default=’center’, objects=[‘top’, ‘bottom’, ‘center’])

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

clone(*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

classmethod collapse_data(data, function=None, kdims=None, **kwargs)

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

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Text'>)
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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**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

classmethod 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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**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.

group = param.String(default=’Scatter3D’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(0, None), default=[Dimension(‘x’), Dimension(‘y’), Dimension(‘z’)])

The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.

vdims = param.List(bounds=(0, None), default=[])

Scatter3D can have optional value dimensions, which may be mapped onto color and size.

extents = param.Tuple(default=(None, None, None, None, None, None), length=6)

Allows overriding the extents of the Element in 3D space defined as (xmin, ymin, zmin, xmax, ymax, zmax).

datatype = param.List(bounds=(0, None), default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘spatialpandas’, ‘xarray’, ‘cuDF’, ‘dask’, ‘array’, ‘multitabular’])

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(**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 or 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(**kwargs)

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function or dim_transform specified as a tuple of the transformed dimension name and dim transform.

Args:
dimensions: Dimension(s) to aggregate on

Default to all key dimensions

function: Aggregation function or transform to apply

Supports both simple functions and dimension transforms

spreadfn: Secondary reduction to compute value spread

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

**kwargs: Keyword arguments either passed to the aggregation function

or to create new names for the transformed variables

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, 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(**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

classmethod collapse_data(data, function=None, kdims=None, **kwargs)

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

columns(**kwargs)

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

property dataset

The Dataset that this object was created from

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

dframe(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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

property 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(**kwargs)

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(**kwargs)

Inspect .param.message method for the full docstring

property 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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.Scatter3D'>)
property pipeline

Chain operation that evaluates the sequence of operations that was used to create this object, starting with the Dataset stored in dataset property

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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

range(**kwargs)

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(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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(**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])

  • predicate expression: A holoviews.dim expression, e.g.:

    from holoviews import dim ds.select(selection_expr=dim(‘x’) % 2 == 0)

Args:
selection_expr: holoviews.dim predicate expression

specifying selection.

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

classmethod 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'>)
property shape

Returns the shape of the data.

sort(**kwargs)

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.

property to

Returns the conversion interface with methods to convert Dataset

transform(**kwargs)

Transforms the Dataset according to a dimension transform.

Transforms may be supplied as tuples consisting of the dimension(s) and the dim transform to apply or keyword arguments mapping from dimension(s) to dim transforms. If the arg or kwarg declares multiple dimensions the dim transform should return a tuple of values for each.

A transform may override an existing dimension or add a new one in which case it will be added as an additional value dimension.

Args:
args: Specify the output arguments and transforms as a

tuple of dimension specs and dim transforms

drop (bool): Whether to drop all variables not part of the transform keep_index (bool): Whether to keep indexes

Whether to apply transform on datastructure with index, e.g. pandas.Series or xarray.DataArray, (important for dask datastructures where index may be required to align datasets).

kwargs: Specify new dimensions in the form new_dim=dim_transform

Returns:

Transformed dataset with new dimensions

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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**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.

group = param.String(default=’Div’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(0, None), default=[])

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

vdims = param.List(bounds=(0, None), default=[])

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

classmethod collapse_data(data, function=None, kdims=None, **kwargs)

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

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Div'>)
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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**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

classmethod 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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**kwargs)

Inspect .param.warning method for the full docstring

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

Bases: holoviews.element.selection.SelectionGeomExpr, holoviews.element.geom.Geometry

Segments represent a collection of lines in 2D space.

group = param.String(default=’Segments’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(4, 4), default=[Dimension(‘x0’), Dimension(‘y0’), Dimension(‘x1’), Dimension(‘y1’)])

Segments represent lines given by x- and y- coordinates in 2D space.

vdims = param.List(bounds=(0, None), default=[])

Value dimensions can be associated with a geometry.

extents = param.Tuple(default=(None, None, None, None), length=4)

Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.

datatype = param.List(bounds=(0, None), default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘spatialpandas’, ‘xarray’, ‘cuDF’, ‘dask’, ‘array’, ‘multitabular’])

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(**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 or 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(**kwargs)

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function or dim_transform specified as a tuple of the transformed dimension name and dim transform.

Args:
dimensions: Dimension(s) to aggregate on

Default to all key dimensions

function: Aggregation function or transform to apply

Supports both simple functions and dimension transforms

spreadfn: Secondary reduction to compute value spread

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

**kwargs: Keyword arguments either passed to the aggregation function

or to create new names for the transformed variables

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, 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(**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

classmethod collapse_data(data, function=None, kdims=None, **kwargs)

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

columns(**kwargs)

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

property dataset

The Dataset that this object was created from

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

dframe(**kwargs)

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(**kwargs)

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.Segments'>)
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(**kwargs)

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.Segments'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.geom.Segments'>)
groupby(**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

property 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.Segments'>)
map(**kwargs)

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(**kwargs)

Inspect .param.message method for the full docstring

property 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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.geom.Segments'>)
property pipeline

Chain operation that evaluates the sequence of operations that was used to create this object, starting with the Dataset stored in dataset property

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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

range(**kwargs)

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(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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(**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])

  • predicate expression: A holoviews.dim expression, e.g.:

    from holoviews import dim ds.select(selection_expr=dim(‘x’) % 2 == 0)

Args:
selection_expr: holoviews.dim predicate expression

specifying selection.

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

classmethod 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.Segments'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.geom.Segments'>)
property shape

Returns the shape of the data.

sort(**kwargs)

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.

property to

Returns the conversion interface with methods to convert Dataset

transform(**kwargs)

Transforms the Dataset according to a dimension transform.

Transforms may be supplied as tuples consisting of the dimension(s) and the dim transform to apply or keyword arguments mapping from dimension(s) to dim transforms. If the arg or kwarg declares multiple dimensions the dim transform should return a tuple of values for each.

A transform may override an existing dimension or add a new one in which case it will be added as an additional value dimension.

Args:
args: Specify the output arguments and transforms as a

tuple of dimension specs and dim transforms

drop (bool): Whether to drop all variables not part of the transform keep_index (bool): Whether to keep indexes

Whether to apply transform on datastructure with index, e.g. pandas.Series or xarray.DataArray, (important for dask datastructures where index may be required to align datasets).

kwargs: Specify new dimensions in the form new_dim=dim_transform

Returns:

Transformed dataset with new dimensions

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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**kwargs)

Inspect .param.warning method for the full docstring

class holoviews.element.HSpan(y1=None, y2=None, **params)[source]

Bases: holoviews.element.annotation.Annotation

Horziontal span annotation at the given position.

group = param.String(default=’HSpan’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(2, 2), default=[Dimension(‘x’), Dimension(‘y’)])

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

vdims = param.List(bounds=(0, None), default=[])

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.

extents = param.Tuple(default=(None, None, None, None), length=4)

Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.

y1 = param.ClassSelector(class_=(<class ‘numbers.Number’>, <class ‘numpy.datetime64’>, <class ‘datetime.datetime’>, <class ‘datetime.date’>, <class ‘datetime.time’>, <class ‘pandas._libs.tslibs.timestamps.Timestamp’>, <class ‘pandas.core.dtypes.dtypes.DatetimeTZDtype’>, <class ‘pandas._libs.tslibs.period.Period’>, <class ‘cftime._cftime.datetime’>), default=0)

The start y-position of the VSpan which must be numeric or a timestamp.

y2 = param.ClassSelector(class_=(<class ‘numbers.Number’>, <class ‘numpy.datetime64’>, <class ‘datetime.datetime’>, <class ‘datetime.date’>, <class ‘datetime.time’>, <class ‘pandas._libs.tslibs.timestamps.Timestamp’>, <class ‘pandas.core.dtypes.dtypes.DatetimeTZDtype’>, <class ‘pandas._libs.tslibs.period.Period’>, <class ‘cftime._cftime.datetime’>), default=0)

The end y-position of the VSpan which must 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

clone(*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

classmethod collapse_data(data, function=None, kdims=None, **kwargs)

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

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**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.HSpan'>)
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.HSpan'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.HSpan'>)
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.HSpan'>)
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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.HSpan'>)
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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**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

classmethod 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.HSpan'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.HSpan'>)
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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**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.

group = param.String(default=’Polygons’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(2, 2), default=[Dimension(‘x’), Dimension(‘y’)])

The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.

vdims = param.List(bounds=(0, None), default=[])

Polygons optionally accept a value dimension, corresponding to the supplied value.

extents = param.Tuple(default=(None, None, None, None), length=4)

Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.

datatype = param.ObjectSelector(default=[‘multitabular’, ‘spatialpandas’], objects=[])

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).

level = param.Number(inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Optional level associated with the set of Contours.

add_dimension(**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 or 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(**kwargs)

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function or dim_transform specified as a tuple of the transformed dimension name and dim transform.

Args:
dimensions: Dimension(s) to aggregate on

Default to all key dimensions

function: Aggregation function or transform to apply

Supports both simple functions and dimension transforms

spreadfn: Secondary reduction to compute value spread

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

**kwargs: Keyword arguments either passed to the aggregation function

or to create new names for the transformed variables

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, 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(**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

classmethod collapse_data(data_list, function=None, kdims=None, **kwargs)

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

columns(**kwargs)

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

property dataset

The Dataset that this object was created from

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

dframe(**kwargs)

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(**kwargs)

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(**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.

property 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(**kwargs)

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

property 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(**kwargs)

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(**kwargs)

Inspect .param.message method for the full docstring

property 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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Polygons'>)
property pipeline

Chain operation that evaluates the sequence of operations that was used to create this object, starting with the Dataset stored in dataset property

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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

range(**kwargs)

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(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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(**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])

  • predicate expression: A holoviews.dim expression, e.g.:

    from holoviews import dim ds.select(selection_expr=dim(‘x’) % 2 == 0)

Args:
selection_expr: holoviews.dim predicate expression

specifying selection.

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

classmethod 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'>)
property shape

Returns the shape of the data.

sort(**kwargs)

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(**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.

property to

Returns the conversion interface with methods to convert Dataset

transform(**kwargs)

Transforms the Dataset according to a dimension transform.

Transforms may be supplied as tuples consisting of the dimension(s) and the dim transform to apply or keyword arguments mapping from dimension(s) to dim transforms. If the arg or kwarg declares multiple dimensions the dim transform should return a tuple of values for each.

A transform may override an existing dimension or add a new one in which case it will be added as an additional value dimension.

Args:
args: Specify the output arguments and transforms as a

tuple of dimension specs and dim transforms

drop (bool): Whether to drop all variables not part of the transform keep_index (bool): Whether to keep indexes

Whether to apply transform on datastructure with index, e.g. pandas.Series or xarray.DataArray, (important for dask datastructures where index may be required to align datasets).

kwargs: Specify new dimensions in the form new_dim=dim_transform

Returns:

Transformed dataset with new dimensions

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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**kwargs)

Inspect .param.warning method for the full docstring

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.

group = param.String(default=’Labels’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(2, 2), default=[Dimension(‘x’), Dimension(‘y’)])

The label of the x- and y-dimension of the Labels element in form of a string or dimension object.

vdims = param.List(bounds=(1, None), default=[Dimension(‘Label’)])

Defines the value dimension corresponding to the label text.

extents = param.Tuple(default=(None, None, None, None), length=4)

Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.

datatype = param.List(bounds=(0, None), default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘spatialpandas’, ‘xarray’, ‘cuDF’, ‘dask’, ‘array’, ‘multitabular’])

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(**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 or 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(**kwargs)

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function or dim_transform specified as a tuple of the transformed dimension name and dim transform.

Args:
dimensions: Dimension(s) to aggregate on

Default to all key dimensions

function: Aggregation function or transform to apply

Supports both simple functions and dimension transforms

spreadfn: Secondary reduction to compute value spread

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

**kwargs: Keyword arguments either passed to the aggregation function

or to create new names for the transformed variables

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, 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(**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

classmethod collapse_data(data, function=None, kdims=None, **kwargs)

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

columns(**kwargs)

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

property dataset

The Dataset that this object was created from

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

dframe(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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

property 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(**kwargs)

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(**kwargs)

Inspect .param.message method for the full docstring

property 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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Labels'>)
property pipeline

Chain operation that evaluates the sequence of operations that was used to create this object, starting with the Dataset stored in dataset property

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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

range(**kwargs)

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(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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(**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])

  • predicate expression: A holoviews.dim expression, e.g.:

    from holoviews import dim ds.select(selection_expr=dim(‘x’) % 2 == 0)

Args:
selection_expr: holoviews.dim predicate expression

specifying selection.

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

classmethod 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'>)
property shape

Returns the shape of the data.

sort(**kwargs)

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.

property to

Returns the conversion interface with methods to convert Dataset

transform(**kwargs)

Transforms the Dataset according to a dimension transform.

Transforms may be supplied as tuples consisting of the dimension(s) and the dim transform to apply or keyword arguments mapping from dimension(s) to dim transforms. If the arg or kwarg declares multiple dimensions the dim transform should return a tuple of values for each.

A transform may override an existing dimension or add a new one in which case it will be added as an additional value dimension.

Args:
args: Specify the output arguments and transforms as a

tuple of dimension specs and dim transforms

drop (bool): Whether to drop all variables not part of the transform keep_index (bool): Whether to keep indexes

Whether to apply transform on datastructure with index, e.g. pandas.Series or xarray.DataArray, (important for dask datastructures where index may be required to align datasets).

kwargs: Specify new dimensions in the form new_dim=dim_transform

Returns:

Transformed dataset with new dimensions

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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**kwargs)

Inspect .param.warning method for the full docstring

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

Bases: holoviews.element.selection.SelectionIndexExpr, 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.

group = param.String(default=’Contours’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(2, 2), default=[Dimension(‘x’), Dimension(‘y’)])

The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.

vdims = param.List(bounds=(0, None), default=[])

Contours optionally accept a value dimension, corresponding to the supplied values.

extents = param.Tuple(default=(None, None, None, None), length=4)

Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.

datatype = param.ObjectSelector(default=[‘multitabular’, ‘spatialpandas’], objects=[])

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).

level = param.Number(inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

Optional level associated with the set of Contours.

add_dimension(**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 or 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(**kwargs)

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function or dim_transform specified as a tuple of the transformed dimension name and dim transform.

Args:
dimensions: Dimension(s) to aggregate on

Default to all key dimensions

function: Aggregation function or transform to apply

Supports both simple functions and dimension transforms

spreadfn: Secondary reduction to compute value spread

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

**kwargs: Keyword arguments either passed to the aggregation function

or to create new names for the transformed variables

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, 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(**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

classmethod collapse_data(data_list, function=None, kdims=None, **kwargs)

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

columns(**kwargs)

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

property dataset

The Dataset that this object was created from

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

dframe(**kwargs)

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(**kwargs)

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(**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

property 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(**kwargs)

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(**kwargs)

Inspect .param.message method for the full docstring

property 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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.path.Contours'>)
property pipeline

Chain operation that evaluates the sequence of operations that was used to create this object, starting with the Dataset stored in dataset property

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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

range(**kwargs)

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(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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(**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])

  • predicate expression: A holoviews.dim expression, e.g.:

    from holoviews import dim ds.select(selection_expr=dim(‘x’) % 2 == 0)

Args:
selection_expr: holoviews.dim predicate expression

specifying selection.

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

classmethod 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'>)
property shape

Returns the shape of the data.

sort(**kwargs)

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(**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.

property to

Returns the conversion interface with methods to convert Dataset

transform(**kwargs)

Transforms the Dataset according to a dimension transform.

Transforms may be supplied as tuples consisting of the dimension(s) and the dim transform to apply or keyword arguments mapping from dimension(s) to dim transforms. If the arg or kwarg declares multiple dimensions the dim transform should return a tuple of values for each.

A transform may override an existing dimension or add a new one in which case it will be added as an additional value dimension.

Args:
args: Specify the output arguments and transforms as a

tuple of dimension specs and dim transforms

drop (bool): Whether to drop all variables not part of the transform keep_index (bool): Whether to keep indexes

Whether to apply transform on datastructure with index, e.g. pandas.Series or xarray.DataArray, (important for dask datastructures where index may be required to align datasets).

kwargs: Specify new dimensions in the form new_dim=dim_transform

Returns:

Transformed dataset with new dimensions

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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**kwargs)

Inspect .param.warning method for the full docstring

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

Bases: holoviews.element.selection.Selection2DExpr, holoviews.element.geom.Geometry

A VectorField represents a set of vectors in 2D space 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.

group = param.String(default=’VectorField’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(2, 2), default=[Dimension(‘x’), Dimension(‘y’)])

The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.

vdims = param.List(bounds=(1, None), default=[Dimension(‘Angle’), Dimension(‘Magnitude’)])

Value dimensions can be associated with a geometry.

extents = param.Tuple(default=(None, None, None, None), length=4)

Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.

datatype = param.List(bounds=(0, None), default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘spatialpandas’, ‘xarray’, ‘cuDF’, ‘dask’, ‘array’, ‘multitabular’])

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(**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 or 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(**kwargs)

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function or dim_transform specified as a tuple of the transformed dimension name and dim transform.

Args:
dimensions: Dimension(s) to aggregate on

Default to all key dimensions

function: Aggregation function or transform to apply

Supports both simple functions and dimension transforms

spreadfn: Secondary reduction to compute value spread

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

**kwargs: Keyword arguments either passed to the aggregation function

or to create new names for the transformed variables

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, 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(**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

classmethod collapse_data(data, function=None, kdims=None, **kwargs)

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

columns(**kwargs)

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

property dataset

The Dataset that this object was created from

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

dframe(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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

property 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(**kwargs)

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(**kwargs)

Inspect .param.message method for the full docstring

property 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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.geom.VectorField'>)
property pipeline

Chain operation that evaluates the sequence of operations that was used to create this object, starting with the Dataset stored in dataset property

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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

range(**kwargs)

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(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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(**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])

  • predicate expression: A holoviews.dim expression, e.g.:

    from holoviews import dim ds.select(selection_expr=dim(‘x’) % 2 == 0)

Args:
selection_expr: holoviews.dim predicate expression

specifying selection.

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

classmethod 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'>)
property shape

Returns the shape of the data.

sort(**kwargs)

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.

property to

Returns the conversion interface with methods to convert Dataset

transform(**kwargs)

Transforms the Dataset according to a dimension transform.

Transforms may be supplied as tuples consisting of the dimension(s) and the dim transform to apply or keyword arguments mapping from dimension(s) to dim transforms. If the arg or kwarg declares multiple dimensions the dim transform should return a tuple of values for each.

A transform may override an existing dimension or add a new one in which case it will be added as an additional value dimension.

Args:
args: Specify the output arguments and transforms as a

tuple of dimension specs and dim transforms

drop (bool): Whether to drop all variables not part of the transform keep_index (bool): Whether to keep indexes

Whether to apply transform on datastructure with index, e.g. pandas.Series or xarray.DataArray, (important for dask datastructures where index may be required to align datasets).

kwargs: Specify new dimensions in the form new_dim=dim_transform

Returns:

Transformed dataset with new dimensions

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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**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.

group = param.String(default=’Element’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(0, None), default=[])

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

vdims = param.List(bounds=(0, None), default=[])

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.

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Element'>)
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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**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

classmethod 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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**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.

group = param.String(default=’EdgePaths’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(2, 2), default=[Dimension(‘x’), Dimension(‘y’)])

The key dimensions of a geometry represent the x- and y- coordinates in a 2D space.

vdims = param.List(bounds=(0, None), default=[])

Value dimensions can be associated with a geometry.

extents = param.Tuple(default=(None, None, None, None), length=4)

Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.

datatype = param.ObjectSelector(default=[‘multitabular’, ‘spatialpandas’], objects=[])

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(**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 or 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(**kwargs)

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function or dim_transform specified as a tuple of the transformed dimension name and dim transform.

Args:
dimensions: Dimension(s) to aggregate on

Default to all key dimensions

function: Aggregation function or transform to apply

Supports both simple functions and dimension transforms

spreadfn: Secondary reduction to compute value spread

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

**kwargs: Keyword arguments either passed to the aggregation function

or to create new names for the transformed variables

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, 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(**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

classmethod collapse_data(data_list, function=None, kdims=None, **kwargs)

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

columns(**kwargs)

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

property dataset

The Dataset that this object was created from

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

dframe(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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

property 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(**kwargs)

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(**kwargs)

Inspect .param.message method for the full docstring

property 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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.graphs.EdgePaths'>)
property pipeline

Chain operation that evaluates the sequence of operations that was used to create this object, starting with the Dataset stored in dataset property

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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

range(**kwargs)

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(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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(**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])

  • predicate expression: A holoviews.dim expression, e.g.:

    from holoviews import dim ds.select(selection_expr=dim(‘x’) % 2 == 0)

Args:
selection_expr: holoviews.dim predicate expression

specifying selection.

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

classmethod 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'>)
property shape

Returns the shape of the data.

sort(**kwargs)

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(**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.

property to

Returns the conversion interface with methods to convert Dataset

transform(**kwargs)

Transforms the Dataset according to a dimension transform.

Transforms may be supplied as tuples consisting of the dimension(s) and the dim transform to apply or keyword arguments mapping from dimension(s) to dim transforms. If the arg or kwarg declares multiple dimensions the dim transform should return a tuple of values for each.

A transform may override an existing dimension or add a new one in which case it will be added as an additional value dimension.

Args:
args: Specify the output arguments and transforms as a

tuple of dimension specs and dim transforms

drop (bool): Whether to drop all variables not part of the transform keep_index (bool): Whether to keep indexes

Whether to apply transform on datastructure with index, e.g. pandas.Series or xarray.DataArray, (important for dask datastructures where index may be required to align datasets).

kwargs: Specify new dimensions in the form new_dim=dim_transform

Returns:

Transformed dataset with new dimensions

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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**kwargs)

Inspect .param.warning method for the full docstring

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

Bases: holoviews.element.selection.Selection1DExpr, 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.

group = param.String(default=’Spikes’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(1, 1), default=[Dimension(‘x’)])

The key dimension(s) of a Chart represent the independent variable(s).

vdims = param.List(bounds=(0, None), default=[])

The value dimensions of the Chart, usually corresponding to a number of dependent variables.

extents = param.Tuple(default=(None, None, None, None), length=4)

Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.

datatype = param.List(bounds=(0, None), default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘spatialpandas’, ‘xarray’, ‘cuDF’, ‘dask’, ‘array’, ‘multitabular’])

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(**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 or 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(**kwargs)

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function or dim_transform specified as a tuple of the transformed dimension name and dim transform.

Args:
dimensions: Dimension(s) to aggregate on

Default to all key dimensions

function: Aggregation function or transform to apply

Supports both simple functions and dimension transforms

spreadfn: Secondary reduction to compute value spread

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

**kwargs: Keyword arguments either passed to the aggregation function

or to create new names for the transformed variables

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, 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(**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

classmethod collapse_data(data, function=None, kdims=None, **kwargs)

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

columns(**kwargs)

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

property dataset

The Dataset that this object was created from

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

dframe(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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

property 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(**kwargs)

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(**kwargs)

Inspect .param.message method for the full docstring

property 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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Spikes'>)
property pipeline

Chain operation that evaluates the sequence of operations that was used to create this object, starting with the Dataset stored in dataset property

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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

range(**kwargs)

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(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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(**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])

  • predicate expression: A holoviews.dim expression, e.g.:

    from holoviews import dim ds.select(selection_expr=dim(‘x’) % 2 == 0)

Args:
selection_expr: holoviews.dim predicate expression

specifying selection.

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

classmethod 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'>)
property shape

Returns the shape of the data.

sort(**kwargs)

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.

property to

Returns the conversion interface with methods to convert Dataset

transform(**kwargs)

Transforms the Dataset according to a dimension transform.

Transforms may be supplied as tuples consisting of the dimension(s) and the dim transform to apply or keyword arguments mapping from dimension(s) to dim transforms. If the arg or kwarg declares multiple dimensions the dim transform should return a tuple of values for each.

A transform may override an existing dimension or add a new one in which case it will be added as an additional value dimension.

Args:
args: Specify the output arguments and transforms as a

tuple of dimension specs and dim transforms

drop (bool): Whether to drop all variables not part of the transform keep_index (bool): Whether to keep indexes

Whether to apply transform on datastructure with index, e.g. pandas.Series or xarray.DataArray, (important for dask datastructures where index may be required to align datasets).

kwargs: Specify new dimensions in the form new_dim=dim_transform

Returns:

Transformed dataset with new dimensions

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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**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.

group = param.String(default=’Histogram’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(1, 1), default=[Dimension(‘x’)])

Dimensions on Element2Ds determine the number of indexable dimensions.

vdims = param.List(bounds=(1, None), default=[Dimension(‘Frequency’)])

The value dimensions of the Chart, usually corresponding to a number of dependent variables.

extents = param.Tuple(default=(None, None, None, None), length=4)

Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.

datatype = param.List(bounds=(0, None), default=[‘grid’])

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(**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 or 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(**kwargs)

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function or dim_transform specified as a tuple of the transformed dimension name and dim transform.

Args:
dimensions: Dimension(s) to aggregate on

Default to all key dimensions

function: Aggregation function or transform to apply

Supports both simple functions and dimension transforms

spreadfn: Secondary reduction to compute value spread

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

**kwargs: Keyword arguments either passed to the aggregation function

or to create new names for the transformed variables

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, 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(**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

classmethod collapse_data(data, function=None, kdims=None, **kwargs)

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

columns(**kwargs)

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

property dataset

The Dataset that this object was created from

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

dframe(**kwargs)

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(**kwargs)

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

property 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(**kwargs)

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(**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

property 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(**kwargs)

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(**kwargs)

Inspect .param.message method for the full docstring

property 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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Histogram'>)
property pipeline

Chain operation that evaluates the sequence of operations that was used to create this object, starting with the Dataset stored in dataset property

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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

range(**kwargs)

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(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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(**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])

  • predicate expression: A holoviews.dim expression, e.g.:

    from holoviews import dim ds.select(selection_expr=dim(‘x’) % 2 == 0)

Args:
selection_expr: holoviews.dim predicate expression

specifying selection.

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

classmethod 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'>)
property shape

Returns the shape of the data.

sort(**kwargs)

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.

property to

Returns the conversion interface with methods to convert Dataset

transform(**kwargs)

Transforms the Dataset according to a dimension transform.

Transforms may be supplied as tuples consisting of the dimension(s) and the dim transform to apply or keyword arguments mapping from dimension(s) to dim transforms. If the arg or kwarg declares multiple dimensions the dim transform should return a tuple of values for each.

A transform may override an existing dimension or add a new one in which case it will be added as an additional value dimension.

Args:
args: Specify the output arguments and transforms as a

tuple of dimension specs and dim transforms

drop (bool): Whether to drop all variables not part of the transform keep_index (bool): Whether to keep indexes

Whether to apply transform on datastructure with index, e.g. pandas.Series or xarray.DataArray, (important for dask datastructures where index may be required to align datasets).

kwargs: Specify new dimensions in the form new_dim=dim_transform

Returns:

Transformed dataset with new dimensions

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

property values

Property to access the Histogram values provided for backward compatibility

verbose(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**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

group = param.String(default=’Spline’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(2, 2), default=[Dimension(‘x’), Dimension(‘y’)])

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

vdims = param.List(bounds=(0, None), default=[])

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.

extents = param.Tuple(default=(None, None, None, None), length=4)

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

classmethod collapse_data(data, function=None, kdims=None, **kwargs)

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

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Spline'>)
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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**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

classmethod 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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**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.

group = param.String(default=’Violin’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(0, None), default=[])

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

vdims = param.List(bounds=(1, 1), default=[Dimension(‘y’)])

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.

extents = param.Tuple(default=(None, None, None, None), length=4)

Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.

datatype = param.List(bounds=(0, None), default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘spatialpandas’, ‘xarray’, ‘cuDF’, ‘dask’, ‘array’, ‘multitabular’])

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(**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 or 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(**kwargs)

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function or dim_transform specified as a tuple of the transformed dimension name and dim transform.

Args:
dimensions: Dimension(s) to aggregate on

Default to all key dimensions

function: Aggregation function or transform to apply

Supports both simple functions and dimension transforms

spreadfn: Secondary reduction to compute value spread

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

**kwargs: Keyword arguments either passed to the aggregation function

or to create new names for the transformed variables

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, 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(**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

classmethod collapse_data(data, function=None, kdims=None, **kwargs)

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

columns(**kwargs)

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

property dataset

The Dataset that this object was created from

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

dframe(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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

property 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(**kwargs)

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(**kwargs)

Inspect .param.message method for the full docstring

property 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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.Violin'>)
property pipeline

Chain operation that evaluates the sequence of operations that was used to create this object, starting with the Dataset stored in dataset property

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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

range(**kwargs)

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(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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(**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])

  • predicate expression: A holoviews.dim expression, e.g.:

    from holoviews import dim ds.select(selection_expr=dim(‘x’) % 2 == 0)

Args:
selection_expr: holoviews.dim predicate expression

specifying selection.

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

classmethod 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'>)
property shape

Returns the shape of the data.

sort(**kwargs)

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.

property to

Returns the conversion interface with methods to convert Dataset

transform(**kwargs)

Transforms the Dataset according to a dimension transform.

Transforms may be supplied as tuples consisting of the dimension(s) and the dim transform to apply or keyword arguments mapping from dimension(s) to dim transforms. If the arg or kwarg declares multiple dimensions the dim transform should return a tuple of values for each.

A transform may override an existing dimension or add a new one in which case it will be added as an additional value dimension.

Args:
args: Specify the output arguments and transforms as a

tuple of dimension specs and dim transforms

drop (bool): Whether to drop all variables not part of the transform keep_index (bool): Whether to keep indexes

Whether to apply transform on datastructure with index, e.g. pandas.Series or xarray.DataArray, (important for dask datastructures where index may be required to align datasets).

kwargs: Specify new dimensions in the form new_dim=dim_transform

Returns:

Transformed dataset with new dimensions

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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**kwargs)

Inspect .param.warning method for the full docstring

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

Bases: holoviews.element.selection.Selection2DExpr, 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.

group = param.String(default=’Bivariate’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(2, 2), default=[Dimension(‘x’), Dimension(‘y’)])

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

vdims = param.List(bounds=(0, 1), default=[Dimension(‘Density’)])

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.

extents = param.Tuple(default=(None, None, None, None), length=4)

Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.

datatype = param.List(bounds=(0, None), default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘spatialpandas’, ‘xarray’, ‘cuDF’, ‘dask’, ‘array’, ‘multitabular’])

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(**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 or 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(**kwargs)

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function or dim_transform specified as a tuple of the transformed dimension name and dim transform.

Args:
dimensions: Dimension(s) to aggregate on

Default to all key dimensions

function: Aggregation function or transform to apply

Supports both simple functions and dimension transforms

spreadfn: Secondary reduction to compute value spread

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

**kwargs: Keyword arguments either passed to the aggregation function

or to create new names for the transformed variables

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, 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(**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

classmethod collapse_data(data, function=None, kdims=None, **kwargs)

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

columns(**kwargs)

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

property dataset

The Dataset that this object was created from

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

dframe(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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

property 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(**kwargs)

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(**kwargs)

Inspect .param.message method for the full docstring

property 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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.Bivariate'>)
property pipeline

Chain operation that evaluates the sequence of operations that was used to create this object, starting with the Dataset stored in dataset property

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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

range(**kwargs)

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(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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(**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])

  • predicate expression: A holoviews.dim expression, e.g.:

    from holoviews import dim ds.select(selection_expr=dim(‘x’) % 2 == 0)

Args:
selection_expr: holoviews.dim predicate expression

specifying selection.

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

classmethod 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'>)
property shape

Returns the shape of the data.

sort(**kwargs)

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.

property to

Returns the conversion interface with methods to convert Dataset

transform(**kwargs)

Transforms the Dataset according to a dimension transform.

Transforms may be supplied as tuples consisting of the dimension(s) and the dim transform to apply or keyword arguments mapping from dimension(s) to dim transforms. If the arg or kwarg declares multiple dimensions the dim transform should return a tuple of values for each.

A transform may override an existing dimension or add a new one in which case it will be added as an additional value dimension.

Args:
args: Specify the output arguments and transforms as a

tuple of dimension specs and dim transforms

drop (bool): Whether to drop all variables not part of the transform keep_index (bool): Whether to keep indexes

Whether to apply transform on datastructure with index, e.g. pandas.Series or xarray.DataArray, (important for dask datastructures where index may be required to align datasets).

kwargs: Specify new dimensions in the form new_dim=dim_transform

Returns:

Transformed dataset with new dimensions

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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**kwargs)

Inspect .param.warning method for the full docstring

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

Bases: holoviews.element.selection.SelectionIndexExpr, 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.

group = param.String(default=’Table’)

The group is used to describe the Table.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(0, None), default=[])

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

vdims = param.List(bounds=(0, None), default=[])

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.

datatype = param.List(bounds=(0, None), default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘spatialpandas’, ‘xarray’, ‘cuDF’, ‘dask’, ‘array’, ‘multitabular’])

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(**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 or 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(**kwargs)

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function or dim_transform specified as a tuple of the transformed dimension name and dim transform.

Args:
dimensions: Dimension(s) to aggregate on

Default to all key dimensions

function: Aggregation function or transform to apply

Supports both simple functions and dimension transforms

spreadfn: Secondary reduction to compute value spread

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

**kwargs: Keyword arguments either passed to the aggregation function

or to create new names for the transformed variables

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, 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(**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

classmethod collapse_data(data, function=None, kdims=None, **kwargs)

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

property cols

Number of columns in table

columns(**kwargs)

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

property dataset

The Dataset that this object was created from

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

dframe(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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

property 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(**kwargs)

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(**kwargs)

Inspect .param.message method for the full docstring

property 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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.tabular.Table'>)
property pipeline

Chain operation that evaluates the sequence of operations that was used to create this object, starting with the Dataset stored in dataset property

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

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

range(**kwargs)

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(**kwargs)

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(**kwargs)

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(**kwargs)

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

property rows

Number of rows in table (including header)

sample(**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(**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])

  • predicate expression: A holoviews.dim expression, e.g.:

    from holoviews import dim ds.select(selection_expr=dim(‘x’) % 2 == 0)

Args:
selection_expr: holoviews.dim predicate expression

specifying selection.

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

classmethod 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'>)
property shape

Returns the shape of the data.

sort(**kwargs)

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.

property to

Returns the conversion interface with methods to convert Dataset

transform(**kwargs)

Transforms the Dataset according to a dimension transform.

Transforms may be supplied as tuples consisting of the dimension(s) and the dim transform to apply or keyword arguments mapping from dimension(s) to dim transforms. If the arg or kwarg declares multiple dimensions the dim transform should return a tuple of values for each.

A transform may override an existing dimension or add a new one in which case it will be added as an additional value dimension.

Args:
args: Specify the output arguments and transforms as a

tuple of dimension specs and dim transforms

drop (bool): Whether to drop all variables not part of the transform keep_index (bool): Whether to keep indexes

Whether to apply transform on datastructure with index, e.g. pandas.Series or xarray.DataArray, (important for dask datastructures where index may be required to align datasets).

kwargs: Specify new dimensions in the form new_dim=dim_transform

Returns:

Transformed dataset with new dimensions

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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**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.

group = param.String(default=’TriSurface’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(0, None), default=[Dimension(‘x’), Dimension(‘y’), Dimension(‘z’)])

The key dimensions of a TriSurface represent the 3D coordinates of each point.

vdims = param.List(bounds=(0, None), default=[])

The value dimensions of a TriSurface can provide additional information about each 3D coordinate.

extents = param.Tuple(default=(None, None, None, None, None, None), length=6)

Allows overriding the extents of the Element in 3D space defined as (xmin, ymin, zmin, xmax, ymax, zmax).

datatype = param.List(bounds=(0, None), default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘spatialpandas’, ‘xarray’, ‘cuDF’, ‘dask’, ‘array’, ‘multitabular’])

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(**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 or 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(**kwargs)

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function or dim_transform specified as a tuple of the transformed dimension name and dim transform.

Args:
dimensions: Dimension(s) to aggregate on

Default to all key dimensions

function: Aggregation function or transform to apply

Supports both simple functions and dimension transforms

spreadfn: Secondary reduction to compute value spread

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

**kwargs: Keyword arguments either passed to the aggregation function

or to create new names for the transformed variables

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, 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(**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

classmethod collapse_data(data, function=None, kdims=None, **kwargs)

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

columns(**kwargs)

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

property dataset

The Dataset that this object was created from

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

dframe(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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

property 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(**kwargs)

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(**kwargs)

Inspect .param.message method for the full docstring

property 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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart3d.TriSurface'>)
property pipeline

Chain operation that evaluates the sequence of operations that was used to create this object, starting with the Dataset stored in dataset property

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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

range(**kwargs)

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(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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(**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])

  • predicate expression: A holoviews.dim expression, e.g.:

    from holoviews import dim ds.select(selection_expr=dim(‘x’) % 2 == 0)

Args:
selection_expr: holoviews.dim predicate expression

specifying selection.

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

classmethod 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'>)
property shape

Returns the shape of the data.

sort(**kwargs)

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.

property to

Returns the conversion interface with methods to convert Dataset

transform(**kwargs)

Transforms the Dataset according to a dimension transform.

Transforms may be supplied as tuples consisting of the dimension(s) and the dim transform to apply or keyword arguments mapping from dimension(s) to dim transforms. If the arg or kwarg declares multiple dimensions the dim transform should return a tuple of values for each.

A transform may override an existing dimension or add a new one in which case it will be added as an additional value dimension.

Args:
args: Specify the output arguments and transforms as a

tuple of dimension specs and dim transforms

drop (bool): Whether to drop all variables not part of the transform keep_index (bool): Whether to keep indexes

Whether to apply transform on datastructure with index, e.g. pandas.Series or xarray.DataArray, (important for dask datastructures where index may be required to align datasets).

kwargs: Specify new dimensions in the form new_dim=dim_transform

Returns:

Transformed dataset with new dimensions

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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**kwargs)

Inspect .param.warning method for the full docstring

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

Bases: holoviews.element.selection.Selection2DExpr, 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.

group = param.String(default=’HexTiles’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(2, 2), default=[Dimension(‘x’), Dimension(‘y’)])

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

vdims = param.List(bounds=(0, None), default=[])

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.

extents = param.Tuple(default=(None, None, None, None), length=4)

Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.

datatype = param.List(bounds=(0, None), default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘spatialpandas’, ‘xarray’, ‘cuDF’, ‘dask’, ‘array’, ‘multitabular’])

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(**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 or 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(**kwargs)

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function or dim_transform specified as a tuple of the transformed dimension name and dim transform.

Args:
dimensions: Dimension(s) to aggregate on

Default to all key dimensions

function: Aggregation function or transform to apply

Supports both simple functions and dimension transforms

spreadfn: Secondary reduction to compute value spread

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

**kwargs: Keyword arguments either passed to the aggregation function

or to create new names for the transformed variables

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, 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(**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

classmethod collapse_data(data, function=None, kdims=None, **kwargs)

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

columns(**kwargs)

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

property dataset

The Dataset that this object was created from

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

dframe(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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

property 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(**kwargs)

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(**kwargs)

Inspect .param.message method for the full docstring

property 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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.stats.HexTiles'>)
property pipeline

Chain operation that evaluates the sequence of operations that was used to create this object, starting with the Dataset stored in dataset property

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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

range(**kwargs)

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(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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(**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])

  • predicate expression: A holoviews.dim expression, e.g.:

    from holoviews import dim ds.select(selection_expr=dim(‘x’) % 2 == 0)

Args:
selection_expr: holoviews.dim predicate expression

specifying selection.

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

classmethod 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'>)
property shape

Returns the shape of the data.

sort(**kwargs)

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.

property to

Returns the conversion interface with methods to convert Dataset

transform(**kwargs)

Transforms the Dataset according to a dimension transform.

Transforms may be supplied as tuples consisting of the dimension(s) and the dim transform to apply or keyword arguments mapping from dimension(s) to dim transforms. If the arg or kwarg declares multiple dimensions the dim transform should return a tuple of values for each.

A transform may override an existing dimension or add a new one in which case it will be added as an additional value dimension.

Args:
args: Specify the output arguments and transforms as a

tuple of dimension specs and dim transforms

drop (bool): Whether to drop all variables not part of the transform keep_index (bool): Whether to keep indexes

Whether to apply transform on datastructure with index, e.g. pandas.Series or xarray.DataArray, (important for dask datastructures where index may be required to align datasets).

kwargs: Specify new dimensions in the form new_dim=dim_transform

Returns:

Transformed dataset with new dimensions

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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**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.

group = param.String(default=’HLine’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(2, 2), default=[Dimension(‘x’), Dimension(‘y’)])

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

vdims = param.List(bounds=(0, None), default=[])

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.

extents = param.Tuple(default=(None, None, None, None), length=4)

Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.

y = param.ClassSelector(class_=(<class ‘numbers.Number’>, <class ‘numpy.datetime64’>, <class ‘datetime.datetime’>, <class ‘datetime.date’>, <class ‘datetime.time’>, <class ‘pandas._libs.tslibs.timestamps.Timestamp’>, <class ‘pandas.core.dtypes.dtypes.DatetimeTZDtype’>, <class ‘pandas._libs.tslibs.period.Period’>, <class ‘cftime._cftime.datetime’>), default=0)

The y-position of the HLine 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

clone(*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

classmethod collapse_data(data, function=None, kdims=None, **kwargs)

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

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.HLine'>)
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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**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

classmethod 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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**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.

group = param.String(default=’Dataset’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(0, None), default=[])

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

vdims = param.List(bounds=(0, None), default=[])

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.

datatype = param.List(bounds=(0, None), default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘spatialpandas’, ‘xarray’, ‘cuDF’, ‘dask’, ‘array’, ‘multitabular’])

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(**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 or 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(**kwargs)[source]

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function or dim_transform specified as a tuple of the transformed dimension name and dim transform.

Args:
dimensions: Dimension(s) to aggregate on

Default to all key dimensions

function: Aggregation function or transform to apply

Supports both simple functions and dimension transforms

spreadfn: Secondary reduction to compute value spread

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

**kwargs: Keyword arguments either passed to the aggregation function

or to create new names for the transformed variables

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, link=True, *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 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(**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

classmethod collapse_data(data, function=None, kdims=None, **kwargs)

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

columns(**kwargs)[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

property dataset

The Dataset that this object was created from

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

dframe(**kwargs)[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(**kwargs)[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(**kwargs)[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(**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

property 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(**kwargs)[source]

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(**kwargs)

Inspect .param.message method for the full docstring

property 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(**kwargs)[source]

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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.Dataset'>)
property pipeline

Chain operation that evaluates the sequence of operations that was used to create this object, starting with the Dataset stored in dataset property

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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

range(**kwargs)[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(**kwargs)[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(**kwargs)[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(**kwargs)[source]

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(**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(**kwargs)[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])

  • predicate expression: A holoviews.dim expression, e.g.:

    from holoviews import dim ds.select(selection_expr=dim(‘x’) % 2 == 0)

Args:
selection_expr: holoviews.dim predicate expression

specifying selection.

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

classmethod 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'>)
property shape

Returns the shape of the data.

sort(**kwargs)[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.

property to

Returns the conversion interface with methods to convert Dataset

transform(**kwargs)[source]

Transforms the Dataset according to a dimension transform.

Transforms may be supplied as tuples consisting of the dimension(s) and the dim transform to apply or keyword arguments mapping from dimension(s) to dim transforms. If the arg or kwarg declares multiple dimensions the dim transform should return a tuple of values for each.

A transform may override an existing dimension or add a new one in which case it will be added as an additional value dimension.

Args:
args: Specify the output arguments and transforms as a

tuple of dimension specs and dim transforms

drop (bool): Whether to drop all variables not part of the transform keep_index (bool): Whether to keep indexes

Whether to apply transform on datastructure with index, e.g. pandas.Series or xarray.DataArray, (important for dask datastructures where index may be required to align datasets).

kwargs: Specify new dimensions in the form new_dim=dim_transform

Returns:

Transformed dataset with new dimensions

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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**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.

group = param.String(default=’Arrow’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(2, 2), default=[Dimension(‘x’), Dimension(‘y’)])

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

vdims = param.List(bounds=(0, None), default=[])

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.

extents = param.Tuple(default=(None, None, None, None), length=4)

Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.

x = param.ClassSelector(class_=(<class ‘numbers.Number’>, <class ‘numpy.datetime64’>, <class ‘datetime.datetime’>, <class ‘datetime.date’>, <class ‘datetime.time’>, <class ‘pandas._libs.tslibs.timestamps.Timestamp’>, <class ‘pandas.core.dtypes.dtypes.DatetimeTZDtype’>, <class ‘pandas._libs.tslibs.period.Period’>, <class ‘cftime._cftime.datetime’>), default=0)

The x-position of the arrow which make be numeric or a timestamp.

y = param.ClassSelector(class_=(<class ‘numbers.Number’>, <class ‘numpy.datetime64’>, <class ‘datetime.datetime’>, <class ‘datetime.date’>, <class ‘datetime.time’>, <class ‘pandas._libs.tslibs.timestamps.Timestamp’>, <class ‘pandas.core.dtypes.dtypes.DatetimeTZDtype’>, <class ‘pandas._libs.tslibs.period.Period’>, <class ‘cftime._cftime.datetime’>), default=0)

The y-position of the arrow which make be numeric or a timestamp.

text = param.String(default=’’)

Text associated with the arrow.

direction = param.ObjectSelector(default=’<’, objects=[‘<’, ‘^’, ‘>’, ‘v’])

The cardinal direction in which the arrow is pointing. Accepted arrow directions are ‘<’, ‘^’, ‘>’ and ‘v’.

arrowstyle = param.ObjectSelector(default=’->’, objects=[‘-‘, ‘->’, ‘-[‘, ‘-|>', '<->', '<|-|>’])

The arrowstyle used to draw the arrow. Accepted arrow styles are ‘-‘, ‘->’, ‘-[‘, ‘-|>', '<->' and '<|-|>’

points = param.Number(default=40, inclusive_bounds=(True, True), time_dependent=False, time_fn=Time(label=’Time’, name=’Time00001’, time_type=<class ‘int’>, timestep=1.0, unit=None, until=Infinity()))

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

clone(*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

classmethod collapse_data(data, function=None, kdims=None, **kwargs)

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

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.annotation.Arrow'>)
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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**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

classmethod 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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**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.

group = param.String(default=’Area’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(1, 2), default=[Dimension(‘x’)])

The key dimension(s) of a Chart represent the independent variable(s).

vdims = param.List(bounds=(1, None), default=[Dimension(‘y’)])

The value dimensions of the Chart, usually corresponding to a number of dependent variables.

extents = param.Tuple(default=(None, None, None, None), length=4)

Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.

datatype = param.List(bounds=(0, None), default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘spatialpandas’, ‘xarray’, ‘cuDF’, ‘dask’, ‘array’, ‘multitabular’])

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(**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 or 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(**kwargs)

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function or dim_transform specified as a tuple of the transformed dimension name and dim transform.

Args:
dimensions: Dimension(s) to aggregate on

Default to all key dimensions

function: Aggregation function or transform to apply

Supports both simple functions and dimension transforms

spreadfn: Secondary reduction to compute value spread

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

**kwargs: Keyword arguments either passed to the aggregation function

or to create new names for the transformed variables

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, 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(**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

classmethod collapse_data(data, function=None, kdims=None, **kwargs)

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

columns(**kwargs)

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

property dataset

The Dataset that this object was created from

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

dframe(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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

property 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(**kwargs)

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(**kwargs)

Inspect .param.message method for the full docstring

property 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(**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 = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.element.chart.Area'>)
property pipeline

Chain operation that evaluates the sequence of operations that was used to create this object, starting with the Dataset stored in dataset property

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.

classmethod print_param_defaults(*args, **kwargs)

Inspect .param.print_param_defaults method for the full docstring

print_param_values(**kwargs)

Inspect .param.print_param_values method for the full docstring

range(**kwargs)

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(**kwargs)

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(**kwargs)

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(**kwargs)

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(**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(**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])

  • predicate expression: A holoviews.dim expression, e.g.:

    from holoviews import dim ds.select(selection_expr=dim(‘x’) % 2 == 0)

Args:
selection_expr: holoviews.dim predicate expression

specifying selection.

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

classmethod 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'>)
property shape

Returns the shape of the data.

sort(**kwargs)

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.

property to

Returns the conversion interface with methods to convert Dataset

transform(**kwargs)

Transforms the Dataset according to a dimension transform.

Transforms may be supplied as tuples consisting of the dimension(s) and the dim transform to apply or keyword arguments mapping from dimension(s) to dim transforms. If the arg or kwarg declares multiple dimensions the dim transform should return a tuple of values for each.

A transform may override an existing dimension or add a new one in which case it will be added as an additional value dimension.

Args:
args: Specify the output arguments and transforms as a

tuple of dimension specs and dim transforms

drop (bool): Whether to drop all variables not part of the transform keep_index (bool): Whether to keep indexes

Whether to apply transform on datastructure with index, e.g. pandas.Series or xarray.DataArray, (important for dask datastructures where index may be required to align datasets).

kwargs: Specify new dimensions in the form new_dim=dim_transform

Returns:

Transformed dataset with new dimensions

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(**kwargs)

Inspect .param.verbose method for the full docstring

warning(**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.

group = param.String(default=’Graph’)

A string describing the data wrapped by the object.

label = param.String(default=’’)

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.

cdims = param.Dict(class_=<class ‘dict’>, default=OrderedDict())

The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.

kdims = param.List(bounds=(2, 2), default=[Dimension(‘start’), Dimension(‘end’)])

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

vdims = param.List(bounds=(0, None), default=[])

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.

extents = param.Tuple(default=(None, None, None, None), length=4)

Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.

datatype = param.List(bounds=(0, None), default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘spatialpandas’, ‘xarray’, ‘cuDF’, ‘dask’, ‘array’, ‘multitabular’])

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(**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 or 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(**kwargs)

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function or dim_transform specified as a tuple of the transformed dimension name and dim transform.

Args:
dimensions: Dimension(s) to aggregate on

Default to all key dimensions

function: Aggregation function or transform to apply

Supports both simple functions and dimension transforms

spreadfn: Secondary reduction to compute value spread

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

**kwargs: Keyword arguments either passed to the aggregation function

or to create new names for the transformed variables

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, link=True, *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 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(**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

classmethod collapse_data(data, function=None, kdims=None, **kwargs)

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

columns(**kwargs)

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

property dataset

The Dataset that this object was created from

property ddims

The list of deep dimensions

debug(**kwargs)

Inspect .param.debug method for the full docstring

defaults(**kwargs)

Inspect .param.defaults method for the full docstring

dframe(**kwargs)

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(**kwargs)

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

property 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, positions, nodes=None, **kwargs)[source]

Generate a HoloViews Graph from a networkx.Graph object and networkx layout function or dictionary of node positions. 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. Any non-scalar attributes, such as lists or dictionaries will be ignored.

Args:

G (networkx.Graph): Graph to convert to Graph element positions (dict or callable): Node positions

Node positions defined as a dictionary mapping from node id to (x, y) tuple or networkx layout function which computes a positions dictionary

kwargs (dict): Keyword arguments for layout function

Returns:

Graph 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(**kwargs)

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'>)