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: param.parameterized.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(default=’data’, objects=[‘data’, ‘display’])

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

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

Defines which backends to apply the Compositor for.

operation = param.Parameter()

The Operation to apply when collapsing overlays.

pattern = param.String(default=’’)

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 overlayed 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(default=’’)

The group identifier for the output of this particular compositor

kwargs = param.Dict(class_=<class ‘dict’>)

Optional set of parameters to pass to the operation.

transfer_options = param.Boolean(bounds=(0, 1), default=False)

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

transfer_parameters = param.Boolean(bounds=(0, 1), default=False)

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(*args, **params)[source]

Bases: param.parameterized.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(default=’Operation’)

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

dynamic = param.ObjectSelector(default=’default’, objects=[‘default’, True, False])

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(class_=(<class ‘dict’>, <class ‘tuple’>), default={})

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(bounds=(0, 1), default=False)

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.List(bounds=(0, None), default=[])

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.

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

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

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

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(*args, **params)[source]

Bases: holoviews.core.operation.Operation

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

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

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

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

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

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

Parameters inherited from:

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

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

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

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.chain(*args, **params)[source]

Bases: holoviews.core.operation.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(default=’’)

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(default=<class ‘holoviews.element.raster.Image’>)

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

operations = param.List(bounds=(0, None), class_=<class ‘holoviews.core.operation.Operation’>, default=[])

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

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

output_type

alias of holoviews.element.raster.Image

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.collapse(*args, **params)[source]

Bases: holoviews.core.operation.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()

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

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.

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.

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.

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

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.

>>> 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
classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.contours(*args, **params)[source]

Bases: holoviews.core.operation.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(default=’Level’)

The group assigned to the output contours.

levels = param.ClassSelector(class_=(<class ‘list’>, <class ‘int’>), default=10)

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

filled = param.Boolean(bounds=(0, 1), default=False)

Whether to generate filled contours

overlaid = param.Boolean(bounds=(0, 1), default=False)

Whether to overlay the contour on the supplied Element.

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

output_type

alias of holoviews.core.overlay.Overlay

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.convolve(*args, **params)[source]

Bases: holoviews.core.operation.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(default=’Convolution’)

The group assigned to the convolved output.

kernel_roi = param.NumericTuple(default=(0, 0, 0, 0), length=4)

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)

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

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

instance(**params)

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

output_type

alias of holoviews.element.raster.Image

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.decimate(*args, **params)[source]

Bases: holoviews.core.operation.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(bounds=(0, 1), default=True)

Enables dynamic processing by default.

link_inputs = param.Boolean(bounds=(0, 1), default=True)

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.List(bounds=(0, None), default=[<class ‘holoviews.streams.RangeXY’>])

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

max_samples = param.Integer(default=5000, inclusive_bounds=(True, True))

Maximum number of samples to display at the same time.

random_seed = param.Integer(default=42, inclusive_bounds=(True, True))

Seed used to initialize randomization.

x_range = param.NumericTuple(length=2)

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

y_range = param.NumericTuple(length=2)

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

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.factory(*args, **params)[source]

Bases: holoviews.core.operation.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(default=<class ‘holoviews.element.raster.RGB’>)

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(bounds=(0, None), default=[])

The list of positional argument to pass to the factory

kwargs = param.Dict(class_=<class ‘dict’>, default={})

The dict of keyword arguments to pass to the factory

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

output_type

alias of holoviews.element.raster.RGB

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.function(*args, **params)[source]

Bases: holoviews.core.operation.Operation

Parameters inherited from:

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

output_type = param.ClassSelector(class_=<class ‘type’>)

The output type of the method operation

input_type = param.ClassSelector(class_=<class ‘type’>)

The object type the method is defined on

fn = param.Callable()

The function to apply.

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

The list of positional argument to pass to the method

kwargs = param.Dict(class_=<class ‘dict’>, default={})

The dict of keyword arguments to pass to the method

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.gradient(*args, **params)[source]

Bases: holoviews.core.operation.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(default=’Gradient’)

