holoviews.operation Package#


operation Package#

class holoviews.operation.Compositor(pattern, operation, group, mode, transfer_options=False, transfer_parameters=False, output_type=None, backends=None, **kwargs)[source]#

Bases: Parameterized

A Compositor is a way of specifying an operation to be automatically applied to Overlays that match a specified pattern upon display.

Any Operation that takes an Overlay as input may be used to define a compositor.

For instance, a compositor may be defined to automatically display three overlaid monochrome matrices as an RGB image as long as the values names of those matrices match ‘R’, ‘G’ and ‘B’.

mode = param.ObjectSelector(allow_refs=False, default=’data’, label=’Mode’, names={}, nested_refs=False, objects=[‘data’, ‘display’], rx=<param.reactive.reactive_ops object at 0x7f52c4f0d210>)

The mode of the Compositor object which may be either ‘data’ or ‘display’.

backends = param.List(allow_refs=False, bounds=(0, None), default=[], label=’Backends’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c5fbbe20>)

Defines which backends to apply the Compositor for.

operation = param.Parameter(allow_None=True, allow_refs=False, label=’Operation’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c5f15ff0>)

The Operation to apply when collapsing overlays.

pattern = param.String(allow_refs=False, default=’’, label=’Pattern’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c5fbba90>)

The overlay pattern to be processed. An overlay pattern is a sequence of elements specified by dotted paths separated by * . For instance the following pattern specifies three overlaid matrices with values of ‘RedChannel’, ‘GreenChannel’ and ‘BlueChannel’ respectively: ‘Image.RedChannel * Image.GreenChannel * Image.BlueChannel. This pattern specification could then be associated with the RGB operation that returns a single RGB matrix for display.

group = param.String(allow_None=True, allow_refs=False, default=’’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c5f15900>)

The group identifier for the output of this particular compositor

kwargs = param.Dict(allow_None=True, allow_refs=False, class_=<class ‘dict’>, label=’Kwargs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c5fbba90>)

Optional set of parameters to pass to the operation.

transfer_options = param.Boolean(allow_refs=False, default=False, label=’Transfer options’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c5f37190>)

Whether to transfer the options from the input to the output.

transfer_parameters = param.Boolean(allow_refs=False, default=False, label=’Transfer parameters’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c5fbba90>)

Whether to transfer plot options which match to the operation.

apply(value, input_ranges, backend=None)[source]#

Apply the compositor on the input with the given input ranges.

classmethod collapse(holomap, ranges=None, mode='data')[source]#

Given a map of Overlays, apply all applicable compositors.

classmethod collapse_element(overlay, ranges=None, mode='data', backend=None)[source]#

Finds any applicable compositor and applies it.

classmethod map(obj, mode='data', backend=None)[source]#

Applies compositor operations to any HoloViews element or container using the map method.

match_level(overlay)[source]#

Given an overlay, return the match level and applicable slice of the overall overlay. The level an integer if there is a match or None if there is no match.

The level integer is the number of matching components. Higher values indicate a stronger match.

property output_type#

Returns the operation output_type unless explicitly overridden in the kwargs.

classmethod strongest_match(overlay, mode, backend=None)[source]#

Returns the single strongest matching compositor operation given an overlay. If no matches are found, None is returned.

The best match is defined as the compositor operation with the highest match value as returned by the match_level method.

class holoviews.operation.Operation(*, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: ParameterizedFunction

An Operation process an Element or HoloMap at the level of individual elements or overlays. If a holomap is passed in as input, a processed holomap is returned as output where the individual elements have been transformed accordingly. An Operation may turn overlays in new elements or vice versa.

An Operation can be set to be dynamic, which will return a DynamicMap with a callback that will apply the operation dynamically. An Operation may also supply a list of Stream classes on a streams parameter, which can allow dynamic control over the parameters on the operation.

group = param.String(allow_refs=False, default=’Operation’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4f84af0>)

The group string used to identify the output of the Operation. By default this should match the operation name.

dynamic = param.ObjectSelector(allow_refs=False, default=’default’, label=’Dynamic’, names={}, nested_refs=False, objects=[‘default’, True, False], rx=<param.reactive.reactive_ops object at 0x7f52c4f84cd0>)

Whether the operation should be applied dynamically when a specific frame is requested, specified as a Boolean. If set to ‘default’ the mode will be determined based on the input type, i.e. if the data is a DynamicMap it will stay dynamic.

input_ranges = param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ‘dict’>, <class ‘tuple’>), default={}, label=’Input ranges’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4f84a30>)

Ranges to be used for input normalization (if applicable) in a format appropriate for the Normalization.ranges parameter. By default, no normalization is applied. If key-wise normalization is required, a 2-tuple may be supplied where the first component is a Normalization.ranges list and the second component is Normalization.keys.

link_inputs = param.Boolean(allow_refs=False, default=False, label=’Link inputs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4f84cd0>)

If the operation is dynamic, whether or not linked streams should be transferred from the operation inputs for backends that support linked streams. For example if an operation is applied to a DynamicMap with an RangeXY, this switch determines whether the corresponding visualization should update this stream with range changes originating from the newly generated axes.

streams = param.ClassSelector(allow_refs=False, class_=(<class ‘dict’>, <class ‘list’>), default=[], label=’Streams’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4f85390>)