The group assigned to the output gradient matrix.

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

output_type

alias of holoviews.element.raster.Image

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.histogram(*args, **params)[source]

Bases: holoviews.core.operation.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(length=2)

Specifies the range within which to compute the bins.

bins = param.ClassSelector(class_=(<class ‘numpy.ndarray’>, <class ‘list’>, <class ‘tuple’>, <class ‘str’>))

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(bounds=(0, 1), default=False)

Whether to compute the cumulative histogram

dimension = param.String()

Along which dimension of the Element to compute the histogram.

frequency_label = param.String()

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

groupby = param.ClassSelector(class_=(<class ‘str’>, <class ‘holoviews.core.dimension.Dimension’>))

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

log = param.Boolean(bounds=(0, 1), default=False)

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

mean_weighted = param.Boolean(bounds=(0, 1), default=False)

Whether the weighted frequencies are averaged.

normed = param.ObjectSelector(default=True, objects=[True, False, ‘integral’, ‘height’])

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(bounds=(0, 1), default=False)

Whether to use only nonzero values when computing the histogram

num_bins = param.Integer(default=20, inclusive_bounds=(True, True))

Number of bins in the histogram .

weight_dimension = param.String()

Name of the dimension the weighting should be drawn from

style_prefix = param.String()

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

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.image_overlay(*args, **params)[source]

Bases: holoviews.core.operation.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(default=’Transform’)

The group assigned to the resulting overlay.

spec = param.String(default=’’)

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(default=0, inclusive_bounds=(True, True))

default_range = param.Tuple(default=(0, 1), length=2)

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

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

output_type

alias of holoviews.core.overlay.Overlay

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.interpolate_curve(*args, **params)[source]

Bases: holoviews.core.operation.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(default=’steps-mid’, objects=[‘steps-pre’, ‘steps-mid’, ‘steps-post’, ‘linear’])

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

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.method(*args, **params)[source]

Bases: holoviews.core.operation.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(class_=<class ‘type’>)

The output type of the method operation

input_type = param.ClassSelector(class_=<class ‘type’>)

The object type the method is defined on

method_name = param.String(default=’__call__’)

The method name

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

The list of positional argument to pass to the method

kwargs = param.Dict(class_=<class ‘dict’>, default={})

The dict of keyword arguments to pass to the method

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.operation(*args, **params)[source]

Bases: holoviews.core.operation.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(default=’Operation’)

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

output_type = param.Parameter()

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

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)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.threshold(*args, **params)[source]

Bases: holoviews.core.operation.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(default=’Threshold’)

The group assigned to the thresholded output.

level = param.Number(default=0.5, inclusive_bounds=(True, True))

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(default=1.0, inclusive_bounds=(True, True))

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

low = param.Number(default=0.0, inclusive_bounds=(True, True))

The value given to elements below the threshold.

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

output_type

alias of holoviews.element.raster.Image

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.transform(*args, **params)[source]

Bases: holoviews.core.operation.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(default=’Transform’)

The group assigned to the result after applying the transform.

operator = param.Callable()

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)

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

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

instance(**params)

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

output_type

alias of holoviews.element.raster.Image

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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


datashader Module

Inheritance diagram of holoviews.operation.datashader
class holoviews.operation.datashader.AggregationOperation(*args, **params)[source]

Bases: holoviews.operation.datashader.ResamplingOperation

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

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.datashader.LinkableOperation: link_inputs

holoviews.operation.datashader.ResamplingOperation: dynamic, streams, expand, height, width, x_range, y_range, x_sampling, y_sampling, target, element_type, precompute

aggregator = param.ClassSelector(class_=(<class ‘datashader.reductions.Reduction’>, <class ‘str’>), default=<datashader.reductions.count object at 0x7feea28d8050>)

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

alias of holoviews.element.raster.Image

classmethod get_overlay_bounds(overlay)

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

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.datashader.LinkableOperation(*args, **params)[source]

Bases: holoviews.core.operation.Operation

Abstract baseclass for operations supporting linked inputs.

Parameters inherited from:

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

link_inputs = param.Boolean(bounds=(0, 1), default=True)

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)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.datashader.ResamplingOperation(*args, **params)[source]

Bases: holoviews.operation.datashader.LinkableOperation

Abstract baseclass for resampling operations

Parameters inherited from:

dynamic = param.Boolean(bounds=(0, 1), default=True)

Enables dynamic processing by default.

streams = param.List(bounds=(0, None), default=[<class ‘holoviews.streams.PlotSize’>, <class ‘holoviews.streams.RangeXY’>])

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

expand = param.Boolean(bounds=(0, 1), default=True)

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.

height = param.Integer(default=400, inclusive_bounds=(True, True))

The height of the output image in pixels.

width = param.Integer(default=400, inclusive_bounds=(True, True))

The width of the output image in pixels.

x_range = param.Tuple(length=2)

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

y_range = param.Tuple(length=2)

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

x_sampling = param.Number(inclusive_bounds=(True, True))

Specifies the smallest allowed sampling interval along the x axis.

y_sampling = param.Number(inclusive_bounds=(True, True))

Specifies the smallest allowed sampling interval along the y axis.

target = param.ClassSelector(class_=<class ‘holoviews.core.data.Dataset’>)

A target Dataset which defines the desired x_range, y_range, width and height.

element_type = param.ClassSelector(class_=(<class ‘holoviews.core.data.Dataset’>,), default=<class ‘holoviews.element.raster.Image’>)

The type of the returned Elements, must be a 2D Dataset type.

precompute = param.Boolean(bounds=(0, 1), default=False)

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

alias of holoviews.element.raster.Image

classmethod get_overlay_bounds(overlay)

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

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.datashader.SpreadingOperation(*args, **params)[source]

Bases: holoviews.operation.datashader.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:

how = param.ObjectSelector(default=’source’, objects=[‘source’, ‘over’, ‘saturate’, ‘add’])

The name of the compositing operator to use when combining pixels.

shape = param.ObjectSelector(default=’circle’, objects=[‘circle’, ‘square’])

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

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.datashader.aggregate(*args, **params)[source]

Bases: holoviews.operation.datashader.AggregationOperation

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.datashader.LinkableOperation: link_inputs

holoviews.operation.datashader.ResamplingOperation: dynamic, streams, expand, height, width, x_range, y_range, x_sampling, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: aggregator

element_type

alias of holoviews.element.raster.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)

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

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.datashader.area_aggregate(*args, **params)[source]

Bases: holoviews.operation.datashader.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.datashader.LinkableOperation: link_inputs

holoviews.operation.datashader.ResamplingOperation: dynamic, streams, expand, height, width, x_range, y_range, x_sampling, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: aggregator

element_type

alias of holoviews.element.raster.Image

classmethod get_overlay_bounds(overlay)

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

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.datashader.bundle_graph(*args, **params)[source]

Bases: holoviews.operation.datashader._connect_edges, datashader.bundling.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)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.datashader.contours_rasterize(*args, **params)[source]

Bases: holoviews.operation.datashader.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.datashader.LinkableOperation: link_inputs

holoviews.operation.datashader.ResamplingOperation: dynamic, streams, expand, height, width, x_range, y_range, x_sampling, y_sampling, target, element_type, precompute

aggregator = param.ClassSelector(class_=(<class ‘datashader.reductions.Reduction’>, <class ‘str’>), default=<datashader.reductions.mean object at 0x7feea046a410>)

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

alias of holoviews.element.raster.Image

classmethod get_agg_data(obj, category=None)

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

classmethod get_overlay_bounds(overlay)

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

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.datashader.datashade(*args, **params)[source]

Bases: holoviews.operation.datashader.rasterize, holoviews.operation.datashader.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.datashader.LinkableOperation: link_inputs

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

holoviews.operation.datashader.ResamplingOperation: dynamic, streams, expand, height, width, x_range, y_range, x_sampling, y_sampling, target, element_type, precompute