List of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.categorical_aggregate2d(*, datatype, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Generates a gridded Dataset of 2D aggregate arrays indexed by the first two dimensions of the passed Element, turning all remaining dimensions into value dimensions. The key dimensions of the gridded array are treated as categorical indices. Useful for data indexed by two independent categorical variables such as a table of population values indexed by country and year. Data that is indexed by continuous dimensions should be binned before aggregation. The aggregation will retain the global sorting order of both dimensions.

>> table = Table([(‘USA’, 2000, 282.2), (‘UK’, 2005, 58.89)],

kdims=[‘Country’, ‘Year’], vdims=[‘Population’])

>> categorical_aggregate2d(table) Dataset({‘Country’: [‘USA’, ‘UK’], ‘Year’: [2000, 2005],

‘Population’: [[ 282.2 , np.nan], [np.nan, 58.89]]},

kdims=[‘Country’, ‘Year’], vdims=[‘Population’])

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

datatype = param.List(allow_refs=False, bounds=(0, None), default=[‘xarray’, ‘grid’], label=’Datatype’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4f842e0>)

The grid interface types to use when constructing the gridded Dataset.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.chain(*, operations, output_type, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Defining an Operation chain is an easy way to define a new Operation from a series of existing ones. The argument is a list of Operation (or Operation instances) that are called in sequence to generate the returned element.

chain(operations=[gradient, threshold.instance(level=2)])

This operation can accept an Image instance and would first compute the gradient before thresholding the result at a level of 2.0.

Instances are only required when arguments need to be passed to individual operations so the resulting object is a function over a single argument.

Parameters inherited from:

holoviews.core.operation.Operation: dynamic, input_ranges, link_inputs, streams

group = param.String(allow_refs=False, default=’’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1754520>)

The group assigned to the result after having applied the chain. Defaults to the group produced by the last operation in the chain

output_type = param.Parameter(allow_refs=False, default=<class ‘holoviews.element.raster.Image’>, label=’Output type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c5a9d960>)

The output type of the chain operation. Must be supplied if the chain is to be used as a channel operation.

operations = param.List(allow_refs=False, bounds=(0, None), class_=<class ‘holoviews.core.operation.Operation’>, default=[], item_type=<class ‘holoviews.core.operation.Operation’>, label=’Operations’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4fcb100>)

A list of Operations (or Operation instances) that are applied on the input from left to right.

find(operation, skip_nonlinked=True)[source]#

Returns the first found occurrence of an operation while performing a backward traversal of the chain pipeline.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

output_type[source]#

alias of Image

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.collapse(*, fn, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Given an overlay of Element types, collapse into single Element object using supplied function. Collapsing aggregates over the key dimensions of each object applying the supplied fn to each group.

This is an example of an Operation that does not involve any Raster types.

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

fn = param.Callable(allow_refs=False, default=<function mean at 0x7f5303b65f30>, label=’Fn’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4ffc5b0>)

The function that is used to collapse the curve y-values for each x-value.

fn(axis=None, dtype=None, out=None, keepdims=<no value>, *, where=<no value>)[source]#

Compute the arithmetic mean along the specified axis.

Returns the average of the array elements. The average is taken over the flattened array by default, otherwise over the specified axis. float64 intermediate and return values are used for integer inputs.

Parameters#

aarray_like

Array containing numbers whose mean is desired. If a is not an array, a conversion is attempted.

axisNone or int or tuple of ints, optional

Axis or axes along which the means are computed. The default is to compute the mean of the flattened array.

New in version 1.7.0.

If this is a tuple of ints, a mean is performed over multiple axes, instead of a single axis or all the axes as before.

dtypedata-type, optional

Type to use in computing the mean. For integer inputs, the default is float64; for floating point inputs, it is the same as the input dtype.

outndarray, optional

Alternate output array in which to place the result. The default is None; if provided, it must have the same shape as the expected output, but the type will be cast if necessary. See ufuncs-output-type for more details.

keepdimsbool, optional

If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.

If the default value is passed, then keepdims will not be passed through to the mean method of sub-classes of ndarray, however any non-default value will be. If the sub-class’ method does not implement keepdims any exceptions will be raised.

wherearray_like of bool, optional

Elements to include in the mean. See ~numpy.ufunc.reduce for details.

New in version 1.20.0.

Returns#

mndarray, see dtype parameter above

If out=None, returns a new array containing the mean values, otherwise a reference to the output array is returned.

See Also#

average : Weighted average std, var, nanmean, nanstd, nanvar

Notes#

The arithmetic mean is the sum of the elements along the axis divided by the number of elements.

Note that for floating-point input, the mean is computed using the same precision the input has. Depending on the input data, this can cause the results to be inaccurate, especially for float32 (see example below). Specifying a higher-precision accumulator using the dtype keyword can alleviate this issue.

By default, float16 results are computed using float32 intermediates for extra precision.

Examples#

>>> a = np.array([[1, 2], [3, 4]])
>>> np.mean(a)
2.5
>>> np.mean(a, axis=0)
array([2., 3.])
>>> np.mean(a, axis=1)
array([1.5, 3.5])

In single precision, mean can be inaccurate:

>>> a = np.zeros((2, 512*512), dtype=np.float32)
>>> a[0, :] = 1.0
>>> a[1, :] = 0.1
>>> np.mean(a)
0.54999924

Computing the mean in float64 is more accurate:

>>> np.mean(a, dtype=np.float64)
0.55000000074505806 # may vary

Specifying a where argument:

>>> a = np.array([[5, 9, 13], [14, 10, 12], [11, 15, 19]])
>>> np.mean(a)
12.0
>>> np.mean(a, where=[[True], [False], [False]])
9.0
classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.contours(*, filled, levels, overlaid, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Given a Image with a single channel, annotate it with contour lines for a given set of contour levels.

The return is an NdOverlay with a Contours layer for each given level, overlaid on top of the input Image.

Parameters inherited from:

holoviews.core.operation.Operation: dynamic, input_ranges, link_inputs, streams

group = param.String(allow_refs=False, default=’Level’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e20e50>)

The group assigned to the output contours.

levels = param.ClassSelector(allow_refs=False, class_=(<class ‘list’>, <class ‘int’>), default=10, label=’Levels’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e22e30>)

A list of scalar values used to specify the contour levels.

filled = param.Boolean(allow_refs=False, default=False, label=’Filled’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e20850>)

Whether to generate filled contours

overlaid = param.Boolean(allow_refs=False, default=False, label=’Overlaid’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e238b0>)

Whether to overlay the contour on the supplied Element.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

output_type[source]#

alias of Overlay

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.convolve(*, kernel_roi, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Apply a convolution to an overlay using the top layer as the kernel for convolving the bottom layer. Both Image elements in the input overlay should have a single value dimension.

Parameters inherited from:

holoviews.core.operation.Operation: dynamic, input_ranges, link_inputs, streams

group = param.String(allow_refs=False, default=’Convolution’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4ffc640>)

The group assigned to the convolved output.

kernel_roi = param.NumericTuple(allow_refs=False, default=(0, 0, 0, 0), label=’Kernel roi’, length=4, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4ffd0f0>)

A 2-dimensional slice of the kernel layer to use in the convolution in lbrt (left, bottom, right, top) format. By default, no slicing is applied.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

output_type[source]#

alias of Image

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.decimate(*, max_samples, random_seed, x_range, y_range, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Decimates any column based Element to a specified number of random rows if the current element defined by the x_range and y_range contains more than max_samples. By default the operation returns a DynamicMap with a RangeXY stream allowing dynamic downsampling.

Parameters inherited from:

dynamic = param.Boolean(allow_refs=False, default=True, label=’Dynamic’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e22c20>)

Enables dynamic processing by default.

link_inputs = param.Boolean(allow_refs=False, default=True, label=’Link inputs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e22a10>)

By default, the link_inputs parameter is set to True so that when applying shade, backends that support linked streams update RangeXY streams on the inputs of the shade operation.

streams = param.ClassSelector(allow_refs=False, class_=(<class ‘dict’>, <class ‘list’>), default=[<class ‘holoviews.streams.RangeXY’>], label=’Streams’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e215d0>)

List of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.

max_samples = param.Integer(allow_refs=False, default=5000, inclusive_bounds=(True, True), label=’Max samples’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e21270>)

Maximum number of samples to display at the same time.

random_seed = param.Integer(allow_refs=False, default=42, inclusive_bounds=(True, True), label=’Random seed’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e20490>)

Seed used to initialize randomization.

x_range = param.NumericTuple(allow_None=True, allow_refs=False, label=’X range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e23b80>)

The x_range as a tuple of min and max x-value. Auto-ranges if set to None.

y_range = param.NumericTuple(allow_None=True, allow_refs=False, label=’Y range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e21660>)

The x_range as a tuple of min and max y-value. Auto-ranges if set to None.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.factory(*, args, kwargs, output_type, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Simple operation that constructs any element that accepts some other element as input. For instance, RGB and HSV elements can be created from overlays of Image elements.

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

output_type = param.Parameter(allow_refs=False, default=<class ‘holoviews.element.raster.RGB’>, label=’Output type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e211e0>)

The output type of the factor operation. By default, if three overlaid Images elements are supplied, the corresponding RGB element will be returned.

args = param.List(allow_refs=False, bounds=(0, None), default=[], label=’Args’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e23cd0>)

The list of positional argument to pass to the factory

kwargs = param.Dict(allow_refs=False, class_=<class ‘dict’>, default={}, label=’Kwargs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e21510>)

The dict of keyword arguments to pass to the factory

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

output_type[source]#

alias of RGB

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.function(*, args, fn, input_type, kwargs, output_type, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

output_type = param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ‘type’>, label=’Output type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e21990>)

The output type of the method operation

input_type = param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ‘type’>, label=’Input type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e237c0>)

The object type the method is defined on

fn = param.Callable(allow_refs=False, label=’Fn’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e217e0>)

The function to apply.

args = param.List(allow_refs=False, bounds=(0, None), default=[], label=’Args’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e22020>)

The list of positional argument to pass to the method

kwargs = param.Dict(allow_refs=False, class_=<class ‘dict’>, default={}, label=’Kwargs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e21e10>)

The dict of keyword arguments to pass to the method

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.gradient(*, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Compute the gradient plot of the supplied Image.

If the Image value dimension is cyclic, the smallest step is taken considered the cyclic range

Parameters inherited from:

holoviews.core.operation.Operation: dynamic, input_ranges, link_inputs, streams

group = param.String(allow_refs=False, default=’Gradient’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e0fc70>)

The group assigned to the output gradient matrix.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

output_type[source]#

alias of Image

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.histogram(*, bin_range, bins, cumulative, dimension, frequency_label, groupby, log, mean_weighted, nonzero, normed, num_bins, style_prefix, weight_dimension, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Returns a Histogram of the input element data, binned into num_bins over the bin_range (if specified) along the specified dimension.

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

bin_range = param.NumericTuple(allow_None=True, allow_refs=False, label=’Bin range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e0dc90>)

Specifies the range within which to compute the bins.

bins = param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ‘numpy.ndarray’>, <class ‘list’>, <class ‘tuple’>, <class ‘str’>), label=’Bins’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e0d4b0>)

An explicit set of bin edges or a method to find the optimal set of bin edges, e.g. ‘auto’, ‘fd’, ‘scott’ etc. For more documentation on these approaches see the np.histogram_bin_edges documentation.

cumulative = param.Boolean(allow_refs=False, default=False, label=’Cumulative’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e0d060>)

Whether to compute the cumulative histogram

dimension = param.String(allow_None=True, allow_refs=False, label=’Dimension’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e0f970>)

Along which dimension of the Element to compute the histogram.

frequency_label = param.String(allow_None=True, allow_refs=False, label=’Frequency label’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e0c850>)

Format string defining the label of the frequency dimension of the Histogram.

groupby = param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ‘str’>, <class ‘holoviews.core.dimension.Dimension’>), label=’Groupby’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e0fd30>)

Defines a dimension to group the Histogram returning an NdOverlay of Histograms.

log = param.Boolean(allow_refs=False, default=False, label=’Log’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e0eaa0>)

Whether to use base 10 logarithmic samples for the bin edges.

mean_weighted = param.Boolean(allow_refs=False, default=False, label=’Mean weighted’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e0ca60>)

Whether the weighted frequencies are averaged.

normed = param.ObjectSelector(allow_refs=False, default=False, label=’Normed’, names={}, nested_refs=False, objects=[True, False, ‘integral’, ‘height’], rx=<param.reactive.reactive_ops object at 0x7f52c4e0d810>)

Controls normalization behavior. If True or ‘integral’, then density=True is passed to np.histogram, and the distribution is normalized such that the integral is unity. If False, then the frequencies will be raw counts. If ‘height’, then the frequencies are normalized such that the max bin height is unity.

nonzero = param.Boolean(allow_refs=False, default=False, label=’Nonzero’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e0ca90>)

Whether to use only nonzero values when computing the histogram

num_bins = param.Integer(allow_refs=False, default=20, inclusive_bounds=(True, True), label=’Num bins’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e0d810>)

Number of bins in the histogram .

weight_dimension = param.String(allow_None=True, allow_refs=False, label=’Weight dimension’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e0c6a0>)

Name of the dimension the weighting should be drawn from

style_prefix = param.String(allow_None=True, allow_refs=False, label=’Style prefix’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e0f700>)

Used for setting a common style for histograms in a HoloMap or AdjointLayout.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.image_overlay(*, default_range, fill, spec, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Operation to build a overlay of images to a specification from a subset of the required elements.

This is useful for reordering the elements of an overlay, duplicating layers of an overlay or creating blank image elements in the appropriate positions.

For instance, image_overlay may build a three layered input suitable for the RGB factory operation even if supplied with one or two of the required channels (creating blank channels for the missing elements).

Note that if there is any ambiguity regarding the match, the strongest match will be used. In the case of a tie in match strength, the first layer in the input is used. One successful match is always required.

Parameters inherited from:

holoviews.core.operation.Operation: dynamic, input_ranges, link_inputs, streams

group = param.String(allow_refs=False, default=’Transform’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e21930>)

The group assigned to the resulting overlay.

spec = param.String(allow_refs=False, default=’’, label=’Spec’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e0d330>)

Specification of the output Overlay structure. For instance: Image.R * Image.G * Image.B Will ensure an overlay of this structure is created even if (for instance) only (Image.R * Image.B) is supplied. Elements in the input overlay that match are placed in the appropriate positions and unavailable specification elements are created with the specified fill group.

fill = param.Number(allow_refs=False, default=0, inclusive_bounds=(True, True), label=’Fill’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e21330>)

default_range = param.Tuple(allow_refs=False, default=(0, 1), label=’Default range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e0d330>)

The default range that will be set on the value_dimension of any automatically created blank image elements.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

output_type[source]#

alias of Overlay

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.interpolate_curve(*, interpolation, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Resamples a Curve using the defined interpolation method, e.g. to represent changes in y-values as steps.

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

interpolation = param.ObjectSelector(allow_refs=False, default=’steps-mid’, label=’Interpolation’, names={}, nested_refs=False, objects=[‘steps-pre’, ‘steps-mid’, ‘steps-post’, ‘linear’], rx=<param.reactive.reactive_ops object at 0x7f52c4e20640>)

Controls the transition point of the step along the x-axis.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.method(*, args, input_type, kwargs, method_name, output_type, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Operation that wraps a method call

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

output_type = param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ‘type’>, label=’Output type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e0f010>)

The output type of the method operation

input_type = param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ‘type’>, label=’Input type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4fb19c0>)

The object type the method is defined on

method_name = param.String(allow_refs=False, default=’__call__’, label=’Method name’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e0d120>)

The method name

args = param.List(allow_refs=False, bounds=(0, None), default=[], label=’Args’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4fb19c0>)

The list of positional argument to pass to the method

kwargs = param.Dict(allow_refs=False, class_=<class ‘dict’>, default={}, label=’Kwargs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4e0db10>)

The dict of keyword arguments to pass to the method

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.operation(*, op, output_type, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

The most generic operation that wraps any callable into an Operation. The callable needs to accept an HoloViews component and a key (that may be ignored) and must return a new HoloViews component.

This class may be useful for turning a HoloViews method into an operation to define as compositor operation. For instance, the following definition:

operation.instance(op=lambda x, k: x.collapse(np.subtract))

Could be used to implement a collapse operation to subtracts the data between Rasters in an Overlay.

Parameters inherited from:

holoviews.core.operation.Operation: dynamic, input_ranges, link_inputs, streams

group = param.String(allow_refs=False, default=’Operation’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4fb09d0>)

The group assigned to the result after having applied the operator.

output_type = param.Parameter(allow_None=True, allow_refs=False, label=’Output type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4fb24d0>)

The output element type which may be None to disable type checking. May be used to declare useful information to other code in HoloViews, e.g. required for tab-completion support of operations registered with compositors.

op = param.Callable(allow_refs=False, label=’Op’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4fb2110>)

The operation used to generate a new HoloViews object returned by the operation. By default, the identity operation is applied.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.threshold(*, high, level, low, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Threshold a given Image whereby all values higher than a given level map to the specified high value and all values lower than that level map to the specified low value.

Parameters inherited from:

holoviews.core.operation.Operation: dynamic, input_ranges, link_inputs, streams

group = param.String(allow_refs=False, default=’Threshold’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4fb3910>)

The group assigned to the thresholded output.

level = param.Number(allow_refs=False, default=0.5, inclusive_bounds=(True, True), label=’Level’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4fb3460>)

The value at which the threshold is applied. Values lower than the threshold map to the ‘low’ value and values above map to the ‘high’ value.

high = param.Number(allow_refs=False, default=1.0, inclusive_bounds=(True, True), label=’High’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4fb22f0>)

The value given to elements greater than (or equal to) the threshold.

low = param.Number(allow_refs=False, default=0.0, inclusive_bounds=(True, True), label=’Low’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4fb1780>)

The value given to elements below the threshold.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

output_type[source]#

alias of Image

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.transform(*, operator, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Generic Operation to transform an input Image or RGBA element into an output Image. The transformation is defined by the supplied callable that accepts the data of the input Image (typically a numpy array) and returns the transformed data of the output Image.

This operator is extremely versatile; for instance, you could implement an alternative to the explicit threshold operator with:

operator=lambda x: np.clip(x, 0, 0.5)

Alternatively, you can implement a transform computing the 2D autocorrelation using the scipy library with:

operator=lambda x: scipy.signal.correlate2d(x, x)

Parameters inherited from:

holoviews.core.operation.Operation: dynamic, input_ranges, link_inputs, streams

group = param.String(allow_refs=False, default=’Transform’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4fb3b50>)

The group assigned to the result after applying the transform.

operator = param.Callable(allow_None=True, allow_refs=False, label=’Operator’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c4fb3d60>)

Function of one argument that transforms the data in the input Image to the data in the output Image. By default, acts as the identity function such that the output matches the input.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

output_type[source]#

alias of Image

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.


datashader Module#

Inheritance diagram of holoviews.operation.datashader
class holoviews.operation.datashader.AggregationOperation(*, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: ResampleOperation2D

AggregationOperation extends the ResampleOperation2D defining an aggregator parameter used to define a datashader Reduction.

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.resample.LinkableOperation: link_inputs

holoviews.operation.resample.ResampleOperation1D: x_range, x_sampling, width, height, pixel_ratio

holoviews.operation.resample.ResampleOperation2D: dynamic, streams, expand, y_range, y_sampling, target, element_type, precompute

aggregator = param.ClassSelector(allow_refs=False, class_=(<class ‘datashader.reductions.Reduction’>, <class ‘datashader.reductions.summary’>, <class ‘str’>), default=<datashader.reductions.count object at 0x7f52c4be28f0>, label=’Aggregator’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c204d6c0>)

Datashader reduction function used for aggregating the data. The aggregator may also define a column to aggregate; if no column is defined the first value dimension of the element will be used. May also be defined as a string.

selector = param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ‘datashader.reductions.min’>, <class ‘datashader.reductions.max’>, <class ‘datashader.reductions.first’>, <class ‘datashader.reductions.last’>), label=’Selector’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c204d900>)

Selector is a datashader reduction function used for selecting data. The selector only works with aggregators which selects an item from the original data. These selectors are min, max, first and last.

vdim_prefix = param.String(allow_None=True, allow_refs=False, default=’{kdims} ‘, label=’Vdim prefix’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c204d6f0>)

Prefix to prepend to value dimension name where {kdims} templates in the names of the input element key dimensions.

element_type[source]#

alias of Image

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.LineAggregationOperation(*, line_width, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: AggregationOperation

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.resample.LinkableOperation: link_inputs

holoviews.operation.resample.ResampleOperation1D: x_range, x_sampling, width, height, pixel_ratio

holoviews.operation.resample.ResampleOperation2D: dynamic, streams, expand, y_range, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: aggregator, selector, vdim_prefix

line_width = param.Number(allow_None=True, allow_refs=False, bounds=(0, None), inclusive_bounds=(True, True), label=’Line width’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c2078190>)

Width of the line to draw, in pixels. If zero, the default, lines are drawn using a simple algorithm with a blocky single-pixel width based on whether the line passes through each pixel or does not. If greater than one, lines are drawn with the specified width using a slower and more complex antialiasing algorithm with fractional values along each edge, so that lines have a more uniform visual appearance across all angles. Line widths between 0 and 1 effectively use a line_width of 1 pixel but with a proportionate reduction in the strength of each pixel, approximating the visual appearance of a subpixel line width.

element_type[source]#

alias of Image

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.SpreadingOperation(*, how, shape, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: LinkableOperation

Spreading expands each pixel in an Image based Element a certain number of pixels on all sides according to a given shape, merging pixels using a specified compositing operator. This can be useful to make sparse plots more visible.

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, streams

holoviews.operation.resample.LinkableOperation: link_inputs

how = param.ObjectSelector(allow_refs=False, label=’How’, names={}, nested_refs=False, objects=[None, ‘source’, ‘over’, ‘saturate’, ‘add’, ‘max’, ‘min’], rx=<param.reactive.reactive_ops object at 0x7f52c205b0a0>)

The name of the compositing operator to use when combining pixels. Default of None uses ‘over’ operator for RGB elements and ‘add’ operator for aggregate arrays.

shape = param.ObjectSelector(allow_refs=False, default=’circle’, label=’Shape’, names={}, nested_refs=False, objects=[‘circle’, ‘square’], rx=<param.reactive.reactive_ops object at 0x7f52c205b220>)

The shape to spread by. Options are ‘circle’ [default] or ‘square’.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.aggregate(*, line_width, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: LineAggregationOperation

aggregate implements 2D binning for any valid HoloViews Element type using datashader. I.e., this operation turns a HoloViews Element or overlay of Elements into an Image or an overlay of Images by rasterizing it. This allows quickly aggregating large datasets computing a fixed-sized representation independent of the original dataset size.

By default it will simply count the number of values in each bin but other aggregators can be supplied implementing mean, max, min and other reduction operations.

The bins of the aggregate are defined by the width and height and the x_range and y_range. If x_sampling or y_sampling are supplied the operation will ensure that a bin is no smaller than the minimum sampling distance by reducing the width and height when zoomed in beyond the minimum sampling distance.

By default, the PlotSize stream is applied when this operation is used dynamically, which means that the height and width will automatically be set to match the inner dimensions of the linked plot.

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.resample.LinkableOperation: link_inputs

holoviews.operation.resample.ResampleOperation1D: x_range, x_sampling, width, height, pixel_ratio

holoviews.operation.resample.ResampleOperation2D: dynamic, streams, expand, y_range, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: aggregator, selector, vdim_prefix

holoviews.operation.datashader.LineAggregationOperation: line_width

element_type[source]#

alias of Image

classmethod get_agg_data(obj, category=None)[source]#

Reduces any Overlay or NdOverlay of Elements into a single xarray Dataset that can be aggregated.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.area_aggregate(*, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: AggregationOperation

Aggregates Area elements by filling the area between zero and the y-values if only one value dimension is defined and the area between the curves if two are provided.

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.resample.LinkableOperation: link_inputs

holoviews.operation.resample.ResampleOperation1D: x_range, x_sampling, width, height, pixel_ratio

holoviews.operation.resample.ResampleOperation2D: dynamic, streams, expand, y_range, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: aggregator, selector, vdim_prefix

element_type[source]#

alias of Image

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.bundle_graph(*, split, dynamic, group, input_ranges, link_inputs, streams, accuracy, advect_iterations, batch_size, decay, initial_bandwidth, iterations, max_segment_length, min_segment_length, tension, include_edge_id, source, target, weight, x, y, name)[source]#

Bases: _connect_edges, hammer_bundle

Iteratively group edges and return as paths suitable for datashading.

Breaks each edge into a path with multiple line segments, and iteratively curves this path to bundle edges into groups.

Parameters inherited from:

datashader.bundling.connect_edges: x, y, source, target, include_edge_id

datashader.bundling.hammer_bundle: weight, initial_bandwidth, decay, iterations, batch_size, tension, accuracy, advect_iterations, min_segment_length, max_segment_length

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

holoviews.operation.datashader._connect_edges: split

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.contours_rasterize(*, line_width, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: aggregate

Rasterizes the Contours element by weighting the aggregation by the iso-contour levels if a value dimension is defined, otherwise default to any aggregator.

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.resample.LinkableOperation: link_inputs

holoviews.operation.resample.ResampleOperation1D: x_range, x_sampling, width, height, pixel_ratio

holoviews.operation.resample.ResampleOperation2D: dynamic, streams, expand, y_range, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: selector, vdim_prefix

holoviews.operation.datashader.LineAggregationOperation: line_width

aggregator = param.ClassSelector(allow_refs=False, class_=(<class ‘datashader.reductions.Reduction’>, <class ‘datashader.reductions.summary’>, <class ‘str’>), default=<datashader.reductions.mean object at 0x7f52c1fb8790>, label=’Aggregator’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c204fbe0>)

Datashader reduction function used for aggregating the data. The aggregator may also define a column to aggregate; if no column is defined the first value dimension of the element will be used. May also be defined as a string.

element_type[source]#

alias of Image

classmethod get_agg_data(obj, category=None)[source]#

Reduces any Overlay or NdOverlay of Elements into a single xarray Dataset that can be aggregated.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.datashade(*, interpolation, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, alpha, clims, cmap, cnorm, color_key, min_alpha, rescale_discrete_levels, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: rasterize, shade

Applies the aggregate and shade operations, aggregating all elements in the supplied object and then applying normalization and colormapping the aggregated data returning RGB elements.

See aggregate and shade operations for more details.

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.resample.LinkableOperation: link_inputs

holoviews.operation.datashader.shade: alpha, cmap, color_key, cnorm, clims, min_alpha, rescale_discrete_levels

holoviews.operation.resample.ResampleOperation1D: x_range, x_sampling, width, height, pixel_ratio

holoviews.operation.resample.ResampleOperation2D: dynamic, streams, expand, y_range, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: selector, vdim_prefix

holoviews.operation.datashader.rasterize: aggregator, interpolation

classmethod concatenate(overlay)[source]#

Concatenates an NdOverlay of Image types into a single 3D xarray Dataset.

element_type[source]#

alias of Image

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod rgb2hex(rgb)[source]#

Convert RGB(A) tuple to hex.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

classmethod uint32_to_uint8(img)[source]#

Cast uint32 RGB image to 4 uint8 channels.

classmethod uint32_to_uint8_xr(img)[source]#

Cast uint32 xarray DataArray to 4 uint8 channels.

class holoviews.operation.datashader.directly_connect_edges(*, split, dynamic, group, input_ranges, link_inputs, streams, include_edge_id, source, target, weight, x, y, name)[source]#

Bases: _connect_edges, connect_edges

Given a Graph object will directly connect all nodes.

Parameters inherited from:

datashader.bundling.connect_edges: x, y, source, target, weight, include_edge_id

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

holoviews.operation.datashader._connect_edges: split

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.dynspread(*, max_px, threshold, how, shape, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: SpreadingOperation

Spreading expands each pixel in an Image based Element a certain number of pixels on all sides according to a given shape, merging pixels using a specified compositing operator. This can be useful to make sparse plots more visible. Dynamic spreading determines how many pixels to spread based on a density heuristic.

See the datashader documentation for more detail:

http://datashader.org/api.html#datashader.transfer_functions.dynspread

Parameters inherited from:

max_px = param.Integer(allow_refs=False, default=3, inclusive_bounds=(True, True), label=’Max px’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c204e620>)

Maximum number of pixels to spread on all sides.

threshold = param.Number(allow_refs=False, bounds=(0, 1), default=0.5, inclusive_bounds=(True, True), label=’Threshold’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c204f7f0>)

When spreading, determines how far to spread. Spreading starts at 1 pixel, and stops when the fraction of adjacent non-empty pixels reaches this threshold. Higher values give more spreading, up to the max_px allowed.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.geom_aggregate(*, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: AggregationOperation

Baseclass for aggregation of Geom elements.

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.resample.LinkableOperation: link_inputs

holoviews.operation.resample.ResampleOperation1D: x_range, x_sampling, width, height, pixel_ratio

holoviews.operation.resample.ResampleOperation2D: dynamic, streams, expand, y_range, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: aggregator, selector, vdim_prefix

element_type[source]#

alias of Image

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.geometry_rasterize(*, line_width, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: LineAggregationOperation

Rasterizes geometries by converting them to spatialpandas.

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.resample.LinkableOperation: link_inputs

holoviews.operation.resample.ResampleOperation1D: x_range, x_sampling, width, height, pixel_ratio

holoviews.operation.resample.ResampleOperation2D: dynamic, streams, expand, y_range, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: selector, vdim_prefix

holoviews.operation.datashader.LineAggregationOperation: line_width

aggregator = param.ClassSelector(allow_refs=False, class_=(<class ‘datashader.reductions.Reduction’>, <class ‘datashader.reductions.summary’>, <class ‘str’>), default=<datashader.reductions.mean object at 0x7f52c1fb8ca0>, label=’Aggregator’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1e9a500>)

Datashader reduction function used for aggregating the data. The aggregator may also define a column to aggregate; if no column is defined the first value dimension of the element will be used. May also be defined as a string.

element_type[source]#

alias of Image

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.inspect(*, hits, max_indicators, null_value, pixels, transform, value_bounds, x, y, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Generalized inspect operation that detects the appropriate indicator type.

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs

streams = param.ClassSelector(allow_refs=False, class_=(<class ‘dict’>, <class ‘list’>), default={‘x’: <param.parameters.ClassSelector object at 0x7f52f9ae17a0>, ‘y’: <param.parameters.ClassSelector object at 0x7f52f9ae19b0>}, label=’Streams’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1e9b190>)

List of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.

pixels = param.Integer(allow_refs=False, default=3, inclusive_bounds=(True, True), label=’Pixels’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1e99870>)

Number of pixels in data space around the cursor point to search for hits in. The hit within this box mask that is closest to the cursor’s position is displayed.

null_value = param.Number(allow_refs=False, default=0, inclusive_bounds=(True, True), label=’Null value’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1e99900>)

Value of raster which indicates no hits. For instance zero for count aggregator (default) and commonly NaN for other (float) aggregators. For RGBA images, the alpha channel is used which means zero alpha acts as the null value.

value_bounds = param.NumericTuple(allow_None=True, allow_refs=False, label=’Value bounds’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1e98640>)

If not None, a numeric bounds for the pixel under the cursor in order for hits to be computed. Useful for count aggregators where a value of (1,1000) would make sure no more than a thousand samples will be searched.

hits = param.DataFrame(allow_None=True, allow_refs=False, class_=<class ‘pandas.core.frame.DataFrame’>, default=Empty DataFrame Columns: [] Index: [], label=’Hits’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1e9b460>)

max_indicators = param.Integer(allow_refs=False, default=1, inclusive_bounds=(True, True), label=’Max indicators’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1e9a5f0>)

Maximum number of indicator elements to display within the mask of size pixels. Points are prioritized by distance from the cursor point. This means that the default value of one shows the single closest sample to the cursor. Note that this limit is not applies to the hits parameter.

transform = param.Callable(allow_refs=False, label=’Transform’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1e99a20>)

Function that transforms the hits dataframe before it is passed to the Points element. Can be used to customize the value dimensions e.g. to implement custom hover behavior.

x = param.Number(allow_refs=False, default=0, inclusive_bounds=(True, True), label=’X’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1e99ab0>)

x-position to inspect.

y = param.Number(allow_refs=False, default=0, inclusive_bounds=(True, True), label=’Y’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1e99d80>)

y-position to inspect.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.inspect_base(*, hits, max_indicators, null_value, pixels, transform, value_bounds, x, y, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: inspect

Given datashaded aggregate (Image) output, return a set of (hoverable) points sampled from those near the cursor.

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs

holoviews.operation.datashader.inspect: streams, pixels, null_value, value_bounds, hits, max_indicators, transform, x, y

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.inspect_mask(*, pixels, x, y, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Operation used to display the inspection mask, for use with other inspection operations. Can be used directly but is more commonly constructed using the mask property of the corresponding inspector operation.

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs

streams = param.ClassSelector(allow_refs=False, class_=(<class ‘dict’>, <class ‘list’>), default=[<class ‘holoviews.streams.PointerXY’>], label=’Streams’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1e7a470>)

List of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.

pixels = param.Integer(allow_refs=False, default=3, inclusive_bounds=(True, True), label=’Pixels’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1e7aa40>)

Size of the mask that should match the pixels parameter used in the associated inspection operation.

x = param.Number(allow_refs=False, default=0, inclusive_bounds=(True, True), label=’X’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1e79390>)

y = param.Number(allow_refs=False, default=0, inclusive_bounds=(True, True), label=’Y’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1e7a950>)

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.inspect_points(*, hits, max_indicators, null_value, pixels, transform, value_bounds, x, y, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: inspect_base

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs

holoviews.operation.datashader.inspect: streams, pixels, null_value, value_bounds, hits, max_indicators, transform, x, y

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.inspect_polygons(*, hits, max_indicators, null_value, pixels, transform, value_bounds, x, y, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: inspect_base

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs

holoviews.operation.datashader.inspect: streams, pixels, null_value, value_bounds, hits, max_indicators, transform, x, y

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.overlay_aggregate(*, line_width, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: aggregate

Optimized aggregation for NdOverlay objects by aggregating each Element in an NdOverlay individually avoiding having to concatenate items in the NdOverlay. Works by summing sum and count aggregates and applying appropriate masking for NaN values. Mean aggregation is also supported by dividing sum and count aggregates. count_cat aggregates are grouped by the categorical dimension and a separate aggregate for each category is generated.

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.resample.LinkableOperation: link_inputs

holoviews.operation.resample.ResampleOperation1D: x_range, x_sampling, width, height, pixel_ratio

holoviews.operation.resample.ResampleOperation2D: dynamic, streams, expand, y_range, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: aggregator, selector, vdim_prefix

holoviews.operation.datashader.LineAggregationOperation: line_width

element_type[source]#

alias of Image

classmethod get_agg_data(obj, category=None)[source]#

Reduces any Overlay or NdOverlay of Elements into a single xarray Dataset that can be aggregated.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.quadmesh_rasterize(*, interpolation, line_width, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: trimesh_rasterize

Rasterize the QuadMesh element using the supplied aggregator. Simply converts to a TriMesh and lets trimesh_rasterize handle the actual rasterization.

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.resample.LinkableOperation: link_inputs

holoviews.operation.resample.ResampleOperation1D: x_range, x_sampling, width, height, pixel_ratio

holoviews.operation.resample.ResampleOperation2D: dynamic, streams, expand, y_range, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: selector, vdim_prefix

holoviews.operation.datashader.LineAggregationOperation: line_width

holoviews.operation.datashader.trimesh_rasterize: aggregator, interpolation

element_type[source]#

alias of Image

classmethod get_agg_data(obj, category=None)[source]#

Reduces any Overlay or NdOverlay of Elements into a single xarray Dataset that can be aggregated.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.rasterize(*, interpolation, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: AggregationOperation

Rasterize is a high-level operation that will rasterize any Element or combination of Elements, aggregating them with the supplied aggregator and interpolation method.

The default aggregation method depends on the type of Element but usually defaults to the count of samples in each bin. Other aggregators can be supplied implementing mean, max, min and other reduction operations.

The bins of the aggregate are defined by the width and height and the x_range and y_range. If x_sampling or y_sampling are supplied the operation will ensure that a bin is no smaller than the minimum sampling distance by reducing the width and height when zoomed in beyond the minimum sampling distance.

By default, the PlotSize and RangeXY streams are applied when this operation is used dynamically, which means that the width, height, x_range and y_range will automatically be set to match the inner dimensions of the linked plot and the ranges of the axes.

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.resample.LinkableOperation: link_inputs

holoviews.operation.resample.ResampleOperation1D: x_range, x_sampling, width, height, pixel_ratio

holoviews.operation.resample.ResampleOperation2D: dynamic, streams, expand, y_range, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: selector, vdim_prefix

aggregator = param.ClassSelector(allow_refs=False, class_=(<class ‘datashader.reductions.Reduction’>, <class ‘datashader.reductions.summary’>, <class ‘str’>), default=’default’, label=’Aggregator’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1e5a5c0>)

Datashader reduction function used for aggregating the data. The aggregator may also define a column to aggregate; if no column is defined the first value dimension of the element will be used. May also be defined as a string.

interpolation = param.ObjectSelector(allow_refs=False, default=’default’, label=’Interpolation’, names={}, nested_refs=False, objects=[‘default’, ‘linear’, ‘nearest’, ‘bilinear’, None, False], rx=<param.reactive.reactive_ops object at 0x7f52c1e58bb0>)

The interpolation method to apply during rasterization. Default depends on element type

element_type[source]#

alias of Image

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.rectangle_aggregate(*, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: geom_aggregate

Aggregates Rectangle elements.

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.resample.LinkableOperation: link_inputs

holoviews.operation.resample.ResampleOperation1D: x_range, x_sampling, width, height, pixel_ratio

holoviews.operation.resample.ResampleOperation2D: dynamic, streams, expand, y_range, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: aggregator, selector, vdim_prefix

element_type[source]#

alias of Image

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.regrid(*, interpolation, upsample, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: AggregationOperation

regrid allows resampling a HoloViews Image type using specified up- and downsampling functions defined using the aggregator and interpolation parameters respectively. By default upsampling is disabled to avoid unnecessarily upscaling an image that has to be sent to the browser. Also disables expanding the image beyond its original bounds avoiding unnecessarily padding the output array with NaN values.

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.resample.LinkableOperation: link_inputs

holoviews.operation.resample.ResampleOperation1D: x_range, x_sampling, width, height, pixel_ratio

holoviews.operation.resample.ResampleOperation2D: dynamic, streams, y_range, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: selector, vdim_prefix

expand = param.Boolean(allow_refs=False, default=False, label=’Expand’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1ef4370>)

Whether the x_range and y_range should be allowed to expand beyond the extent of the data. Setting this value to True is useful for the case where you want to ensure a certain size of output grid, e.g. if you are doing masking or other arithmetic on the grids. A value of False ensures that the grid is only just as large as it needs to be to contain the data, which will be faster and use less memory if the resulting aggregate is being overlaid on a much larger background.

aggregator = param.ClassSelector(allow_refs=False, class_=(<class ‘datashader.reductions.Reduction’>, <class ‘datashader.reductions.summary’>, <class ‘str’>), default=<datashader.reductions.mean object at 0x7f52c1fb85b0>, label=’Aggregator’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1ef45b0>)

Datashader reduction function used for aggregating the data. The aggregator may also define a column to aggregate; if no column is defined the first value dimension of the element will be used. May also be defined as a string.

interpolation = param.ObjectSelector(allow_refs=False, default=’nearest’, label=’Interpolation’, names={}, nested_refs=False, objects=[‘linear’, ‘nearest’, ‘bilinear’, None, False], rx=<param.reactive.reactive_ops object at 0x7f52c1ef4610>)

Interpolation method

upsample = param.Boolean(allow_refs=False, default=False, label=’Upsample’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1ef45e0>)

Whether to allow upsampling if the source array is smaller than the requested array. Setting this value to True will enable upsampling using the interpolation method, when the requested width and height are larger than what is available on the source grid. If upsampling is disabled (the default) the width and height are clipped to what is available on the source array.

element_type[source]#

alias of Image

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.segments_aggregate(*, line_width, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: geom_aggregate, LineAggregationOperation

Aggregates Segments elements.

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.resample.LinkableOperation: link_inputs

holoviews.operation.resample.ResampleOperation1D: x_range, x_sampling, width, height, pixel_ratio

holoviews.operation.resample.ResampleOperation2D: dynamic, streams, expand, y_range, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: aggregator, selector, vdim_prefix

holoviews.operation.datashader.LineAggregationOperation: line_width

element_type[source]#

alias of Image

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.shade(*, alpha, clims, cmap, cnorm, color_key, min_alpha, rescale_discrete_levels, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: LinkableOperation

shade applies a normalization function followed by colormapping to an Image or NdOverlay of Images, returning an RGB Element. The data must be in the form of a 2D or 3D DataArray, but NdOverlays of 2D Images will be automatically converted to a 3D array.

In the 2D case data is normalized and colormapped, while a 3D array representing categorical aggregates will be supplied a color key for each category. The colormap (cmap) for the 2D case may be supplied as an Iterable or a Callable.

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, streams

holoviews.operation.resample.LinkableOperation: link_inputs

alpha = param.Integer(allow_refs=False, bounds=(0, 255), default=255, inclusive_bounds=(True, True), label=’Alpha’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1ef7010>)

Value between 0 - 255 representing the alpha value to use for colormapped pixels that contain data (i.e. non-NaN values). Regardless of this value, NaN values are set to be fully transparent when doing colormapping.

cmap = param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ‘collections.abc.Iterable’>, <class ‘collections.abc.Callable’>, <class ‘dict’>), label=’Cmap’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1ef6d70>)

Iterable or callable which returns colors as hex colors or web color names (as defined by datashader), to be used for the colormap of single-layer datashader output. Callable type must allow mapping colors between 0 and 1. The default value of None reverts to Datashader’s default colormap.

color_key = param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ‘collections.abc.Iterable’>, <class ‘collections.abc.Callable’>, <class ‘dict’>), label=’Color key’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1ef71f0>)

Iterable or callable that returns colors as hex colors, to be used for the color key of categorical datashader output. Callable type must allow mapping colors for supplied values between 0 and 1.

cnorm = param.ClassSelector(allow_refs=False, class_=(<class ‘str’>, <class ‘collections.abc.Callable’>), default=’eq_hist’, label=’Cnorm’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1ef7640>)

The normalization operation applied before colormapping. Valid options include ‘linear’, ‘log’, ‘eq_hist’, ‘cbrt’, and any valid transfer function that accepts data, mask, nbins arguments.

clims = param.NumericTuple(allow_None=True, allow_refs=False, label=’Clims’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1ef55a0>)

Min and max data values to use for colormap interpolation, when wishing to override autoranging.

min_alpha = param.Number(allow_refs=False, bounds=(0, 255), default=40, inclusive_bounds=(True, True), label=’Min alpha’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1ef7610>)

The minimum alpha value to use for non-empty pixels when doing colormapping, in [0, 255]. Use a higher value to avoid undersaturation, i.e. poorly visible low-value datapoints, at the expense of the overall dynamic range..

rescale_discrete_levels = param.Boolean(allow_refs=False, default=True, label=’Rescale discrete levels’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1ef76a0>)

If cnorm='eq_hist and there are only a few discrete values, then rescale_discrete_levels=True (the default) decreases the lower limit of the autoranged span so that the values are rendering towards the (more visible) top of the cmap range, thus avoiding washout of the lower values. Has no effect if cnorm!=`eq_hist. Set this value to False if you need to match historical unscaled behavior, prior to HoloViews 1.14.4.

classmethod concatenate(overlay)[source]#

Concatenates an NdOverlay of Image types into a single 3D xarray Dataset.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod rgb2hex(rgb)[source]#

Convert RGB(A) tuple to hex.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

classmethod uint32_to_uint8(img)[source]#

Cast uint32 RGB image to 4 uint8 channels.

classmethod uint32_to_uint8_xr(img)[source]#

Cast uint32 xarray DataArray to 4 uint8 channels.

class holoviews.operation.datashader.spikes_aggregate(*, offset, spike_length, line_width, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: LineAggregationOperation

Aggregates Spikes elements by drawing individual line segments over the entire y_range if no value dimension is defined and between zero and the y-value if one is defined.

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.resample.LinkableOperation: link_inputs

holoviews.operation.resample.ResampleOperation1D: x_range, x_sampling, width, height, pixel_ratio

holoviews.operation.resample.ResampleOperation2D: dynamic, streams, expand, y_range, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: aggregator, selector, vdim_prefix

holoviews.operation.datashader.LineAggregationOperation: line_width

spike_length = param.Number(allow_None=True, allow_refs=False, inclusive_bounds=(True, True), label=’Spike length’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1ef7be0>)

If numeric, specifies the length of each spike, overriding the vdims values (if present).

offset = param.Number(allow_refs=False, default=0.0, inclusive_bounds=(True, True), label=’Offset’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1e59570>)

The offset of the lower end of each spike.

element_type[source]#

alias of Image

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

holoviews.operation.datashader.split_dataframe(path_df)[source]#

Splits a dataframe of paths separated by NaNs into individual dataframes.

class holoviews.operation.datashader.spread(*, px, how, shape, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: SpreadingOperation

Spreading expands each pixel in an Image based Element a certain number of pixels on all sides according to a given shape, merging pixels using a specified compositing operator. This can be useful to make sparse plots more visible.

See the datashader documentation for more detail:

http://datashader.org/api.html#datashader.transfer_functions.spread

Parameters inherited from:

px = param.Integer(allow_refs=False, default=1, inclusive_bounds=(True, True), label=’Px’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1ef6d40>)

Number of pixels to spread on all sides.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.spread_aggregate(*, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: area_aggregate

Aggregates Spread elements by filling the area between the lower and upper error band.

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.resample.LinkableOperation: link_inputs

holoviews.operation.resample.ResampleOperation1D: x_range, x_sampling, width, height, pixel_ratio

holoviews.operation.resample.ResampleOperation2D: dynamic, streams, expand, y_range, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: aggregator, selector, vdim_prefix

element_type[source]#

alias of Image

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.stack(*, compositor, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

The stack operation allows compositing multiple RGB Elements using the defined compositing operator.

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

compositor = param.ObjectSelector(allow_refs=False, default=’over’, label=’Compositor’, names={}, nested_refs=False, objects=[‘add’, ‘over’, ‘saturate’, ‘source’], rx=<param.reactive.reactive_ops object at 0x7f52c1eb27d0>)

Defines how the compositing operation combines the images

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.datashader.trimesh_rasterize(*, interpolation, line_width, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: aggregate

Rasterize the TriMesh element using the supplied aggregator. If the TriMesh nodes or edges define a value dimension, will plot filled and shaded polygons; otherwise returns a wiremesh of the data.

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.resample.LinkableOperation: link_inputs

holoviews.operation.resample.ResampleOperation1D: x_range, x_sampling, width, height, pixel_ratio

holoviews.operation.resample.ResampleOperation2D: dynamic, streams, expand, y_range, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: selector, vdim_prefix

holoviews.operation.datashader.LineAggregationOperation: line_width

aggregator = param.ClassSelector(allow_refs=False, class_=(<class ‘datashader.reductions.Reduction’>, <class ‘datashader.reductions.summary’>, <class ‘str’>), default=<datashader.reductions.mean object at 0x7f52c1fb8820>, label=’Aggregator’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52c1eb35e0>)

Datashader reduction function used for aggregating the data. The aggregator may also define a column to aggregate; if no column is defined the first value dimension of the element will be used. May also be defined as a string.

interpolation = param.ObjectSelector(allow_refs=False, default=’bilinear’, label=’Interpolation’, names={}, nested_refs=False, objects=[‘bilinear’, ‘linear’, None, False], rx=<param.reactive.reactive_ops object at 0x7f52c1eb1e70>)

The interpolation method to apply during rasterization.

element_type[source]#

alias of Image

classmethod get_agg_data(obj, category=None)[source]#

Reduces any Overlay or NdOverlay of Elements into a single xarray Dataset that can be aggregated.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.


downsample Module#

Inheritance diagram of holoviews.operation.downsample

Implements downsampling algorithms for large 1D datasets.

The algorithms implemented in this module have been adapted from predict-idlab/plotly-resampler and are reproduced along with the original license:

MIT License

Copyright (c) 2022 Jonas Van Der Donckt, Jeroen Van Der Donckt, Emiel Deprost.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

class holoviews.operation.downsample.downsample1d(*, algorithm, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: ResampleOperation1D

Implements downsampling of a regularly sampled 1D dataset.

Supports multiple algorithms:

  • lttb: Largest Triangle Three Buckets downsample algorithm

  • nth: Selects every n-th point.

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.resample.LinkableOperation: link_inputs

holoviews.operation.resample.ResampleOperation1D: dynamic, streams, x_range, x_sampling, width, height, pixel_ratio

algorithm = param.Selector(allow_refs=False, default=’lttb’, label=’Algorithm’, names={}, nested_refs=False, objects=[‘lttb’, ‘nth’], rx=<param.reactive.reactive_ops object at 0x7f52ba430a30>)

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.


element Module#

Inheritance diagram of holoviews.operation.element

Collection of either extremely generic or simple Operation examples.

class holoviews.operation.element.apply_when(*, operation, predicate, name)[source]#

Bases: ParameterizedFunction

Applies a selection depending on the current zoom range. If the supplied predicate function returns a True it will apply the operation otherwise it will return the raw element after the selection. For example the following will apply datashading if the number of points in the current viewport exceed 1000 otherwise just returning the selected points element:

apply_when(points, operation=datashade, predicate=lambda x: x > 1000)

operation = param.Callable(allow_refs=False, label=’Operation’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba46fd90>)

predicate = param.Callable(allow_None=True, allow_refs=False, label=’Predicate’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba46ffd0>)

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

class holoviews.operation.element.chain(*, operations, output_type, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Defining an Operation chain is an easy way to define a new Operation from a series of existing ones. The argument is a list of Operation (or Operation instances) that are called in sequence to generate the returned element.

chain(operations=[gradient, threshold.instance(level=2)])

This operation can accept an Image instance and would first compute the gradient before thresholding the result at a level of 2.0.

Instances are only required when arguments need to be passed to individual operations so the resulting object is a function over a single argument.

Parameters inherited from:

holoviews.core.operation.Operation: dynamic, input_ranges, link_inputs, streams

group = param.String(allow_refs=False, default=’’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba46f3a0>)

The group assigned to the result after having applied the chain. Defaults to the group produced by the last operation in the chain

output_type = param.Parameter(allow_refs=False, default=<class ‘holoviews.element.raster.Image’>, label=’Output type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba46f160>)

The output type of the chain operation. Must be supplied if the chain is to be used as a channel operation.

operations = param.List(allow_refs=False, bounds=(0, None), class_=<class ‘holoviews.core.operation.Operation’>, default=[], item_type=<class ‘holoviews.core.operation.Operation’>, label=’Operations’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba46f3d0>)

A list of Operations (or Operation instances) that are applied on the input from left to right.

find(operation, skip_nonlinked=True)[source]#

Returns the first found occurrence of an operation while performing a backward traversal of the chain pipeline.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

output_type[source]#

alias of Image

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.element.collapse(*, fn, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Given an overlay of Element types, collapse into single Element object using supplied function. Collapsing aggregates over the key dimensions of each object applying the supplied fn to each group.

This is an example of an Operation that does not involve any Raster types.

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

fn = param.Callable(allow_refs=False, default=<function mean at 0x7f5303b65f30>, label=’Fn’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba4972b0>)

The function that is used to collapse the curve y-values for each x-value.

fn(axis=None, dtype=None, out=None, keepdims=<no value>, *, where=<no value>)[source]#

Compute the arithmetic mean along the specified axis.

Returns the average of the array elements. The average is taken over the flattened array by default, otherwise over the specified axis. float64 intermediate and return values are used for integer inputs.

Parameters#

aarray_like

Array containing numbers whose mean is desired. If a is not an array, a conversion is attempted.

axisNone or int or tuple of ints, optional

Axis or axes along which the means are computed. The default is to compute the mean of the flattened array.

New in version 1.7.0.

If this is a tuple of ints, a mean is performed over multiple axes, instead of a single axis or all the axes as before.

dtypedata-type, optional

Type to use in computing the mean. For integer inputs, the default is float64; for floating point inputs, it is the same as the input dtype.

outndarray, optional

Alternate output array in which to place the result. The default is None; if provided, it must have the same shape as the expected output, but the type will be cast if necessary. See ufuncs-output-type for more details.

keepdimsbool, optional

If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.

If the default value is passed, then keepdims will not be passed through to the mean method of sub-classes of ndarray, however any non-default value will be. If the sub-class’ method does not implement keepdims any exceptions will be raised.

wherearray_like of bool, optional

Elements to include in the mean. See ~numpy.ufunc.reduce for details.

New in version 1.20.0.

Returns#

mndarray, see dtype parameter above

If out=None, returns a new array containing the mean values, otherwise a reference to the output array is returned.

See Also#

average : Weighted average std, var, nanmean, nanstd, nanvar

Notes#

The arithmetic mean is the sum of the elements along the axis divided by the number of elements.

Note that for floating-point input, the mean is computed using the same precision the input has. Depending on the input data, this can cause the results to be inaccurate, especially for float32 (see example below). Specifying a higher-precision accumulator using the dtype keyword can alleviate this issue.

By default, float16 results are computed using float32 intermediates for extra precision.

Examples#

>>> a = np.array([[1, 2], [3, 4]])
>>> np.mean(a)
2.5
>>> np.mean(a, axis=0)
array([2., 3.])
>>> np.mean(a, axis=1)
array([1.5, 3.5])

In single precision, mean can be inaccurate:

>>> a = np.zeros((2, 512*512), dtype=np.float32)
>>> a[0, :] = 1.0
>>> a[1, :] = 0.1
>>> np.mean(a)
0.54999924

Computing the mean in float64 is more accurate:

>>> np.mean(a, dtype=np.float64)
0.55000000074505806 # may vary

Specifying a where argument:

>>> a = np.array([[5, 9, 13], [14, 10, 12], [11, 15, 19]])
>>> np.mean(a)
12.0
>>> np.mean(a, where=[[True], [False], [False]])
9.0
classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.element.contours(*, filled, levels, overlaid, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Given a Image with a single channel, annotate it with contour lines for a given set of contour levels.

The return is an NdOverlay with a Contours layer for each given level, overlaid on top of the input Image.

Parameters inherited from:

holoviews.core.operation.Operation: dynamic, input_ranges, link_inputs, streams

group = param.String(allow_refs=False, default=’Level’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba495720>)

The group assigned to the output contours.

levels = param.ClassSelector(allow_refs=False, class_=(<class ‘list’>, <class ‘int’>), default=10, label=’Levels’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba4978b0>)

A list of scalar values used to specify the contour levels.

filled = param.Boolean(allow_refs=False, default=False, label=’Filled’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba496e60>)

Whether to generate filled contours

overlaid = param.Boolean(allow_refs=False, default=False, label=’Overlaid’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba494fa0>)

Whether to overlay the contour on the supplied Element.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

output_type[source]#

alias of Overlay

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.element.convolve(*, kernel_roi, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Apply a convolution to an overlay using the top layer as the kernel for convolving the bottom layer. Both Image elements in the input overlay should have a single value dimension.

Parameters inherited from:

holoviews.core.operation.Operation: dynamic, input_ranges, link_inputs, streams

group = param.String(allow_refs=False, default=’Convolution’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba46e4a0>)

The group assigned to the convolved output.

kernel_roi = param.NumericTuple(allow_refs=False, default=(0, 0, 0, 0), label=’Kernel roi’, length=4, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba46dea0>)

A 2-dimensional slice of the kernel layer to use in the convolution in lbrt (left, bottom, right, top) format. By default, no slicing is applied.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

output_type[source]#

alias of Image

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.element.decimate(*, max_samples, random_seed, x_range, y_range, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Decimates any column based Element to a specified number of random rows if the current element defined by the x_range and y_range contains more than max_samples. By default the operation returns a DynamicMap with a RangeXY stream allowing dynamic downsampling.

Parameters inherited from:

dynamic = param.Boolean(allow_refs=False, default=True, label=’Dynamic’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba4970d0>)

Enables dynamic processing by default.

link_inputs = param.Boolean(allow_refs=False, default=True, label=’Link inputs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba495660>)

By default, the link_inputs parameter is set to True so that when applying shade, backends that support linked streams update RangeXY streams on the inputs of the shade operation.

streams = param.ClassSelector(allow_refs=False, class_=(<class ‘dict’>, <class ‘list’>), default=[<class ‘holoviews.streams.RangeXY’>], label=’Streams’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba4956c0>)

List of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.

max_samples = param.Integer(allow_refs=False, default=5000, inclusive_bounds=(True, True), label=’Max samples’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba494550>)

Maximum number of samples to display at the same time.

random_seed = param.Integer(allow_refs=False, default=42, inclusive_bounds=(True, True), label=’Random seed’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba494c10>)

Seed used to initialize randomization.

x_range = param.NumericTuple(allow_None=True, allow_refs=False, label=’X range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba495a20>)

The x_range as a tuple of min and max x-value. Auto-ranges if set to None.

y_range = param.NumericTuple(allow_None=True, allow_refs=False, label=’Y range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba497be0>)

The x_range as a tuple of min and max y-value. Auto-ranges if set to None.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.element.factory(*, args, kwargs, output_type, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Simple operation that constructs any element that accepts some other element as input. For instance, RGB and HSV elements can be created from overlays of Image elements.

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

output_type = param.Parameter(allow_refs=False, default=<class ‘holoviews.element.raster.RGB’>, label=’Output type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba497190>)

The output type of the factor operation. By default, if three overlaid Images elements are supplied, the corresponding RGB element will be returned.

args = param.List(allow_refs=False, bounds=(0, None), default=[], label=’Args’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba4966b0>)

The list of positional argument to pass to the factory

kwargs = param.Dict(allow_refs=False, class_=<class ‘dict’>, default={}, label=’Kwargs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba496fb0>)

The dict of keyword arguments to pass to the factory

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

output_type[source]#

alias of RGB

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.element.function(*, args, fn, input_type, kwargs, output_type, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

output_type = param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ‘type’>, label=’Output type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba4da080>)

The output type of the method operation

input_type = param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ‘type’>, label=’Input type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba4dba30>)

The object type the method is defined on

fn = param.Callable(allow_refs=False, label=’Fn’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba4da020>)

The function to apply.

args = param.List(allow_refs=False, bounds=(0, None), default=[], label=’Args’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba4da590>)

The list of positional argument to pass to the method

kwargs = param.Dict(allow_refs=False, class_=<class ‘dict’>, default={}, label=’Kwargs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba4d92a0>)

The dict of keyword arguments to pass to the method

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.element.gradient(*, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Compute the gradient plot of the supplied Image.

If the Image value dimension is cyclic, the smallest step is taken considered the cyclic range

Parameters inherited from:

holoviews.core.operation.Operation: dynamic, input_ranges, link_inputs, streams

group = param.String(allow_refs=False, default=’Gradient’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba4d8460>)

The group assigned to the output gradient matrix.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

output_type[source]#

alias of Image

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.element.gridmatrix(*, chart_type, diagonal_operation, diagonal_type, overlay_dims, name)[source]#

Bases: ParameterizedFunction

The gridmatrix operation takes an Element or HoloMap of Elements as input and creates a GridMatrix object, which plots each dimension in the Element against each other dimension. This provides a very useful overview of high-dimensional data and is inspired by pandas and seaborn scatter_matrix implementations.

chart_type = param.Parameter(allow_refs=False, default=<class ‘holoviews.element.chart.Scatter’>, label=’Chart type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba496ef0>)

The Element type used to display bivariate distributions of the data.

diagonal_type = param.Parameter(allow_None=True, allow_refs=False, label=’Diagonal type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba495fc0>)

The Element type along the diagonal, may be a Histogram or any other plot type which can visualize a univariate distribution. This parameter overrides diagonal_operation.

diagonal_operation = param.Parameter(allow_refs=False, default=<class ‘holoviews.operation.element.histogram’>, label=’Diagonal operation’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba494b80>)

The operation applied along the diagonal, may be a histogram-operation or any other function which returns a viewable element.

overlay_dims = param.List(allow_refs=False, bounds=(0, None), default=[], label=’Overlay dims’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba496e00>)

If a HoloMap is supplied, this will allow overlaying one or more of its key dimensions.

chart_type[source]#

alias of Scatter

diagonal_operation[source]#

alias of histogram

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

class holoviews.operation.element.histogram(*, bin_range, bins, cumulative, dimension, frequency_label, groupby, log, mean_weighted, nonzero, normed, num_bins, style_prefix, weight_dimension, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Returns a Histogram of the input element data, binned into num_bins over the bin_range (if specified) along the specified dimension.

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

bin_range = param.NumericTuple(allow_None=True, allow_refs=False, label=’Bin range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba4dafb0>)

Specifies the range within which to compute the bins.

bins = param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ‘numpy.ndarray’>, <class ‘list’>, <class ‘tuple’>, <class ‘str’>), label=’Bins’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba495d80>)

An explicit set of bin edges or a method to find the optimal set of bin edges, e.g. ‘auto’, ‘fd’, ‘scott’ etc. For more documentation on these approaches see the np.histogram_bin_edges documentation.

cumulative = param.Boolean(allow_refs=False, default=False, label=’Cumulative’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba46f820>)

Whether to compute the cumulative histogram

dimension = param.String(allow_None=True, allow_refs=False, label=’Dimension’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba46e860>)

Along which dimension of the Element to compute the histogram.

frequency_label = param.String(allow_None=True, allow_refs=False, label=’Frequency label’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba494cd0>)

Format string defining the label of the frequency dimension of the Histogram.

groupby = param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ‘str’>, <class ‘holoviews.core.dimension.Dimension’>), label=’Groupby’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba46e530>)

Defines a dimension to group the Histogram returning an NdOverlay of Histograms.

log = param.Boolean(allow_refs=False, default=False, label=’Log’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba495d80>)

Whether to use base 10 logarithmic samples for the bin edges.

mean_weighted = param.Boolean(allow_refs=False, default=False, label=’Mean weighted’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba46fa00>)

Whether the weighted frequencies are averaged.

normed = param.ObjectSelector(allow_refs=False, default=False, label=’Normed’, names={}, nested_refs=False, objects=[True, False, ‘integral’, ‘height’], rx=<param.reactive.reactive_ops object at 0x7f52ba4961a0>)

Controls normalization behavior. If True or ‘integral’, then density=True is passed to np.histogram, and the distribution is normalized such that the integral is unity. If False, then the frequencies will be raw counts. If ‘height’, then the frequencies are normalized such that the max bin height is unity.

nonzero = param.Boolean(allow_refs=False, default=False, label=’Nonzero’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba46f850>)

Whether to use only nonzero values when computing the histogram

num_bins = param.Integer(allow_refs=False, default=20, inclusive_bounds=(True, True), label=’Num bins’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba46e1a0>)

Number of bins in the histogram .

weight_dimension = param.String(allow_None=True, allow_refs=False, label=’Weight dimension’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba494850>)

Name of the dimension the weighting should be drawn from

style_prefix = param.String(allow_None=True, allow_refs=False, label=’Style prefix’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba46dc90>)

Used for setting a common style for histograms in a HoloMap or AdjointLayout.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.element.image_overlay(*, default_range, fill, spec, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Operation to build a overlay of images to a specification from a subset of the required elements.

This is useful for reordering the elements of an overlay, duplicating layers of an overlay or creating blank image elements in the appropriate positions.

For instance, image_overlay may build a three layered input suitable for the RGB factory operation even if supplied with one or two of the required channels (creating blank channels for the missing elements).

Note that if there is any ambiguity regarding the match, the strongest match will be used. In the case of a tie in match strength, the first layer in the input is used. One successful match is always required.

Parameters inherited from:

holoviews.core.operation.Operation: dynamic, input_ranges, link_inputs, streams

group = param.String(allow_refs=False, default=’Transform’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba4db010>)

The group assigned to the resulting overlay.

spec = param.String(allow_refs=False, default=’’, label=’Spec’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba4db160>)

Specification of the output Overlay structure. For instance: Image.R * Image.G * Image.B Will ensure an overlay of this structure is created even if (for instance) only (Image.R * Image.B) is supplied. Elements in the input overlay that match are placed in the appropriate positions and unavailable specification elements are created with the specified fill group.

fill = param.Number(allow_refs=False, default=0, inclusive_bounds=(True, True), label=’Fill’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba4da410>)

default_range = param.Tuple(allow_refs=False, default=(0, 1), label=’Default range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba4d8b50>)

The default range that will be set on the value_dimension of any automatically created blank image elements.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

output_type[source]#

alias of Overlay

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.element.interpolate_curve(*, interpolation, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Resamples a Curve using the defined interpolation method, e.g. to represent changes in y-values as steps.

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

interpolation = param.ObjectSelector(allow_refs=False, default=’steps-mid’, label=’Interpolation’, names={}, nested_refs=False, objects=[‘steps-pre’, ‘steps-mid’, ‘steps-post’, ‘linear’], rx=<param.reactive.reactive_ops object at 0x7f52ba4dbe20>)

Controls the transition point of the step along the x-axis.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.element.method(*, args, input_type, kwargs, method_name, output_type, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Operation that wraps a method call

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

output_type = param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ‘type’>, label=’Output type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba30a560>)

The output type of the method operation

input_type = param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ‘type’>, label=’Input type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba3081c0>)

The object type the method is defined on

method_name = param.String(allow_refs=False, default=’__call__’, label=’Method name’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba30b9d0>)

The method name

args = param.List(allow_refs=False, bounds=(0, None), default=[], label=’Args’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba308580>)

The list of positional argument to pass to the method

kwargs = param.Dict(allow_refs=False, class_=<class ‘dict’>, default={}, label=’Kwargs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba30baf0>)

The dict of keyword arguments to pass to the method

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.element.operation(*, op, output_type, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

The most generic operation that wraps any callable into an Operation. The callable needs to accept an HoloViews component and a key (that may be ignored) and must return a new HoloViews component.

This class may be useful for turning a HoloViews method into an operation to define as compositor operation. For instance, the following definition:

operation.instance(op=lambda x, k: x.collapse(np.subtract))

Could be used to implement a collapse operation to subtracts the data between Rasters in an Overlay.

Parameters inherited from:

holoviews.core.operation.Operation: dynamic, input_ranges, link_inputs, streams

group = param.String(allow_refs=False, default=’Operation’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba4db100>)

The group assigned to the result after having applied the operator.

output_type = param.Parameter(allow_None=True, allow_refs=False, label=’Output type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba3086a0>)

The output element type which may be None to disable type checking. May be used to declare useful information to other code in HoloViews, e.g. required for tab-completion support of operations registered with compositors.

op = param.Callable(allow_refs=False, label=’Op’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba4da740>)

The operation used to generate a new HoloViews object returned by the operation. By default, the identity operation is applied.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.element.threshold(*, high, level, low, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Threshold a given Image whereby all values higher than a given level map to the specified high value and all values lower than that level map to the specified low value.

Parameters inherited from:

holoviews.core.operation.Operation: dynamic, input_ranges, link_inputs, streams

group = param.String(allow_refs=False, default=’Threshold’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba309a80>)

The group assigned to the thresholded output.

level = param.Number(allow_refs=False, default=0.5, inclusive_bounds=(True, True), label=’Level’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba3093f0>)

The value at which the threshold is applied. Values lower than the threshold map to the ‘low’ value and values above map to the ‘high’ value.

high = param.Number(allow_refs=False, default=1.0, inclusive_bounds=(True, True), label=’High’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba308b50>)

The value given to elements greater than (or equal to) the threshold.

low = param.Number(allow_refs=False, default=0.0, inclusive_bounds=(True, True), label=’Low’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba309210>)

The value given to elements below the threshold.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

output_type[source]#

alias of Image

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.element.transform(*, operator, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Generic Operation to transform an input Image or RGBA element into an output Image. The transformation is defined by the supplied callable that accepts the data of the input Image (typically a numpy array) and returns the transformed data of the output Image.

This operator is extremely versatile; for instance, you could implement an alternative to the explicit threshold operator with:

operator=lambda x: np.clip(x, 0, 0.5)

Alternatively, you can implement a transform computing the 2D autocorrelation using the scipy library with:

operator=lambda x: scipy.signal.correlate2d(x, x)

Parameters inherited from:

holoviews.core.operation.Operation: dynamic, input_ranges, link_inputs, streams

group = param.String(allow_refs=False, default=’Transform’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba309ba0>)

The group assigned to the result after applying the transform.

operator = param.Callable(allow_None=True, allow_refs=False, label=’Operator’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba30af50>)

Function of one argument that transforms the data in the input Image to the data in the output Image. By default, acts as the identity function such that the output matches the input.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

output_type[source]#

alias of Image

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.


normalization Module#

Inheritance diagram of holoviews.operation.normalization

Data normalization operations.

Normalizing input data into a valid range is a common operation and often required before further processing. The semantics of normalization are dependent on the element type being normalized making it difficult to provide a general and consistent interface.

The Normalization class is used to define such an interface and subclasses are used to implement the appropriate normalization operations per element type. Unlike display normalization, data normalizations result in transformations to the stored data within each element.

class holoviews.operation.normalization.Normalization(*, data_range, keys, ranges, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Base class for all normalization operation.

This class standardizes how normalization is specified using the ranges and keys parameter. The ranges parameter is designed to be very flexible, allowing a concise description for simple normalization while allowing complex key- and element- specific normalization to also be specified.

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

data_range = param.Boolean(allow_refs=False, default=False, label=’Data range’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba0197b0>)

Whether normalization is allowed to use the minimum and maximum values of the existing data to infer an appropriate range

ranges = param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ‘dict’>, <class ‘list’>), default={}, label=’Ranges’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba01a890>)

The simplest value of this parameter is None to skip all normalization. The next simplest value is an empty dictionary to only applies normalization to Dimensions with explicitly declared ranges. The next most common specification is a dictionary of values and tuple ranges. The value keys are the names of the dimensions to be normalized and the tuple ranges are of form (lower-bound, upper-bound). For instance, you could specify: {‘Height’:(0, 200), ‘z’:(0,1)} In this case, any element with a ‘Height’ or ‘z’ dimension (or both) will be normalized to the supplied ranges. Finally, element-specific normalization may also be specified by supplying a match tuple of form (<type>, <group>, <label>). A 1- or 2-tuple may be supplied by omitting the <group>, <label> or just the <label> components respectively. This tuple key then uses the dictionary value-range specification described above. For instance, you could normalize only the Image elements of group pattern using: {(‘Image’,’Pattern’):{‘Height’:(0, 200), ‘z’:(0,1)}}) Key-wise normalization is possible for all these formats by supplying a list of such dictionary specification that will then be zipped with the keys parameter (if specified).

keys = param.List(allow_None=True, allow_refs=False, bounds=(0, None), label=’Keys’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba0197e0>)

If supplied, this list of keys is zipped with the supplied list of ranges. These keys are used to supply key specific normalization for HoloMaps containing matching key values, enabling per-element normalization.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

get_ranges(element, key)[source]#

Method to get the appropriate normalization range dictionary given a key and element.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, ranges=None, keys=None, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.normalization.raster_normalization(*, data_range, keys, ranges, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Normalization

Normalizes elements of type Raster.

For Raster elements containing (NxM) data, this will normalize the array/matrix into the specified range if value_dimension matches a key in the ranges dictionary.

For elements containing (NxMxD) data, the (NxM) components of the third dimensional are normalized independently if the corresponding value dimensions are selected by the ranges dictionary.

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

holoviews.operation.normalization.Normalization: data_range, ranges, keys

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

get_ranges(element, key)[source]#

Method to get the appropriate normalization range dictionary given a key and element.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, ranges=None, keys=None, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.


resample Module#

Inheritance diagram of holoviews.operation.resample
class holoviews.operation.resample.LinkableOperation(*, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Abstract baseclass for operations supporting linked inputs.

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, streams

link_inputs = param.Boolean(allow_refs=False, default=True, label=’Link inputs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba0a3c40>)

By default, the link_inputs parameter is set to True so that when applying an operation, backends that support linked streams update RangeXY streams on the inputs of the operation. Disable when you do not want the resulting plot to be interactive, e.g. when trying to display an interactive plot a second time.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.resample.ResampleOperation1D(*, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: LinkableOperation

Abstract baseclass for resampling operations

Parameters inherited from:

dynamic = param.Boolean(allow_refs=False, default=True, label=’Dynamic’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba0e8fd0>)

Enables dynamic processing by default.

streams = param.ClassSelector(allow_refs=False, class_=(<class ‘dict’>, <class ‘list’>), default=[<class ‘holoviews.streams.PlotSize’>, <class ‘holoviews.streams.RangeX’>], label=’Streams’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba0e93c0>)

List or dictionary of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.

x_range = param.Tuple(allow_None=True, allow_refs=False, label=’X range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba0e8f70>)

The x_range as a tuple of min and max x-value. Auto-ranges if set to None.

x_sampling = param.Number(allow_None=True, allow_refs=False, inclusive_bounds=(True, True), label=’X sampling’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba0e9930>)

Specifies the smallest allowed sampling interval along the x axis.

width = param.Integer(allow_refs=False, default=400, inclusive_bounds=(True, True), label=’Width’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba0eb490>)

The width of the output image in pixels.

height = param.Integer(allow_refs=False, default=400, inclusive_bounds=(True, True), label=’Height’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba0ea500>)

The height of the output image in pixels.

pixel_ratio = param.Number(allow_None=True, allow_refs=False, bounds=(0, None), inclusive_bounds=(False, False), label=’Pixel ratio’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba0e8eb0>)

Pixel ratio applied to the height and width. Useful for higher resolution screens where the PlotSize stream reports ‘nominal’ dimensions in pixels that do not match the physical pixels. For instance, setting pixel_ratio=2 can give better results on Retina displays. Also useful for using lower resolution for speed. If not set explicitly, the zoom level of the browsers will be used, if available.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.resample.ResampleOperation2D(*, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: ResampleOperation1D

Abstract baseclass for resampling operations

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.resample.LinkableOperation: link_inputs

holoviews.operation.resample.ResampleOperation1D: x_range, x_sampling, width, height, pixel_ratio

dynamic = param.Boolean(allow_refs=False, default=True, label=’Dynamic’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba0eacb0>)

Enables dynamic processing by default.

streams = param.ClassSelector(allow_refs=False, class_=(<class ‘dict’>, <class ‘list’>), default=[<class ‘holoviews.streams.PlotSize’>, <class ‘holoviews.streams.RangeXY’>], label=’Streams’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba0eaa10>)

List or dictionary of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.

expand = param.Boolean(allow_refs=False, default=True, label=’Expand’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba0eb2e0>)

Whether the x_range and y_range should be allowed to expand beyond the extent of the data. Setting this value to True is useful for the case where you want to ensure a certain size of output grid, e.g. if you are doing masking or other arithmetic on the grids. A value of False ensures that the grid is only just as large as it needs to be to contain the data, which will be faster and use less memory if the resulting aggregate is being overlaid on a much larger background.

y_range = param.Tuple(allow_None=True, allow_refs=False, label=’Y range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba0eaad0>)

The y-axis range as a tuple of min and max y value. Auto-ranges if set to None.

y_sampling = param.Number(allow_None=True, allow_refs=False, inclusive_bounds=(True, True), label=’Y sampling’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba0e9c00>)

Specifies the smallest allowed sampling interval along the y axis.

target = param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ‘holoviews.core.data.Dataset’>, label=’Target’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba0a2740>)

A target Dataset which defines the desired x_range, y_range, width and height.

element_type = param.ClassSelector(allow_refs=False, class_=(<class ‘holoviews.core.data.Dataset’>,), default=<class ‘holoviews.element.raster.Image’>, label=’Element type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba0a2b90>)

The type of the returned Elements, must be a 2D Dataset type.

precompute = param.Boolean(allow_refs=False, default=False, label=’Precompute’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52ba0a2b00>)

Whether to apply precomputing operations. Precomputing can speed up resampling operations by avoiding unnecessary recomputation if the supplied element does not change between calls. The cost of enabling this option is that the memory used to represent this internal state is not freed between calls.

element_type[source]#

alias of Image

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.


stats Module#

Inheritance diagram of holoviews.operation.stats
class holoviews.operation.stats.bivariate_kde(*, bandwidth, bw_method, contours, cut, filled, levels, n_samples, x_range, y_range, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Computes a 2D kernel density estimate (KDE) of the first two dimensions in the input data. Kernel density estimation is a non-parametric way to estimate the probability density function of a random variable.

The KDE works by placing 2D Gaussian kernel at each sample with the supplied bandwidth. These kernels are then summed to produce the density estimate. By default a good bandwidth is determined using the bw_method but it may be overridden by an explicit value.

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

contours = param.Boolean(allow_refs=False, default=True, label=’Contours’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9f8ac50>)

Whether to compute contours from the KDE, determines whether to return an Image or Contours/Polygons.

bw_method = param.ObjectSelector(allow_refs=False, default=’scott’, label=’Bw method’, names={}, nested_refs=False, objects=[‘scott’, ‘silverman’], rx=<param.reactive.reactive_ops object at 0x7f52b9f8a9e0>)

Method of automatically determining KDE bandwidth

bandwidth = param.Number(allow_None=True, allow_refs=False, inclusive_bounds=(True, True), label=’Bandwidth’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9f8ac20>)

Allows supplying explicit bandwidth value rather than relying on scott or silverman method.

cut = param.Number(allow_refs=False, default=3, inclusive_bounds=(True, True), label=’Cut’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9f8a9e0>)

Draw the estimate to cut * bw from the extreme data points.

filled = param.Boolean(allow_refs=False, default=False, label=’Filled’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9f8ae60>)

Controls whether to return filled or unfilled contours.

levels = param.ClassSelector(allow_refs=False, class_=(<class ‘list’>, <class ‘int’>), default=10, label=’Levels’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9f8a9b0>)

A list of scalar values used to specify the contour levels.

n_samples = param.Integer(allow_refs=False, default=100, inclusive_bounds=(True, True), label=’N samples’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9f8abf0>)

Number of samples to compute the KDE over.

x_range = param.NumericTuple(allow_None=True, allow_refs=False, label=’X range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9f8ae30>)

The x_range as a tuple of min and max x-value. Auto-ranges if set to None.

y_range = param.NumericTuple(allow_None=True, allow_refs=False, label=’Y range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9f8abc0>)

The x_range as a tuple of min and max y-value. Auto-ranges if set to None.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.stats.univariate_kde(*, bandwidth, bin_range, bw_method, cut, dimension, filled, groupby, n_samples, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Computes a 1D kernel density estimate (KDE) along the supplied dimension. Kernel density estimation is a non-parametric way to estimate the probability density function of a random variable.

The KDE works by placing a Gaussian kernel at each sample with the supplied bandwidth. These kernels are then summed to produce the density estimate. By default a good bandwidth is determined using the bw_method but it may be overridden by an explicit value.

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

bw_method = param.ObjectSelector(allow_refs=False, default=’scott’, label=’Bw method’, names={}, nested_refs=False, objects=[‘scott’, ‘silverman’], rx=<param.reactive.reactive_ops object at 0x7f52b9f8b9d0>)

Method of automatically determining KDE bandwidth

bandwidth = param.Number(allow_None=True, allow_refs=False, inclusive_bounds=(True, True), label=’Bandwidth’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9f8b610>)

Allows supplying explicit bandwidth value rather than relying on scott or silverman method.

cut = param.Number(allow_refs=False, default=3, inclusive_bounds=(True, True), label=’Cut’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9f8b9d0>)

Draw the estimate to cut * bw from the extreme data points.

bin_range = param.NumericTuple(allow_None=True, allow_refs=False, label=’Bin range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9f8b5e0>)

Specifies the range within which to compute the KDE.

dimension = param.String(allow_None=True, allow_refs=False, label=’Dimension’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9f8b9a0>)

Along which dimension of the Element to compute the KDE.

filled = param.Boolean(allow_refs=False, default=True, label=’Filled’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9f8b310>)

Controls whether to return filled or unfilled KDE.

n_samples = param.Integer(allow_refs=False, default=100, inclusive_bounds=(True, True), label=’N samples’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9f8bac0>)

Number of samples to compute the KDE over.

groupby = param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ‘str’>, <class ‘holoviews.core.dimension.Dimension’>), label=’Groupby’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9f8b400>)

Defines a dimension to group the Histogram returning an NdOverlay of Histograms.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.


timeseries Module#

Inheritance diagram of holoviews.operation.timeseries
class holoviews.operation.timeseries.RollingBase(*, center, min_periods, rolling_window, name)[source]#

Bases: Parameterized

Parameters shared between rolling and rolling_outlier_std.

center = param.Boolean(allow_refs=False, default=True, label=’Center’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9e54130>)

Whether to set the x-coordinate at the center or right edge of the window.

min_periods = param.Integer(allow_None=True, allow_refs=False, inclusive_bounds=(True, True), label=’Min periods’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9e54370>)

Minimum number of observations in window required to have a value (otherwise result is NaN).

rolling_window = param.Integer(allow_refs=False, default=10, inclusive_bounds=(True, True), label=’Rolling window’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9e54130>)

The window size over which to operate.

class holoviews.operation.timeseries.resample(*, closed, function, label, rule, dynamic, group, input_ranges, link_inputs, streams, name)[source]#

Bases: Operation

Resamples a timeseries of dates with a frequency and function.

Parameters inherited from:

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

closed = param.ObjectSelector(allow_None=True, allow_refs=False, label=’Closed’, names={}, nested_refs=False, objects=[‘left’, ‘right’], rx=<param.reactive.reactive_ops object at 0x7f52b9e54ee0>)

Which side of bin interval is closed

function = param.Callable(allow_refs=False, default=<function mean at 0x7f5303b65f30>, label=’Function’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9e55120>)

Function for computing new values out of existing ones.

label = param.ObjectSelector(allow_refs=False, default=’right’, label=’Label’, names={}, nested_refs=False, objects=[‘right’], rx=<param.reactive.reactive_ops object at 0x7f52b9e54f10>)

The bin edge to label the bin with.

rule = param.String(allow_refs=False, default=’D’, label=’Rule’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9e55150>)

A string representing the time interval over which to apply the resampling

function(axis=None, dtype=None, out=None, keepdims=<no value>, *, where=<no value>)[source]#

Compute the arithmetic mean along the specified axis.

Returns the average of the array elements. The average is taken over the flattened array by default, otherwise over the specified axis. float64 intermediate and return values are used for integer inputs.

Parameters#

aarray_like

Array containing numbers whose mean is desired. If a is not an array, a conversion is attempted.

axisNone or int or tuple of ints, optional

Axis or axes along which the means are computed. The default is to compute the mean of the flattened array.

New in version 1.7.0.

If this is a tuple of ints, a mean is performed over multiple axes, instead of a single axis or all the axes as before.

dtypedata-type, optional

Type to use in computing the mean. For integer inputs, the default is float64; for floating point inputs, it is the same as the input dtype.

outndarray, optional

Alternate output array in which to place the result. The default is None; if provided, it must have the same shape as the expected output, but the type will be cast if necessary. See ufuncs-output-type for more details.

keepdimsbool, optional

If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.

If the default value is passed, then keepdims will not be passed through to the mean method of sub-classes of ndarray, however any non-default value will be. If the sub-class’ method does not implement keepdims any exceptions will be raised.

wherearray_like of bool, optional

Elements to include in the mean. See ~numpy.ufunc.reduce for details.

New in version 1.20.0.

Returns#

mndarray, see dtype parameter above

If out=None, returns a new array containing the mean values, otherwise a reference to the output array is returned.

See Also#

average : Weighted average std, var, nanmean, nanstd, nanvar

Notes#

The arithmetic mean is the sum of the elements along the axis divided by the number of elements.

Note that for floating-point input, the mean is computed using the same precision the input has. Depending on the input data, this can cause the results to be inaccurate, especially for float32 (see example below). Specifying a higher-precision accumulator using the dtype keyword can alleviate this issue.

By default, float16 results are computed using float32 intermediates for extra precision.

Examples#

>>> a = np.array([[1, 2], [3, 4]])
>>> np.mean(a)
2.5
>>> np.mean(a, axis=0)
array([2., 3.])
>>> np.mean(a, axis=1)
array([1.5, 3.5])

In single precision, mean can be inaccurate:

>>> a = np.zeros((2, 512*512), dtype=np.float32)
>>> a[0, :] = 1.0
>>> a[1, :] = 0.1
>>> np.mean(a)
0.54999924

Computing the mean in float64 is more accurate:

>>> np.mean(a, dtype=np.float64)
0.55000000074505806 # may vary

Specifying a where argument:

>>> a = np.array([[5, 9, 13], [14, 10, 12], [11, 15, 19]])
>>> np.mean(a)
12.0
>>> np.mean(a, where=[[True], [False], [False]])
9.0
classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.timeseries.rolling(*, function, window_type, dynamic, group, input_ranges, link_inputs, streams, center, min_periods, rolling_window, name)[source]#

Bases: Operation, RollingBase

Applies a function over a rolling window.

Parameters inherited from:

holoviews.operation.timeseries.RollingBase: center, min_periods, rolling_window

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

window_type = param.ObjectSelector(allow_None=True, allow_refs=False, label=’Window type’, names={}, nested_refs=False, objects=[‘boxcar’, ‘triang’, ‘blackman’, ‘hamming’, ‘bartlett’, ‘parzen’, ‘bohman’, ‘blackmanharris’, ‘nuttall’, ‘barthann’, ‘kaiser’, ‘gaussian’, ‘general_gaussian’, ‘slepian’], rx=<param.reactive.reactive_ops object at 0x7f52b9e562c0>)

The shape of the window to apply

function = param.Callable(allow_refs=False, default=<function mean at 0x7f5303b65f30>, label=’Function’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9e562f0>)

The function to apply over the rolling window.

function(axis=None, dtype=None, out=None, keepdims=<no value>, *, where=<no value>)[source]#

Compute the arithmetic mean along the specified axis.

Returns the average of the array elements. The average is taken over the flattened array by default, otherwise over the specified axis. float64 intermediate and return values are used for integer inputs.

Parameters#

aarray_like

Array containing numbers whose mean is desired. If a is not an array, a conversion is attempted.

axisNone or int or tuple of ints, optional

Axis or axes along which the means are computed. The default is to compute the mean of the flattened array.

New in version 1.7.0.

If this is a tuple of ints, a mean is performed over multiple axes, instead of a single axis or all the axes as before.

dtypedata-type, optional

Type to use in computing the mean. For integer inputs, the default is float64; for floating point inputs, it is the same as the input dtype.

outndarray, optional

Alternate output array in which to place the result. The default is None; if provided, it must have the same shape as the expected output, but the type will be cast if necessary. See ufuncs-output-type for more details.

keepdimsbool, optional

If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.

If the default value is passed, then keepdims will not be passed through to the mean method of sub-classes of ndarray, however any non-default value will be. If the sub-class’ method does not implement keepdims any exceptions will be raised.

wherearray_like of bool, optional

Elements to include in the mean. See ~numpy.ufunc.reduce for details.

New in version 1.20.0.

Returns#

mndarray, see dtype parameter above

If out=None, returns a new array containing the mean values, otherwise a reference to the output array is returned.

See Also#

average : Weighted average std, var, nanmean, nanstd, nanvar

Notes#

The arithmetic mean is the sum of the elements along the axis divided by the number of elements.

Note that for floating-point input, the mean is computed using the same precision the input has. Depending on the input data, this can cause the results to be inaccurate, especially for float32 (see example below). Specifying a higher-precision accumulator using the dtype keyword can alleviate this issue.

By default, float16 results are computed using float32 intermediates for extra precision.

Examples#

>>> a = np.array([[1, 2], [3, 4]])
>>> np.mean(a)
2.5
>>> np.mean(a, axis=0)
array([2., 3.])
>>> np.mean(a, axis=1)
array([1.5, 3.5])

In single precision, mean can be inaccurate:

>>> a = np.zeros((2, 512*512), dtype=np.float32)
>>> a[0, :] = 1.0
>>> a[1, :] = 0.1
>>> np.mean(a)
0.54999924

Computing the mean in float64 is more accurate:

>>> np.mean(a, dtype=np.float64)
0.55000000074505806 # may vary

Specifying a where argument:

>>> a = np.array([[5, 9, 13], [14, 10, 12], [11, 15, 19]])
>>> np.mean(a)
12.0
>>> np.mean(a, where=[[True], [False], [False]])
9.0
classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

class holoviews.operation.timeseries.rolling_outlier_std(*, sigma, dynamic, group, input_ranges, link_inputs, streams, center, min_periods, rolling_window, name)[source]#

Bases: Operation, RollingBase

Detect outliers using the standard deviation within a rolling window.

Outliers are the array elements outside sigma standard deviations from the smoothed trend line, as calculated from the trend line residuals.

The rolling window is controlled by parameters shared with the rolling operation via the base class RollingBase, to make it simpler to use the same settings for both.

Parameters inherited from:

holoviews.operation.timeseries.RollingBase: center, min_periods, rolling_window

holoviews.core.operation.Operation: group, dynamic, input_ranges, link_inputs, streams

sigma = param.Number(allow_refs=False, default=2.0, inclusive_bounds=(True, True), label=’Sigma’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x7f52b9e54730>)

Minimum sigma before a value is considered an outlier.

classmethod get_overlay_bounds(overlay)[source]#

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label(overlay, default_label='')[source]#

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

classmethod instance(**params)[source]#

Return an instance of this class, copying parameters from any existing instance provided.

process_element(element, key, **params)[source]#

The process_element method allows a single element to be operated on given an externally supplied key.

classmethod search(element, pattern)[source]#

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.