holoviews.operation.datashader.rasterize: aggregator, interpolation

classmethod concatenate(overlay)

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

element_type

alias of holoviews.element.raster.Image

classmethod get_overlay_bounds(overlay)

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

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

classmethod rgb2hex(rgb)

Convert RGB(A) tuple to hex.

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

classmethod uint32_to_uint8(img)

Cast uint32 RGB image to 4 uint8 channels.

classmethod uint32_to_uint8_xr(img)

Cast uint32 xarray DataArray to 4 uint8 channels.

class holoviews.operation.datashader.directly_connect_edges(*args, **params)[source]

Bases: holoviews.operation.datashader._connect_edges, datashader.bundling.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)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.datashader.dynspread(*args, **params)[source]

Bases: holoviews.operation.datashader.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(default=3, inclusive_bounds=(True, True))

Maximum number of pixels to spread on all sides.

threshold = param.Number(bounds=(0, 1), default=0.5, inclusive_bounds=(True, True))

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)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.datashader.geometry_rasterize(*args, **params)[source]

Bases: holoviews.operation.datashader.AggregationOperation

Rasterizes geometries by converting them to spatialpandas.

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.datashader.LinkableOperation: link_inputs

holoviews.operation.datashader.ResamplingOperation: dynamic, streams, expand, height, width, x_range, y_range, x_sampling, y_sampling, target, element_type, precompute

aggregator = param.ClassSelector(class_=(<class ‘datashader.reductions.Reduction’>, <class ‘str’>), default=<datashader.reductions.mean object at 0x7feea046a890>)

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

alias of holoviews.element.raster.Image

classmethod get_overlay_bounds(overlay)

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

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.datashader.overlay_aggregate(*args, **params)[source]

Bases: holoviews.operation.datashader.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.datashader.LinkableOperation: link_inputs

holoviews.operation.datashader.ResamplingOperation: dynamic, streams, expand, height, width, x_range, y_range, x_sampling, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: aggregator

element_type

alias of holoviews.element.raster.Image

classmethod get_agg_data(obj, category=None)

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

classmethod get_overlay_bounds(overlay)

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

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.datashader.quadmesh_rasterize(*args, **params)[source]

Bases: holoviews.operation.datashader.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.datashader.LinkableOperation: link_inputs

holoviews.operation.datashader.ResamplingOperation: dynamic, streams, expand, height, width, x_range, y_range, x_sampling, y_sampling, target, element_type, precompute

holoviews.operation.datashader.trimesh_rasterize: aggregator, interpolation

element_type

alias of holoviews.element.raster.Image

classmethod get_agg_data(obj, category=None)

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

classmethod get_overlay_bounds(overlay)

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

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.datashader.rasterize(*args, **params)[source]

Bases: holoviews.operation.datashader.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.datashader.LinkableOperation: link_inputs

holoviews.operation.datashader.ResamplingOperation: dynamic, streams, expand, height, width, x_range, y_range, x_sampling, y_sampling, target, element_type, precompute

aggregator = param.ClassSelector(class_=(<class ‘datashader.reductions.Reduction’>, <class ‘str’>), default=’default’)

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(default=’default’, objects=[‘default’, ‘linear’, ‘nearest’, ‘bilinear’, None, False])

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

element_type

alias of holoviews.element.raster.Image

classmethod get_overlay_bounds(overlay)

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

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.datashader.regrid(*args, **params)[source]

Bases: holoviews.operation.datashader.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.datashader.LinkableOperation: link_inputs

holoviews.operation.datashader.ResamplingOperation: dynamic, streams, height, width, x_range, y_range, x_sampling, y_sampling, target, element_type, precompute

expand = param.Boolean(bounds=(0, 1), default=False)

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(class_=(<class ‘datashader.reductions.Reduction’>, <class ‘str’>), default=<datashader.reductions.mean object at 0x7feea046a350>)

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(default=’nearest’, objects=[‘linear’, ‘nearest’, ‘bilinear’, None, False])

Interpolation method

upsample = param.Boolean(bounds=(0, 1), default=False)

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

alias of holoviews.element.raster.Image

classmethod get_overlay_bounds(overlay)

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

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.datashader.segments_aggregate(*args, **params)[source]

Bases: holoviews.operation.datashader.AggregationOperation

Aggregates Segments elements.

Parameters inherited from:

holoviews.core.operation.Operation: group, input_ranges

holoviews.operation.datashader.LinkableOperation: link_inputs

holoviews.operation.datashader.ResamplingOperation: dynamic, streams, expand, height, width, x_range, y_range, x_sampling, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: aggregator

element_type

alias of holoviews.element.raster.Image

classmethod get_overlay_bounds(overlay)

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

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.datashader.shade(*args, **params)[source]

Bases: holoviews.operation.datashader.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:

alpha = param.Integer(bounds=(0, 255), default=255, inclusive_bounds=(True, True))

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(class_=(<class ‘collections.abc.Iterable’>, <class ‘collections.abc.Callable’>, <class ‘dict’>))

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(class_=(<class ‘collections.abc.Iterable’>, <class ‘collections.abc.Callable’>, <class ‘dict’>))

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.

normalization = param.ClassSelector(class_=(<class ‘str’>, <class ‘collections.abc.Callable’>), default=’eq_hist’)

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(length=2)

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

min_alpha = param.Number(bounds=(0, 255), default=40, inclusive_bounds=(True, True))

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

classmethod concatenate(overlay)[source]

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

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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.

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

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(*args, **params)[source]

Bases: holoviews.operation.datashader.AggregationOperation

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.datashader.LinkableOperation: link_inputs

holoviews.operation.datashader.ResamplingOperation: dynamic, streams, expand, height, width, x_range, y_range, x_sampling, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: aggregator

spike_length = param.Number(inclusive_bounds=(True, True))

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

offset = param.Number(default=0.0, inclusive_bounds=(True, True))

The offset of the lower end of each spike.

element_type

alias of holoviews.element.raster.Image

classmethod get_overlay_bounds(overlay)

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

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

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

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

class holoviews.operation.datashader.spread(*args, **params)[source]

Bases: holoviews.operation.datashader.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(default=1, inclusive_bounds=(True, True))

Number of pixels to spread on all sides.

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.datashader.spread_aggregate(*args, **params)[source]

Bases: holoviews.operation.datashader.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.datashader.LinkableOperation: link_inputs

holoviews.operation.datashader.ResamplingOperation: dynamic, streams, expand, height, width, x_range, y_range, x_sampling, y_sampling, target, element_type, precompute

holoviews.operation.datashader.AggregationOperation: aggregator

element_type

alias of holoviews.element.raster.Image

classmethod get_overlay_bounds(overlay)

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

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.datashader.stack(*args, **params)[source]

Bases: holoviews.core.operation.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(default=’over’, objects=[‘add’, ‘over’, ‘saturate’, ‘source’])

Defines how the compositing operation combines the images

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.datashader.trimesh_rasterize(*args, **params)[source]

Bases: holoviews.operation.datashader.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.datashader.LinkableOperation: link_inputs

holoviews.operation.datashader.ResamplingOperation: dynamic, streams, expand, height, width, x_range, y_range, x_sampling, y_sampling, target, element_type, precompute

aggregator = param.ClassSelector(class_=(<class ‘datashader.reductions.Reduction’>, <class ‘str’>), default=<datashader.reductions.mean object at 0x7feea046a5d0>)

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(default=’bilinear’, objects=[‘bilinear’, ‘linear’, None, False])

The interpolation method to apply during rasterization.

element_type

alias of holoviews.element.raster.Image

classmethod get_agg_data(obj, category=None)

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

classmethod get_overlay_bounds(overlay)

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

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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


element Module

Inheritance diagram of holoviews.operation.element

Collection of either extremely generic or simple Operation examples.

class holoviews.operation.element.apply_when(*args, **params)[source]

Bases: param.parameterized.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()

predicate = param.Callable()

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

class holoviews.operation.element.chain(*args, **params)[source]

Bases: holoviews.core.operation.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(default=’’)

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(default=<class ‘holoviews.element.raster.Image’>)

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

operations = param.List(bounds=(0, None), class_=<class ‘holoviews.core.operation.Operation’>, default=[])

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

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

output_type

alias of holoviews.element.raster.Image

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.element.collapse(*args, **params)[source]

Bases: holoviews.core.operation.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()

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

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.

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.

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.

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

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.

>>> 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
classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.element.contours(*args, **params)[source]

Bases: holoviews.core.operation.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(default=’Level’)

The group assigned to the output contours.

levels = param.ClassSelector(class_=(<class ‘list’>, <class ‘int’>), default=10)

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

filled = param.Boolean(bounds=(0, 1), default=False)

Whether to generate filled contours

overlaid = param.Boolean(bounds=(0, 1), default=False)

Whether to overlay the contour on the supplied Element.

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

output_type

alias of holoviews.core.overlay.Overlay

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.element.convolve(*args, **params)[source]

Bases: holoviews.core.operation.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(default=’Convolution’)

The group assigned to the convolved output.

kernel_roi = param.NumericTuple(default=(0, 0, 0, 0), length=4)

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)

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

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

instance(**params)

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

output_type

alias of holoviews.element.raster.Image

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.element.decimate(*args, **params)[source]

Bases: holoviews.core.operation.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(bounds=(0, 1), default=True)

Enables dynamic processing by default.

link_inputs = param.Boolean(bounds=(0, 1), default=True)

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.List(bounds=(0, None), default=[<class ‘holoviews.streams.RangeXY’>])

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

max_samples = param.Integer(default=5000, inclusive_bounds=(True, True))

Maximum number of samples to display at the same time.

random_seed = param.Integer(default=42, inclusive_bounds=(True, True))

Seed used to initialize randomization.

x_range = param.NumericTuple(length=2)

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

y_range = param.NumericTuple(length=2)

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

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.element.factory(*args, **params)[source]

Bases: holoviews.core.operation.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(default=<class ‘holoviews.element.raster.RGB’>)

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(bounds=(0, None), default=[])

The list of positional argument to pass to the factory

kwargs = param.Dict(class_=<class ‘dict’>, default={})

The dict of keyword arguments to pass to the factory

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

output_type

alias of holoviews.element.raster.RGB

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.element.function(*args, **params)[source]

Bases: holoviews.core.operation.Operation

Parameters inherited from:

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

output_type = param.ClassSelector(class_=<class ‘type’>)

The output type of the method operation

input_type = param.ClassSelector(class_=<class ‘type’>)

The object type the method is defined on

fn = param.Callable()

The function to apply.

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

The list of positional argument to pass to the method

kwargs = param.Dict(class_=<class ‘dict’>, default={})

The dict of keyword arguments to pass to the method

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.element.gradient(*args, **params)[source]

Bases: holoviews.core.operation.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(default=’Gradient’)

The group assigned to the output gradient matrix.

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

output_type

alias of holoviews.element.raster.Image

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.element.gridmatrix(*args, **params)[source]

Bases: param.parameterized.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(default=<class ‘holoviews.element.chart.Scatter’>)

The Element type used to display bivariate distributions of the data.

diagonal_type = param.Parameter()

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(default=<class ‘holoviews.operation.element.histogram’>)

The operation applied along the diagonal, may be a histogram-operation or any other function which returns a viewable element.

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

If a HoloMap is supplied this will allow overlaying one or more of it’s key dimensions.

chart_type

alias of holoviews.element.chart.Scatter

diagonal_operation

alias of histogram

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

class holoviews.operation.element.histogram(*args, **params)[source]

Bases: holoviews.core.operation.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(length=2)

Specifies the range within which to compute the bins.

bins = param.ClassSelector(class_=(<class ‘numpy.ndarray’>, <class ‘list’>, <class ‘tuple’>, <class ‘str’>))

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(bounds=(0, 1), default=False)

Whether to compute the cumulative histogram

dimension = param.String()

Along which dimension of the Element to compute the histogram.

frequency_label = param.String()

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

groupby = param.ClassSelector(class_=(<class ‘str’>, <class ‘holoviews.core.dimension.Dimension’>))

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

log = param.Boolean(bounds=(0, 1), default=False)

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

mean_weighted = param.Boolean(bounds=(0, 1), default=False)

Whether the weighted frequencies are averaged.

normed = param.ObjectSelector(default=True, objects=[True, False, ‘integral’, ‘height’])

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(bounds=(0, 1), default=False)

Whether to use only nonzero values when computing the histogram

num_bins = param.Integer(default=20, inclusive_bounds=(True, True))

Number of bins in the histogram .

weight_dimension = param.String()

Name of the dimension the weighting should be drawn from

style_prefix = param.String()

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

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.element.image_overlay(*args, **params)[source]

Bases: holoviews.core.operation.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(default=’Transform’)

The group assigned to the resulting overlay.

spec = param.String(default=’’)

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(default=0, inclusive_bounds=(True, True))

default_range = param.Tuple(default=(0, 1), length=2)

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

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

output_type

alias of holoviews.core.overlay.Overlay

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.element.interpolate_curve(*args, **params)[source]

Bases: holoviews.core.operation.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(default=’steps-mid’, objects=[‘steps-pre’, ‘steps-mid’, ‘steps-post’, ‘linear’])

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

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.element.method(*args, **params)[source]

Bases: holoviews.core.operation.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(class_=<class ‘type’>)

The output type of the method operation

input_type = param.ClassSelector(class_=<class ‘type’>)

The object type the method is defined on

method_name = param.String(default=’__call__’)

The method name

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

The list of positional argument to pass to the method

kwargs = param.Dict(class_=<class ‘dict’>, default={})

The dict of keyword arguments to pass to the method

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.element.operation(*args, **params)[source]

Bases: holoviews.core.operation.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(default=’Operation’)

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

output_type = param.Parameter()

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

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)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.element.threshold(*args, **params)[source]

Bases: holoviews.core.operation.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(default=’Threshold’)

The group assigned to the thresholded output.

level = param.Number(default=0.5, inclusive_bounds=(True, True))

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(default=1.0, inclusive_bounds=(True, True))

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

low = param.Number(default=0.0, inclusive_bounds=(True, True))

The value given to elements below the threshold.

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

output_type

alias of holoviews.element.raster.Image

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.element.transform(*args, **params)[source]

Bases: holoviews.core.operation.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(default=’Transform’)

The group assigned to the result after applying the transform.

operator = param.Callable()

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)

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

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

instance(**params)

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

output_type

alias of holoviews.element.raster.Image

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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


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(*args, **params)[source]

Bases: holoviews.core.operation.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(bounds=(0, 1), default=False)

Whether normalization is allowed to use the minimum and maximum values of the existing data to infer an appropriate range

ranges = param.ClassSelector(class_=(<class ‘dict’>, <class ‘list’>), default={})

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(bounds=(0, None))

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)

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

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.

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, ranges={}, keys=None, **params)[source]

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.normalization.raster_normalization(*args, **params)[source]

Bases: holoviews.operation.normalization.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)

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

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

get_ranges(element, key)

Method to get the appropriate normalization range dictionary given a key and element.

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, ranges={}, keys=None, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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


stats Module

Inheritance diagram of holoviews.operation.stats
class holoviews.operation.stats.bivariate_kde(*args, **params)[source]

Bases: holoviews.core.operation.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(bounds=(0, 1), default=True)

Whether to compute contours from the KDE, determines whether to return an Image or Contours/Polygons.

bw_method = param.ObjectSelector(default=’scott’, objects=[‘scott’, ‘silverman’])

Method of automatically determining KDE bandwidth

bandwidth = param.Number(inclusive_bounds=(True, True))

Allows supplying explicit bandwidth value rather than relying on scott or silverman method.

cut = param.Number(default=3, inclusive_bounds=(True, True))

Draw the estimate to cut * bw from the extreme data points.

filled = param.Boolean(bounds=(0, 1), default=False)

Controls whether to return filled or unfilled contours.

levels = param.ClassSelector(class_=(<class ‘list’>, <class ‘int’>), default=10)

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

n_samples = param.Integer(default=100, inclusive_bounds=(True, True))

Number of samples to compute the KDE over.

x_range = param.NumericTuple(length=2)

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

y_range = param.NumericTuple(length=2)

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

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.stats.univariate_kde(*args, **params)[source]

Bases: holoviews.core.operation.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(default=’scott’, objects=[‘scott’, ‘silverman’])

Method of automatically determining KDE bandwidth

bandwidth = param.Number(inclusive_bounds=(True, True))

Allows supplying explicit bandwidth value rather than relying on scott or silverman method.

cut = param.Number(default=3, inclusive_bounds=(True, True))

Draw the estimate to cut * bw from the extreme data points.

bin_range = param.NumericTuple(length=2)

Specifies the range within which to compute the KDE.

dimension = param.String()

Along which dimension of the Element to compute the KDE.

filled = param.Boolean(bounds=(0, 1), default=True)

Controls whether to return filled or unfilled KDE.

n_samples = param.Integer(default=100, inclusive_bounds=(True, True))

Number of samples to compute the KDE over.

groupby = param.ClassSelector(class_=(<class ‘str’>, <class ‘holoviews.core.dimension.Dimension’>))

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

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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


timeseries Module

Inheritance diagram of holoviews.operation.timeseries
class holoviews.operation.timeseries.RollingBase(*, fig, holomap, widgets, fps, max_frames, size, dpi, filename, info, css, widget_location)[source]

Bases: param.parameterized.Parameterized

Parameters shared between rolling and rolling_outlier_std.

center = param.Boolean(bounds=(0, 1), default=True)

Whether to set the x-coordinate at the center or right edge of the window.

min_periods = param.Integer(inclusive_bounds=(True, True))

Minimum number of observations in window required to have a value (otherwise result is NaN).

rolling_window = param.Integer(default=10, inclusive_bounds=(True, True))

The window size over which to operate.

class holoviews.operation.timeseries.resample(*args, **params)[source]

Bases: holoviews.core.operation.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(objects=[‘left’, ‘right’])

Which side of bin interval is closed

function = param.Callable()

Function for computing new values out of existing ones.

label = param.ObjectSelector(default=’right’, objects=[])

The bin edge to label the bin with.

rule = param.String(default=’D’)

A string representing the time interval over which to apply the resampling

function(axis=None, dtype=None, out=None, keepdims=<no value>)

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.

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.

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.

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

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.

>>> 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
classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.timeseries.rolling(*args, **params)[source]

Bases: holoviews.core.operation.Operation, holoviews.operation.timeseries.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(objects=[‘boxcar’, ‘triang’, ‘blackman’, ‘hamming’, ‘bartlett’, ‘parzen’, ‘bohman’, ‘blackmanharris’, ‘nuttall’, ‘barthann’, ‘kaiser’, ‘gaussian’, ‘general_gaussian’, ‘slepian’])

The shape of the window to apply

function = param.Callable()

The function to apply over the rolling window.

function(axis=None, dtype=None, out=None, keepdims=<no value>)

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.

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.

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.

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

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.

>>> 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
classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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

class holoviews.operation.timeseries.rolling_outlier_std(*args, **params)[source]

Bases: holoviews.core.operation.Operation, holoviews.operation.timeseries.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(default=2.0, inclusive_bounds=(True, True))

Minimum sigma before a value is considered an outlier.

classmethod get_overlay_bounds(overlay)

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

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

instance(**params)

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

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

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

process_element(element, key, **params)

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

script_repr(imports=[], prefix=' ')

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search(element, pattern)

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

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