holoviews.operation Package#
operation
Package#
- class holoviews.operation.Compositor(pattern, operation, group, mode, transfer_options=False, transfer_parameters=False, output_type=None, backends=None, **kwargs)[source]#
Bases:
Parameterized
A Compositor is a way of specifying an operation to be automatically applied to Overlays that match a specified pattern upon display.
Any Operation that takes an Overlay as input may be used to define a compositor.
For instance, a compositor may be defined to automatically display three overlaid monochrome matrices as an RGB image as long as the values names of those matrices match ‘R’, ‘G’ and ‘B’.
mode
= param.Selector(allow_refs=False, default=’data’, label=’Mode’, names={}, nested_refs=False, objects=[‘data’, ‘display’], rx=<param.reactive.reactive_ops object at 0x165069c90>)The mode of the Compositor object which may be either ‘data’ or ‘display’.
backends
= param.List(allow_refs=False, bounds=(0, None), default=[], label=’Backends’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1650d50d0>)Defines which backends to apply the Compositor for.
operation
= param.Parameter(allow_None=True, allow_refs=False, label=’Operation’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x164d98090>)The Operation to apply when collapsing overlays.
pattern
= param.String(allow_refs=False, default=’’, label=’Pattern’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x165241550>)The overlay pattern to be processed. An overlay pattern is a sequence of elements specified by dotted paths separated by * . For instance the following pattern specifies three overlaid matrices with values of ‘RedChannel’, ‘GreenChannel’ and ‘BlueChannel’ respectively: ‘Image.RedChannel * Image.GreenChannel * Image.BlueChannel. This pattern specification could then be associated with the RGB operation that returns a single RGB matrix for display.
group
= param.String(allow_None=True, allow_refs=False, default=’’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x165167250>)The group identifier for the output of this particular compositor
kwargs
= param.Dict(allow_None=True, allow_refs=False, class_=<class ‘dict’>, label=’Kwargs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16506e450>)Optional set of parameters to pass to the operation.
transfer_options
= param.Boolean(allow_refs=False, default=False, label=’Transfer options’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x165138050>)Whether to transfer the options from the input to the output.
transfer_parameters
= param.Boolean(allow_refs=False, default=False, label=’Transfer parameters’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1651ed990>)Whether to transfer plot options which match to the operation.
- apply(value, input_ranges, backend=None)[source]#
Apply the compositor on the input with the given input ranges.
- classmethod collapse(holomap, ranges=None, mode='data')[source]#
Given a map of Overlays, apply all applicable compositors.
- classmethod collapse_element(overlay, ranges=None, mode='data', backend=None)[source]#
Finds any applicable compositor and applies it.
- classmethod map(obj, mode='data', backend=None)[source]#
Applies compositor operations to any HoloViews element or container using the map method.
- match_level(overlay)[source]#
Given an overlay, return the match level and applicable slice of the overall overlay. The level an integer if there is a match or None if there is no match.
The level integer is the number of matching components. Higher values indicate a stronger match.
- property output_type#
Returns the operation output_type unless explicitly overridden in the kwargs.
- classmethod strongest_match(overlay, mode, backend=None)[source]#
Returns the single strongest matching compositor operation given an overlay. If no matches are found, None is returned.
The best match is defined as the compositor operation with the highest match value as returned by the match_level method.
- class holoviews.operation.Operation(*, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
ParameterizedFunction
An Operation process an Element or HoloMap at the level of individual elements or overlays. If a holomap is passed in as input, a processed holomap is returned as output where the individual elements have been transformed accordingly. An Operation may turn overlays in new elements or vice versa.
An Operation can be set to be dynamic, which will return a DynamicMap with a callback that will apply the operation dynamically. An Operation may also supply a list of Stream classes on a streams parameter, which can allow dynamic control over the parameters on the operation.
group
= param.String(allow_refs=False, default=’Operation’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16520e9d0>)The group string used to identify the output of the Operation. By default this should match the operation name.
dynamic
= param.Selector(allow_refs=False, default=’default’, label=’Dynamic’, names={}, nested_refs=False, objects=[‘default’, True, False], rx=<param.reactive.reactive_ops object at 0x16518b6d0>)Whether the operation should be applied dynamically when a specific frame is requested, specified as a Boolean. If set to ‘default’ the mode will be determined based on the input type, i.e. if the data is a DynamicMap it will stay dynamic.
input_ranges
= param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ‘dict’>, <class ‘tuple’>), default={}, label=’Input ranges’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16484b850>)Ranges to be used for input normalization (if applicable) in a format appropriate for the Normalization.ranges parameter. By default, no normalization is applied. If key-wise normalization is required, a 2-tuple may be supplied where the first component is a Normalization.ranges list and the second component is Normalization.keys.
link_inputs
= param.Boolean(allow_refs=False, default=False, label=’Link inputs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1651893d0>)If the operation is dynamic, whether or not linked streams should be transferred from the operation inputs for backends that support linked streams. For example if an operation is applied to a DynamicMap with an RangeXY, this switch determines whether the corresponding visualization should update this stream with range changes originating from the newly generated axes.
streams
= param.ClassSelector(allow_refs=False, class_=(<class ‘dict’>, <class ‘list’>), default=[], label=’Streams’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16520ef90>)List of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.categorical_aggregate2d(*, datatype, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Generates a gridded Dataset of 2D aggregate arrays indexed by the first two dimensions of the passed Element, turning all remaining dimensions into value dimensions. The key dimensions of the gridded array are treated as categorical indices. Useful for data indexed by two independent categorical variables such as a table of population values indexed by country and year. Data that is indexed by continuous dimensions should be binned before aggregation. The aggregation will retain the global sorting order of both dimensions.
- >> table = Table([(‘USA’, 2000, 282.2), (‘UK’, 2005, 58.89)],
kdims=[‘Country’, ‘Year’], vdims=[‘Population’])
>> categorical_aggregate2d(table) Dataset({‘Country’: [‘USA’, ‘UK’], ‘Year’: [2000, 2005],
‘Population’: [[ 282.2 , np.nan], [np.nan, 58.89]]},
kdims=[‘Country’, ‘Year’], vdims=[‘Population’])
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamsdatatype
= param.List(allow_refs=False, bounds=(0, None), default=[‘xarray’, ‘grid’], label=’Datatype’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x165144990>)The grid interface types to use when constructing the gridded Dataset.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.chain(*, operations, output_type, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Defining an Operation chain is an easy way to define a new Operation from a series of existing ones. The argument is a list of Operation (or Operation instances) that are called in sequence to generate the returned element.
chain(operations=[gradient, threshold.instance(level=2)])
This operation can accept an Image instance and would first compute the gradient before thresholding the result at a level of 2.0.
Instances are only required when arguments need to be passed to individual operations so the resulting object is a function over a single argument.
Parameters inherited from:
holoviews.core.operation.Operation
: dynamic, input_ranges, link_inputs, streamsgroup
= param.String(allow_refs=False, default=’’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x165216f50>)The group assigned to the result after having applied the chain. Defaults to the group produced by the last operation in the chain
output_type
= param.Parameter(allow_refs=False, default=<class ‘holoviews.element.raster.Image’>, label=’Output type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1651f1250>)The output type of the chain operation. Must be supplied if the chain is to be used as a channel operation.
operations
= param.List(allow_refs=False, bounds=(0, None), class_=<class ‘holoviews.core.operation.Operation’>, default=[], item_type=<class ‘holoviews.core.operation.Operation’>, label=’Operations’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x165216f50>)A list of Operations (or Operation instances) that are applied on the input from left to right.
- find(operation, skip_nonlinked=True)[source]#
Returns the first found occurrence of an operation while performing a backward traversal of the chain pipeline.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.collapse(*, fn, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Given an overlay of Element types, collapse into single Element object using supplied function. Collapsing aggregates over the key dimensions of each object applying the supplied fn to each group.
This is an example of an Operation that does not involve any Raster types.
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamsfn
= param.Callable(allow_refs=False, default=<function mean at 0x103fe22b0>, label=’Fn’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1651c8950>)The function that is used to collapse the curve y-values for each x-value.
- fn(axis=None, dtype=None, out=None, keepdims=<no value>, *, where=<no value>)[source]#
Compute the arithmetic mean along the specified axis.
Returns the average of the array elements. The average is taken over the flattened array by default, otherwise over the specified axis. float64 intermediate and return values are used for integer inputs.
Parameters#
- aarray_like
Array containing numbers whose mean is desired. If a is not an array, a conversion is attempted.
- axisNone or int or tuple of ints, optional
Axis or axes along which the means are computed. The default is to compute the mean of the flattened array.
Added 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. See ufuncs-output-type for more details.- keepdimsbool, optional
If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.
If the default value is passed, then keepdims will not be passed through to the mean method of sub-classes of ndarray, however any non-default value will be. If the sub-class’ method does not implement keepdims any exceptions will be raised.
- wherearray_like of bool, optional
Elements to include in the mean. See ~numpy.ufunc.reduce for details.
Added in version 1.20.0.
Returns#
- mndarray, see dtype parameter above
If out=None, returns a new array containing the mean values, otherwise a reference to the output array is returned.
See Also#
average : Weighted average std, var, nanmean, nanstd, nanvar
Notes#
The arithmetic mean is the sum of the elements along the axis divided by the number of elements.
Note that for floating-point input, the mean is computed using the same precision the input has. Depending on the input data, this can cause the results to be inaccurate, especially for float32 (see example below). Specifying a higher-precision accumulator using the dtype keyword can alleviate this issue.
By default, float16 results are computed using float32 intermediates for extra precision.
Examples#
>>> a = np.array([[1, 2], [3, 4]]) >>> np.mean(a) 2.5 >>> np.mean(a, axis=0) array([2., 3.]) >>> np.mean(a, axis=1) array([1.5, 3.5])
In single precision, mean can be inaccurate:
>>> a = np.zeros((2, 512*512), dtype=np.float32) >>> a[0, :] = 1.0 >>> a[1, :] = 0.1 >>> np.mean(a) 0.54999924
Computing the mean in float64 is more accurate:
>>> np.mean(a, dtype=np.float64) 0.55000000074505806 # may vary
Specifying a where argument:
>>> a = np.array([[5, 9, 13], [14, 10, 12], [11, 15, 19]]) >>> np.mean(a) 12.0 >>> np.mean(a, where=[[True], [False], [False]]) 9.0
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.contours(*, filled, levels, overlaid, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Given a Image with a single channel, annotate it with contour lines for a given set of contour levels.
The return is an NdOverlay with a Contours layer for each given level, overlaid on top of the input Image.
Parameters inherited from:
holoviews.core.operation.Operation
: dynamic, input_ranges, link_inputs, streamsgroup
= param.String(allow_refs=False, default=’Level’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1653d9c10>)The group assigned to the output contours.
levels
= param.ClassSelector(allow_refs=False, class_=(<class ‘list’>, <class ‘int’>), default=10, label=’Levels’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1653c8590>)A list of scalar values used to specify the contour levels.
filled
= param.Boolean(allow_refs=False, default=False, label=’Filled’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1653d9810>)Whether to generate filled contours
overlaid
= param.Boolean(allow_refs=False, default=False, label=’Overlaid’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1653c8310>)Whether to overlay the contour on the supplied Element.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.convolve(*, kernel_roi, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Apply a convolution to an overlay using the top layer as the kernel for convolving the bottom layer. Both Image elements in the input overlay should have a single value dimension.
Parameters inherited from:
holoviews.core.operation.Operation
: dynamic, input_ranges, link_inputs, streamsgroup
= param.String(allow_refs=False, default=’Convolution’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1651fc910>)The group assigned to the convolved output.
kernel_roi
= param.NumericTuple(allow_refs=False, default=(0, 0, 0, 0), label=’Kernel roi’, length=4, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16493a690>)A 2-dimensional slice of the kernel layer to use in the convolution in lbrt (left, bottom, right, top) format. By default, no slicing is applied.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.decimate(*, max_samples, random_seed, x_range, y_range, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Decimates any column based Element to a specified number of random rows if the current element defined by the x_range and y_range contains more than max_samples. By default the operation returns a DynamicMap with a RangeXY stream allowing dynamic downsampling.
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesdynamic
= param.Boolean(allow_refs=False, default=True, label=’Dynamic’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x165379950>)Enables dynamic processing by default.
link_inputs
= param.Boolean(allow_refs=False, default=True, label=’Link inputs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16537a2d0>)By default, the link_inputs parameter is set to True so that when applying shade, backends that support linked streams update RangeXY streams on the inputs of the shade operation.
streams
= param.ClassSelector(allow_refs=False, class_=(<class ‘dict’>, <class ‘list’>), default=[<class ‘holoviews.streams.RangeXY’>], label=’Streams’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16537a850>)List of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.
max_samples
= param.Integer(allow_refs=False, default=5000, inclusive_bounds=(True, True), label=’Max samples’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16537ac10>)Maximum number of samples to display at the same time.
random_seed
= param.Integer(allow_refs=False, default=42, inclusive_bounds=(True, True), label=’Random seed’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16537ae90>)Seed used to initialize randomization.
x_range
= param.NumericTuple(allow_None=True, allow_refs=False, label=’X range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16537a110>)The x_range as a tuple of min and max x-value. Auto-ranges if set to None.
y_range
= param.NumericTuple(allow_None=True, allow_refs=False, label=’Y range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x165379950>)The x_range as a tuple of min and max y-value. Auto-ranges if set to None.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.factory(*, args, kwargs, output_type, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Simple operation that constructs any element that accepts some other element as input. For instance, RGB and HSV elements can be created from overlays of Image elements.
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamsoutput_type
= param.Parameter(allow_refs=False, default=<class ‘holoviews.element.raster.RGB’>, label=’Output type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x165337d90>)The output type of the factor operation. By default, if three overlaid Images elements are supplied, the corresponding RGB element will be returned.
args
= param.List(allow_refs=False, bounds=(0, None), default=[], label=’Args’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x165339890>)The list of positional argument to pass to the factory
kwargs
= param.Dict(allow_refs=False, class_=<class ‘dict’>, default={}, label=’Kwargs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1653397d0>)The dict of keyword arguments to pass to the factory
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.function(*, args, fn, input_type, kwargs, output_type, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamsoutput_type
= param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ‘type’>, label=’Output type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16535ed90>)The output type of the method operation
input_type
= param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ‘type’>, label=’Input type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x165350690>)The object type the method is defined on
fn
= param.Callable(allow_refs=False, label=’Fn’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16535e6d0>)The function to apply.
args
= param.List(allow_refs=False, bounds=(0, None), default=[], label=’Args’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16535ee90>)The list of positional argument to pass to the method
kwargs
= param.Dict(allow_refs=False, class_=<class ‘dict’>, default={}, label=’Kwargs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16535e7d0>)The dict of keyword arguments to pass to the method
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.gradient(*, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Compute the gradient plot of the supplied Image.
If the Image value dimension is cyclic, the smallest step is taken considered the cyclic range
Parameters inherited from:
holoviews.core.operation.Operation
: dynamic, input_ranges, link_inputs, streamsgroup
= param.String(allow_refs=False, default=’Gradient’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16536e110>)The group assigned to the output gradient matrix.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.histogram(*, bin_range, bins, cumulative, dimension, frequency_label, groupby, groupby_range, log, mean_weighted, nonzero, normed, num_bins, style_prefix, weight_dimension, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Returns a Histogram of the input element data, binned into num_bins over the bin_range (if specified) along the specified dimension.
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamsbin_range
= param.NumericTuple(allow_None=True, allow_refs=False, label=’Bin range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1653a4d10>)Specifies the range within which to compute the bins.
bins
= param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ‘numpy.ndarray’>, <class ‘list’>, <class ‘tuple’>, <class ‘str’>), label=’Bins’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1653a6590>)An explicit set of bin edges or a method to find the optimal set of bin edges, e.g. ‘auto’, ‘fd’, ‘scott’ etc. For more documentation on these approaches see the np.histogram_bin_edges documentation.
cumulative
= param.Boolean(allow_refs=False, default=False, label=’Cumulative’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1653a4990>)Whether to compute the cumulative histogram
dimension
= param.String(allow_None=True, allow_refs=False, label=’Dimension’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1653a6250>)Along which dimension of the Element to compute the histogram.
frequency_label
= param.String(allow_None=True, allow_refs=False, label=’Frequency label’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1653a4990>)Format string defining the label of the frequency dimension of the Histogram.
groupby
= param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ‘str’>, <class ‘holoviews.core.dimension.Dimension’>), label=’Groupby’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1653a6250>)Defines a dimension to group the Histogram returning an NdOverlay of Histograms.
groupby_range
= param.Selector(allow_refs=False, default=’shared’, label=’Groupby range’, names={}, nested_refs=False, objects=[‘shared’, ‘separated’], rx=<param.reactive.reactive_ops object at 0x1653a6750>)Whether to group the histograms along the same range or separate them.
log
= param.Boolean(allow_refs=False, default=False, label=’Log’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1653a6190>)Whether to use base 10 logarithmic samples for the bin edges.
mean_weighted
= param.Boolean(allow_refs=False, default=False, label=’Mean weighted’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1653a4e10>)Whether the weighted frequencies are averaged.
normed
= param.Selector(allow_refs=False, default=False, label=’Normed’, names={}, nested_refs=False, objects=[True, False, ‘integral’, ‘height’], rx=<param.reactive.reactive_ops object at 0x1653a6250>)Controls normalization behavior. If True or ‘integral’, then density=True is passed to np.histogram, and the distribution is normalized such that the integral is unity. If False, then the frequencies will be raw counts. If ‘height’, then the frequencies are normalized such that the max bin height is unity.
nonzero
= param.Boolean(allow_refs=False, default=False, label=’Nonzero’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1653a6850>)Whether to use only nonzero values when computing the histogram
num_bins
= param.Integer(allow_refs=False, default=20, inclusive_bounds=(True, True), label=’Num bins’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1653a6950>)Number of bins in the histogram .
weight_dimension
= param.String(allow_None=True, allow_refs=False, label=’Weight dimension’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1653a6750>)Name of the dimension the weighting should be drawn from
style_prefix
= param.String(allow_None=True, allow_refs=False, label=’Style prefix’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1653a64d0>)Used for setting a common style for histograms in a HoloMap or AdjointLayout.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.image_overlay(*, default_range, fill, spec, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Operation to build a overlay of images to a specification from a subset of the required elements.
This is useful for reordering the elements of an overlay, duplicating layers of an overlay or creating blank image elements in the appropriate positions.
For instance, image_overlay may build a three layered input suitable for the RGB factory operation even if supplied with one or two of the required channels (creating blank channels for the missing elements).
Note that if there is any ambiguity regarding the match, the strongest match will be used. In the case of a tie in match strength, the first layer in the input is used. One successful match is always required.
Parameters inherited from:
holoviews.core.operation.Operation
: dynamic, input_ranges, link_inputs, streamsgroup
= param.String(allow_refs=False, default=’Transform’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1653d4850>)The group assigned to the resulting overlay.
spec
= param.String(allow_refs=False, default=’’, label=’Spec’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1653d6010>)Specification of the output Overlay structure. For instance: Image.R * Image.G * Image.B Will ensure an overlay of this structure is created even if (for instance) only (Image.R * Image.B) is supplied. Elements in the input overlay that match are placed in the appropriate positions and unavailable specification elements are created with the specified fill group.
fill
= param.Number(allow_refs=False, default=0, inclusive_bounds=(True, True), label=’Fill’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1653d6390>)default_range
= param.Tuple(allow_refs=False, default=(0, 1), label=’Default range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1653d57d0>)The default range that will be set on the value_dimension of any automatically created blank image elements.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.interpolate_curve(*, interpolation, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Resamples a Curve using the defined interpolation method, e.g. to represent changes in y-values as steps.
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamsinterpolation
= param.Selector(allow_refs=False, default=’steps-mid’, label=’Interpolation’, names={}, nested_refs=False, objects=[‘steps-pre’, ‘steps-mid’, ‘steps-post’, ‘linear’], rx=<param.reactive.reactive_ops object at 0x165397390>)Controls the transition point of the step along the x-axis.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.method(*, args, input_type, kwargs, method_name, output_type, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Operation that wraps a method call
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamsoutput_type
= param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ‘type’>, label=’Output type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16541ef50>)The output type of the method operation
input_type
= param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ‘type’>, label=’Input type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x165420850>)The object type the method is defined on
method_name
= param.String(allow_refs=False, default=’__call__’, label=’Method name’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16541eb50>)The method name
args
= param.List(allow_refs=False, bounds=(0, None), default=[], label=’Args’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x165420450>)The list of positional argument to pass to the method
kwargs
= param.Dict(allow_refs=False, class_=<class ‘dict’>, default={}, label=’Kwargs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16541eb50>)The dict of keyword arguments to pass to the method
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.operation(*, op, output_type, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
The most generic operation that wraps any callable into an Operation. The callable needs to accept an HoloViews component and a key (that may be ignored) and must return a new HoloViews component.
This class may be useful for turning a HoloViews method into an operation to define as compositor operation. For instance, the following definition:
operation.instance(op=lambda x, k: x.collapse(np.subtract))
Could be used to implement a collapse operation to subtracts the data between Rasters in an Overlay.
Parameters inherited from:
holoviews.core.operation.Operation
: dynamic, input_ranges, link_inputs, streamsgroup
= param.String(allow_refs=False, default=’Operation’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x165445910>)The group assigned to the result after having applied the operator.
output_type
= param.Parameter(allow_None=True, allow_refs=False, label=’Output type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x165447010>)The output element type which may be None to disable type checking. May be used to declare useful information to other code in HoloViews, e.g. required for tab-completion support of operations registered with compositors.
op
= param.Callable(allow_refs=False, label=’Op’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x165370710>)The operation used to generate a new HoloViews object returned by the operation. By default, the identity operation is applied.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.threshold(*, high, level, low, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Threshold a given Image whereby all values higher than a given level map to the specified high value and all values lower than that level map to the specified low value.
Parameters inherited from:
holoviews.core.operation.Operation
: dynamic, input_ranges, link_inputs, streamsgroup
= param.String(allow_refs=False, default=’Threshold’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x165468e90>)The group assigned to the thresholded output.
level
= param.Number(allow_refs=False, default=0.5, inclusive_bounds=(True, True), label=’Level’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16546a050>)The value at which the threshold is applied. Values lower than the threshold map to the ‘low’ value and values above map to the ‘high’ value.
high
= param.Number(allow_refs=False, default=1.0, inclusive_bounds=(True, True), label=’High’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16546a650>)The value given to elements greater than (or equal to) the threshold.
low
= param.Number(allow_refs=False, default=0.0, inclusive_bounds=(True, True), label=’Low’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x165469f90>)The value given to elements below the threshold.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.transform(*, operator, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Generic Operation to transform an input Image or RGBA element into an output Image. The transformation is defined by the supplied callable that accepts the data of the input Image (typically a numpy array) and returns the transformed data of the output Image.
This operator is extremely versatile; for instance, you could implement an alternative to the explicit threshold operator with:
operator=lambda x: np.clip(x, 0, 0.5)
Alternatively, you can implement a transform computing the 2D autocorrelation using the scipy library with:
operator=lambda x: scipy.signal.correlate2d(x, x)
Parameters inherited from:
holoviews.core.operation.Operation
: dynamic, input_ranges, link_inputs, streamsgroup
= param.String(allow_refs=False, default=’Transform’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16547fdd0>)The group assigned to the result after applying the transform.
operator
= param.Callable(allow_None=True, allow_refs=False, label=’Operator’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x165481510>)Function of one argument that transforms the data in the input Image to the data in the output Image. By default, acts as the identity function such that the output matches the input.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
datashader
Module#
- class holoviews.operation.datashader.AggregationOperation(*, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
ResampleOperation2D
AggregationOperation extends the ResampleOperation2D defining an aggregator parameter used to define a datashader Reduction.
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.resample.ResampleOperation1D
: x_range, x_sampling, width, height, pixel_ratioholoviews.operation.resample.ResampleOperation2D
: dynamic, streams, expand, y_range, y_sampling, target, element_type, precomputeaggregator
= param.ClassSelector(allow_refs=False, class_=(<class ‘datashader.reductions.Reduction’>, <class ‘datashader.reductions.summary’>, <class ‘str’>), default=<datashader.reductions.count object at 0x168957e90>, label=’Aggregator’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x169062750>)Datashader reduction function used for aggregating the data. The aggregator may also define a column to aggregate; if no column is defined the first value dimension of the element will be used. May also be defined as a string.
selector
= param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ‘datashader.reductions.min’>, <class ‘datashader.reductions.max’>, <class ‘datashader.reductions.first’>, <class ‘datashader.reductions.last’>), label=’Selector’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x169063e10>)Selector is a datashader reduction function used for selecting data. The selector only works with aggregators which selects an item from the original data. These selectors are min, max, first and last.
vdim_prefix
= param.String(allow_None=True, allow_refs=False, default=’{kdims} ‘, label=’Vdim prefix’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x169034150>)Prefix to prepend to value dimension name where {kdims} templates in the names of the input element key dimensions.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.LineAggregationOperation(*, line_width, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
AggregationOperation
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.resample.ResampleOperation1D
: x_range, x_sampling, width, height, pixel_ratioholoviews.operation.resample.ResampleOperation2D
: dynamic, streams, expand, y_range, y_sampling, target, element_type, precomputeholoviews.operation.datashader.AggregationOperation
: aggregator, selector, vdim_prefixline_width
= param.Number(allow_None=True, allow_refs=False, bounds=(0, None), inclusive_bounds=(True, True), label=’Line width’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16916c890>)Width of the line to draw, in pixels. If zero, the default, lines are drawn using a simple algorithm with a blocky single-pixel width based on whether the line passes through each pixel or does not. If greater than one, lines are drawn with the specified width using a slower and more complex antialiasing algorithm with fractional values along each edge, so that lines have a more uniform visual appearance across all angles. Line widths between 0 and 1 effectively use a line_width of 1 pixel but with a proportionate reduction in the strength of each pixel, approximating the visual appearance of a subpixel line width.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.SpreadingOperation(*, how, shape, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
LinkableOperation
Spreading expands each pixel in an Image based Element a certain number of pixels on all sides according to a given shape, merging pixels using a specified compositing operator. This can be useful to make sparse plots more visible.
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, streamsholoviews.operation.resample.LinkableOperation
: link_inputshow
= param.Selector(allow_refs=False, label=’How’, names={}, nested_refs=False, objects=[None, ‘source’, ‘over’, ‘saturate’, ‘add’, ‘max’, ‘min’], rx=<param.reactive.reactive_ops object at 0x1690b0050>)The name of the compositing operator to use when combining pixels. Default of None uses ‘over’ operator for RGB elements and ‘add’ operator for aggregate arrays.
shape
= param.Selector(allow_refs=False, default=’circle’, label=’Shape’, names={}, nested_refs=False, objects=[‘circle’, ‘square’], rx=<param.reactive.reactive_ops object at 0x1690b3a10>)The shape to spread by. Options are ‘circle’ [default] or ‘square’.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.aggregate(*, line_width, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
LineAggregationOperation
aggregate implements 2D binning for any valid HoloViews Element type using datashader. I.e., this operation turns a HoloViews Element or overlay of Elements into an Image or an overlay of Images by rasterizing it. This allows quickly aggregating large datasets computing a fixed-sized representation independent of the original dataset size.
By default it will simply count the number of values in each bin but other aggregators can be supplied implementing mean, max, min and other reduction operations.
The bins of the aggregate are defined by the width and height and the x_range and y_range. If x_sampling or y_sampling are supplied the operation will ensure that a bin is no smaller than the minimum sampling distance by reducing the width and height when zoomed in beyond the minimum sampling distance.
By default, the PlotSize stream is applied when this operation is used dynamically, which means that the height and width will automatically be set to match the inner dimensions of the linked plot.
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.resample.ResampleOperation1D
: x_range, x_sampling, width, height, pixel_ratioholoviews.operation.resample.ResampleOperation2D
: dynamic, streams, expand, y_range, y_sampling, target, element_type, precomputeholoviews.operation.datashader.AggregationOperation
: aggregator, selector, vdim_prefixholoviews.operation.datashader.LineAggregationOperation
: line_width- classmethod get_agg_data(obj, category=None)[source]#
Reduces any Overlay or NdOverlay of Elements into a single xarray Dataset that can be aggregated.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.area_aggregate(*, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
AggregationOperation
Aggregates Area elements by filling the area between zero and the y-values if only one value dimension is defined and the area between the curves if two are provided.
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.resample.ResampleOperation1D
: x_range, x_sampling, width, height, pixel_ratioholoviews.operation.resample.ResampleOperation2D
: dynamic, streams, expand, y_range, y_sampling, target, element_type, precomputeholoviews.operation.datashader.AggregationOperation
: aggregator, selector, vdim_prefix- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.bundle_graph(*, split, dynamic, group, input_ranges, link_inputs, streams, accuracy, advect_iterations, batch_size, decay, initial_bandwidth, iterations, max_segment_length, min_segment_length, tension, include_edge_id, source, target, weight, x, y, name)[source]#
Bases:
_connect_edges
,hammer_bundle
Iteratively group edges and return as paths suitable for datashading.
Breaks each edge into a path with multiple line segments, and iteratively curves this path to bundle edges into groups.
Parameters inherited from:
datashader.bundling.connect_edges
: x, y, source, target, include_edge_iddatashader.bundling.hammer_bundle
: weight, initial_bandwidth, decay, iterations, batch_size, tension, accuracy, advect_iterations, min_segment_length, max_segment_lengthholoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamsholoviews.operation.datashader._connect_edges
: split- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.contours_rasterize(*, line_width, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
aggregate
Rasterizes the Contours element by weighting the aggregation by the iso-contour levels if a value dimension is defined, otherwise default to any aggregator.
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.resample.ResampleOperation1D
: x_range, x_sampling, width, height, pixel_ratioholoviews.operation.resample.ResampleOperation2D
: dynamic, streams, expand, y_range, y_sampling, target, element_type, precomputeholoviews.operation.datashader.AggregationOperation
: selector, vdim_prefixholoviews.operation.datashader.LineAggregationOperation
: line_widthaggregator
= param.ClassSelector(allow_refs=False, class_=(<class ‘datashader.reductions.Reduction’>, <class ‘datashader.reductions.summary’>, <class ‘str’>), default=<datashader.reductions.mean object at 0x169006e50>, label=’Aggregator’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1691aeb90>)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.
- classmethod get_agg_data(obj, category=None)[source]#
Reduces any Overlay or NdOverlay of Elements into a single xarray Dataset that can be aggregated.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.curve_aggregate(*, line_width, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
aggregate
Optimized aggregation for Curve objects by setting the default of the aggregator to self_intersect=False to be more consistent with the appearance of non-aggregated curves.
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.resample.ResampleOperation1D
: x_range, x_sampling, width, height, pixel_ratioholoviews.operation.resample.ResampleOperation2D
: dynamic, streams, expand, y_range, y_sampling, target, element_type, precomputeholoviews.operation.datashader.AggregationOperation
: selector, vdim_prefixholoviews.operation.datashader.LineAggregationOperation
: line_widthaggregator
= param.ClassSelector(allow_refs=False, class_=(<class ‘datashader.reductions.Reduction’>, <class ‘datashader.reductions.summary’>, <class ‘str’>), default=<datashader.reductions.count object at 0x1690116d0>, label=’Aggregator’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16919a790>)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.
- classmethod get_agg_data(obj, category=None)[source]#
Reduces any Overlay or NdOverlay of Elements into a single xarray Dataset that can be aggregated.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.datashade(*, interpolation, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, alpha, clims, cmap, cnorm, color_key, min_alpha, rescale_discrete_levels, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
-
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_rangesholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.datashader.shade
: alpha, cmap, color_key, cnorm, clims, min_alpha, rescale_discrete_levelsholoviews.operation.resample.ResampleOperation1D
: x_range, x_sampling, width, height, pixel_ratioholoviews.operation.resample.ResampleOperation2D
: dynamic, streams, expand, y_range, y_sampling, target, element_type, precomputeholoviews.operation.datashader.AggregationOperation
: selector, vdim_prefixholoviews.operation.datashader.rasterize
: aggregator, interpolation- classmethod concatenate(overlay)[source]#
Concatenates an NdOverlay of Image types into a single 3D xarray Dataset.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- process_element(element, key, **params)[source]#
The process_element method allows a single element to be operated on given an externally supplied key.
- class holoviews.operation.datashader.directly_connect_edges(*, split, dynamic, group, input_ranges, link_inputs, streams, include_edge_id, source, target, weight, x, y, name)[source]#
Bases:
_connect_edges
,connect_edges
Given a Graph object will directly connect all nodes.
Parameters inherited from:
datashader.bundling.connect_edges
: x, y, source, target, weight, include_edge_idholoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamsholoviews.operation.datashader._connect_edges
: split- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.dynspread(*, max_px, threshold, how, shape, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
SpreadingOperation
Spreading expands each pixel in an Image based Element a certain number of pixels on all sides according to a given shape, merging pixels using a specified compositing operator. This can be useful to make sparse plots more visible. Dynamic spreading determines how many pixels to spread based on a density heuristic.
See the datashader documentation for more detail:
http://datashader.org/api.html#datashader.transfer_functions.dynspread
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, streamsholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.datashader.SpreadingOperation
: how, shapemax_px
= param.Integer(allow_refs=False, default=3, inclusive_bounds=(True, True), label=’Max px’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x169425a90>)Maximum number of pixels to spread on all sides.
threshold
= param.Number(allow_refs=False, bounds=(0, 1), default=0.5, inclusive_bounds=(True, True), label=’Threshold’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x169427790>)When spreading, determines how far to spread. Spreading starts at 1 pixel, and stops when the fraction of adjacent non-empty pixels reaches this threshold. Higher values give more spreading, up to the max_px allowed.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.geom_aggregate(*, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
AggregationOperation
Baseclass for aggregation of Geom elements.
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.resample.ResampleOperation1D
: x_range, x_sampling, width, height, pixel_ratioholoviews.operation.resample.ResampleOperation2D
: dynamic, streams, expand, y_range, y_sampling, target, element_type, precomputeholoviews.operation.datashader.AggregationOperation
: aggregator, selector, vdim_prefix- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.geometry_rasterize(*, line_width, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
LineAggregationOperation
Rasterizes geometries by converting them to spatialpandas.
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.resample.ResampleOperation1D
: x_range, x_sampling, width, height, pixel_ratioholoviews.operation.resample.ResampleOperation2D
: dynamic, streams, expand, y_range, y_sampling, target, element_type, precomputeholoviews.operation.datashader.AggregationOperation
: selector, vdim_prefixholoviews.operation.datashader.LineAggregationOperation
: line_widthaggregator
= param.ClassSelector(allow_refs=False, class_=(<class ‘datashader.reductions.Reduction’>, <class ‘datashader.reductions.summary’>, <class ‘str’>), default=<datashader.reductions.mean object at 0x169006ed0>, label=’Aggregator’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16947d7d0>)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.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.inspect(*, hits, max_indicators, null_value, pixels, transform, value_bounds, x, y, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Generalized inspect operation that detects the appropriate indicator type.
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputsstreams
= param.ClassSelector(allow_refs=False, class_=(<class ‘dict’>, <class ‘list’>), default={‘x’: <param.parameters.ClassSelector object at 0x116df8bf0>, ‘y’: <param.parameters.ClassSelector object at 0x116df8b40>}, label=’Streams’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1694b7290>)List of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.
pixels
= param.ClassSelector(allow_refs=False, class_=(<class ‘int’>, <class ‘tuple’>), default=3, label=’Pixels’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1694870d0>)Number of pixels in data space around the cursor point to search for hits in. The hit within this box mask that is closest to the cursor’s position is displayed. Pixels can be provided as integer or x/y-tuple to perform asymmetric masking.
null_value
= param.Number(allow_refs=False, default=0, inclusive_bounds=(True, True), label=’Null value’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16949c8d0>)Value of raster which indicates no hits. For instance zero for count aggregator (default) and commonly NaN for other (float) aggregators. For RGBA images, the alpha channel is used which means zero alpha acts as the null value.
value_bounds
= param.NumericTuple(allow_None=True, allow_refs=False, label=’Value bounds’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16945d250>)If not None, a numeric bounds for the pixel under the cursor in order for hits to be computed. Useful for count aggregators where a value of (1,1000) would make sure no more than a thousand samples will be searched.
hits
= param.DataFrame(allow_None=True, allow_refs=False, class_=<class ‘pandas.core.frame.DataFrame’>, default=Empty DataFrame Columns: [] Index: [], label=’Hits’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16916ab50>)max_indicators
= param.Integer(allow_refs=False, default=1, inclusive_bounds=(True, True), label=’Max indicators’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1694b84d0>)Maximum number of indicator elements to display within the mask of size pixels. Points are prioritized by distance from the cursor point. This means that the default value of one shows the single closest sample to the cursor. Note that this limit is not applies to the hits parameter.
transform
= param.Callable(allow_refs=False, label=’Transform’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168fb6410>)Function that transforms the hits dataframe before it is passed to the Points element. Can be used to customize the value dimensions e.g. to implement custom hover behavior.
x
= param.Number(allow_None=True, allow_refs=False, inclusive_bounds=(True, True), label=’X’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16916b5d0>)x-position to inspect.
y
= param.Number(allow_None=True, allow_refs=False, inclusive_bounds=(True, True), label=’Y’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1694b84d0>)y-position to inspect.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.inspect_base(*, hits, max_indicators, null_value, pixels, transform, value_bounds, x, y, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
inspect
Given datashaded aggregate (Image) output, return a set of (hoverable) points sampled from those near the cursor.
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputsholoviews.operation.datashader.inspect
: streams, pixels, null_value, value_bounds, hits, max_indicators, transform, x, y- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.inspect_mask(*, pixels, x, y, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Operation used to display the inspection mask, for use with other inspection operations. Can be used directly but is more commonly constructed using the mask property of the corresponding inspector operation.
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputsstreams
= param.ClassSelector(allow_refs=False, class_=(<class ‘dict’>, <class ‘list’>), default=[<class ‘holoviews.streams.PointerXY’>], label=’Streams’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1694f6490>)List of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.
pixels
= param.ClassSelector(allow_refs=False, class_=(<class ‘int’>, <class ‘tuple’>), default=3, label=’Pixels’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1694f7d10>)Size of the mask that should match the pixels parameter used in the associated inspection operation. Pixels can be provided as integer or x/y-tuple to perform asymmetric masking.
x
= param.Number(allow_refs=False, default=0, inclusive_bounds=(True, True), label=’X’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1694fc090>)y
= param.Number(allow_refs=False, default=0, inclusive_bounds=(True, True), label=’Y’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1694fc5d0>)- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.inspect_points(*, hits, max_indicators, null_value, pixels, transform, value_bounds, x, y, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
inspect_base
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputsholoviews.operation.datashader.inspect
: streams, pixels, null_value, value_bounds, hits, max_indicators, transform, x, y- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.inspect_polygons(*, hits, max_indicators, null_value, pixels, transform, value_bounds, x, y, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
inspect_base
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputsholoviews.operation.datashader.inspect
: streams, pixels, null_value, value_bounds, hits, max_indicators, transform, x, y- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.overlay_aggregate(*, line_width, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
aggregate
Optimized aggregation for NdOverlay objects by aggregating each Element in an NdOverlay individually avoiding having to concatenate items in the NdOverlay. Works by summing sum and count aggregates and applying appropriate masking for NaN values. Mean aggregation is also supported by dividing sum and count aggregates. count_cat aggregates are grouped by the categorical dimension and a separate aggregate for each category is generated.
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.resample.ResampleOperation1D
: x_range, x_sampling, width, height, pixel_ratioholoviews.operation.resample.ResampleOperation2D
: dynamic, streams, expand, y_range, y_sampling, target, element_type, precomputeholoviews.operation.datashader.AggregationOperation
: aggregator, selector, vdim_prefixholoviews.operation.datashader.LineAggregationOperation
: line_width- classmethod get_agg_data(obj, category=None)[source]#
Reduces any Overlay or NdOverlay of Elements into a single xarray Dataset that can be aggregated.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.quadmesh_rasterize(*, interpolation, line_width, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
trimesh_rasterize
Rasterize the QuadMesh element using the supplied aggregator. Simply converts to a TriMesh and lets trimesh_rasterize handle the actual rasterization.
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.resample.ResampleOperation1D
: x_range, x_sampling, width, height, pixel_ratioholoviews.operation.resample.ResampleOperation2D
: dynamic, streams, expand, y_range, y_sampling, target, element_type, precomputeholoviews.operation.datashader.AggregationOperation
: selector, vdim_prefixholoviews.operation.datashader.LineAggregationOperation
: line_widthholoviews.operation.datashader.trimesh_rasterize
: aggregator, interpolation- classmethod get_agg_data(obj, category=None)[source]#
Reduces any Overlay or NdOverlay of Elements into a single xarray Dataset that can be aggregated.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.rasterize(*, interpolation, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
AggregationOperation
Rasterize is a high-level operation that will rasterize any Element or combination of Elements, aggregating them with the supplied aggregator and interpolation method.
The default aggregation method depends on the type of Element but usually defaults to the count of samples in each bin. Other aggregators can be supplied implementing mean, max, min and other reduction operations.
The bins of the aggregate are defined by the width and height and the x_range and y_range. If x_sampling or y_sampling are supplied the operation will ensure that a bin is no smaller than the minimum sampling distance by reducing the width and height when zoomed in beyond the minimum sampling distance.
By default, the PlotSize and RangeXY streams are applied when this operation is used dynamically, which means that the width, height, x_range and y_range will automatically be set to match the inner dimensions of the linked plot and the ranges of the axes.
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.resample.ResampleOperation1D
: x_range, x_sampling, width, height, pixel_ratioholoviews.operation.resample.ResampleOperation2D
: dynamic, streams, expand, y_range, y_sampling, target, element_type, precomputeholoviews.operation.datashader.AggregationOperation
: selector, vdim_prefixaggregator
= param.ClassSelector(allow_refs=False, class_=(<class ‘datashader.reductions.Reduction’>, <class ‘datashader.reductions.summary’>, <class ‘str’>), default=’default’, label=’Aggregator’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1692a54d0>)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.Selector(allow_refs=False, default=’default’, label=’Interpolation’, names={}, nested_refs=False, objects=[‘default’, ‘linear’, ‘nearest’, ‘bilinear’, None, False], rx=<param.reactive.reactive_ops object at 0x1692a7f90>)The interpolation method to apply during rasterization. Default depends on element type
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.rectangle_aggregate(*, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
geom_aggregate
Aggregates Rectangle elements.
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.resample.ResampleOperation1D
: x_range, x_sampling, width, height, pixel_ratioholoviews.operation.resample.ResampleOperation2D
: dynamic, streams, expand, y_range, y_sampling, target, element_type, precomputeholoviews.operation.datashader.AggregationOperation
: aggregator, selector, vdim_prefix- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.regrid(*, interpolation, upsample, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
AggregationOperation
regrid allows resampling a HoloViews Image type using specified up- and downsampling functions defined using the aggregator and interpolation parameters respectively. By default upsampling is disabled to avoid unnecessarily upscaling an image that has to be sent to the browser. Also disables expanding the image beyond its original bounds avoiding unnecessarily padding the output array with NaN values.
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.resample.ResampleOperation1D
: x_range, x_sampling, width, height, pixel_ratioholoviews.operation.resample.ResampleOperation2D
: dynamic, streams, y_range, y_sampling, target, element_type, precomputeholoviews.operation.datashader.AggregationOperation
: selector, vdim_prefixexpand
= param.Boolean(allow_refs=False, default=False, label=’Expand’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16932cc90>)Whether the x_range and y_range should be allowed to expand beyond the extent of the data. Setting this value to True is useful for the case where you want to ensure a certain size of output grid, e.g. if you are doing masking or other arithmetic on the grids. A value of False ensures that the grid is only just as large as it needs to be to contain the data, which will be faster and use less memory if the resulting aggregate is being overlaid on a much larger background.
aggregator
= param.ClassSelector(allow_refs=False, class_=(<class ‘datashader.reductions.Reduction’>, <class ‘datashader.reductions.summary’>, <class ‘str’>), default=<datashader.reductions.mean object at 0x169012910>, label=’Aggregator’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16932e550>)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.Selector(allow_refs=False, default=’nearest’, label=’Interpolation’, names={}, nested_refs=False, objects=[‘linear’, ‘nearest’, ‘bilinear’, None, False], rx=<param.reactive.reactive_ops object at 0x16932e850>)Interpolation method
upsample
= param.Boolean(allow_refs=False, default=False, label=’Upsample’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16932e150>)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.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.segments_aggregate(*, line_width, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
geom_aggregate
,LineAggregationOperation
Aggregates Segments elements.
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.resample.ResampleOperation1D
: x_range, x_sampling, width, height, pixel_ratioholoviews.operation.resample.ResampleOperation2D
: dynamic, streams, expand, y_range, y_sampling, target, element_type, precomputeholoviews.operation.datashader.AggregationOperation
: aggregator, selector, vdim_prefixholoviews.operation.datashader.LineAggregationOperation
: line_width- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.shade(*, alpha, clims, cmap, cnorm, color_key, min_alpha, rescale_discrete_levels, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
LinkableOperation
shade applies a normalization function followed by colormapping to an Image or NdOverlay of Images, returning an RGB Element. The data must be in the form of a 2D or 3D DataArray, but NdOverlays of 2D Images will be automatically converted to a 3D array.
In the 2D case data is normalized and colormapped, while a 3D array representing categorical aggregates will be supplied a color key for each category. The colormap (cmap) for the 2D case may be supplied as an Iterable or a Callable.
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, streamsholoviews.operation.resample.LinkableOperation
: link_inputsalpha
= param.Integer(allow_refs=False, bounds=(0, 255), default=255, inclusive_bounds=(True, True), label=’Alpha’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16933b790>)Value between 0 - 255 representing the alpha value to use for colormapped pixels that contain data (i.e. non-NaN values). Regardless of this value,
NaN
values are set to be fully transparent when doing colormapping.cmap
= param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ‘collections.abc.Iterable’>, <class ‘collections.abc.Callable’>, <class ‘dict’>), label=’Cmap’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x169349250>)Iterable or callable which returns colors as hex colors or web color names (as defined by datashader), to be used for the colormap of single-layer datashader output. Callable type must allow mapping colors between 0 and 1. The default value of None reverts to Datashader’s default colormap.
color_key
= param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ‘collections.abc.Iterable’>, <class ‘collections.abc.Callable’>, <class ‘dict’>), label=’Color key’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16933afd0>)Iterable or callable that returns colors as hex colors, to be used for the color key of categorical datashader output. Callable type must allow mapping colors for supplied values between 0 and 1.
cnorm
= param.ClassSelector(allow_refs=False, class_=(<class ‘str’>, <class ‘collections.abc.Callable’>), default=’eq_hist’, label=’Cnorm’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x169348a10>)The normalization operation applied before colormapping. Valid options include ‘linear’, ‘log’, ‘eq_hist’, ‘cbrt’, and any valid transfer function that accepts data, mask, nbins arguments.
clims
= param.NumericTuple(allow_None=True, allow_refs=False, label=’Clims’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x169295250>)Min and max data values to use for colormap interpolation, when wishing to override autoranging.
min_alpha
= param.Number(allow_refs=False, bounds=(0, 255), default=40, inclusive_bounds=(True, True), label=’Min alpha’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x169348c90>)The minimum alpha value to use for non-empty pixels when doing colormapping, in [0, 255]. Use a higher value to avoid undersaturation, i.e. poorly visible low-value datapoints, at the expense of the overall dynamic range..
rescale_discrete_levels
= param.Boolean(allow_refs=False, default=True, label=’Rescale discrete levels’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16933add0>)If
cnorm='eq_hist
and there are only a few discrete values, thenrescale_discrete_levels=True
(the default) decreases the lower limit of the autoranged span so that the values are rendering towards the (more visible) top of thecmap
range, thus avoiding washout of the lower values. Has no effect ifcnorm!=`eq_hist
. Set this value to False if you need to match historical unscaled behavior, prior to HoloViews 1.14.4.
- classmethod concatenate(overlay)[source]#
Concatenates an NdOverlay of Image types into a single 3D xarray Dataset.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- process_element(element, key, **params)[source]#
The process_element method allows a single element to be operated on given an externally supplied key.
- class holoviews.operation.datashader.spikes_aggregate(*, offset, spike_length, line_width, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
LineAggregationOperation
Aggregates Spikes elements by drawing individual line segments over the entire y_range if no value dimension is defined and between zero and the y-value if one is defined.
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.resample.ResampleOperation1D
: x_range, x_sampling, width, height, pixel_ratioholoviews.operation.resample.ResampleOperation2D
: dynamic, streams, expand, y_range, y_sampling, target, element_type, precomputeholoviews.operation.datashader.AggregationOperation
: aggregator, selector, vdim_prefixholoviews.operation.datashader.LineAggregationOperation
: line_widthspike_length
= param.Number(allow_None=True, allow_refs=False, inclusive_bounds=(True, True), label=’Spike length’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x169372e90>)If numeric, specifies the length of each spike, overriding the vdims values (if present).
offset
= param.Number(allow_refs=False, default=0.0, inclusive_bounds=(True, True), label=’Offset’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x169380c90>)The offset of the lower end of each spike.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- holoviews.operation.datashader.split_dataframe(path_df)[source]#
Splits a dataframe of paths separated by NaNs into individual dataframes.
- class holoviews.operation.datashader.spread(*, px, how, shape, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
SpreadingOperation
Spreading expands each pixel in an Image based Element a certain number of pixels on all sides according to a given shape, merging pixels using a specified compositing operator. This can be useful to make sparse plots more visible.
See the datashader documentation for more detail:
http://datashader.org/api.html#datashader.transfer_functions.spread
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, streamsholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.datashader.SpreadingOperation
: how, shapepx
= param.Integer(allow_refs=False, default=1, inclusive_bounds=(True, True), label=’Px’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16939c590>)Number of pixels to spread on all sides.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.spread_aggregate(*, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
area_aggregate
Aggregates Spread elements by filling the area between the lower and upper error band.
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.resample.ResampleOperation1D
: x_range, x_sampling, width, height, pixel_ratioholoviews.operation.resample.ResampleOperation2D
: dynamic, streams, expand, y_range, y_sampling, target, element_type, precomputeholoviews.operation.datashader.AggregationOperation
: aggregator, selector, vdim_prefix- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.stack(*, compositor, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
The stack operation allows compositing multiple RGB Elements using the defined compositing operator.
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamscompositor
= param.Selector(allow_refs=False, default=’over’, label=’Compositor’, names={}, nested_refs=False, objects=[‘add’, ‘over’, ‘saturate’, ‘source’], rx=<param.reactive.reactive_ops object at 0x1693ec7d0>)Defines how the compositing operation combines the images
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.datashader.trimesh_rasterize(*, interpolation, line_width, aggregator, selector, vdim_prefix, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
aggregate
Rasterize the TriMesh element using the supplied aggregator. If the TriMesh nodes or edges define a value dimension, will plot filled and shaded polygons; otherwise returns a wiremesh of the data.
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.resample.ResampleOperation1D
: x_range, x_sampling, width, height, pixel_ratioholoviews.operation.resample.ResampleOperation2D
: dynamic, streams, expand, y_range, y_sampling, target, element_type, precomputeholoviews.operation.datashader.AggregationOperation
: selector, vdim_prefixholoviews.operation.datashader.LineAggregationOperation
: line_widthaggregator
= param.ClassSelector(allow_refs=False, class_=(<class ‘datashader.reductions.Reduction’>, <class ‘datashader.reductions.summary’>, <class ‘str’>), default=<datashader.reductions.mean object at 0x168fd4450>, label=’Aggregator’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x169612d90>)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.Selector(allow_refs=False, default=’bilinear’, label=’Interpolation’, names={}, nested_refs=False, objects=[‘bilinear’, ‘linear’, None, False], rx=<param.reactive.reactive_ops object at 0x1696087d0>)The interpolation method to apply during rasterization.
- classmethod get_agg_data(obj, category=None)[source]#
Reduces any Overlay or NdOverlay of Elements into a single xarray Dataset that can be aggregated.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
downsample
Module#
Implements downsampling algorithms for large 1D datasets.
The algorithms implemented in this module have been adapted from predict-idlab/plotly-resampler and are reproduced along with the original license:
MIT License
Copyright (c) 2022 Jonas Van Der Donckt, Jeroen Van Der Donckt, Emiel Deprost.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- class holoviews.operation.downsample.downsample1d(*, algorithm, minmax_ratio, neighbor_points, parallel, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
ResampleOperation1D
Implements downsampling of a regularly sampled 1D dataset.
If available uses the tsdownsample library to perform massively accelerated downsampling.
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.resample.ResampleOperation1D
: dynamic, streams, x_range, x_sampling, width, height, pixel_ratioalgorithm
= param.Selector(allow_refs=False, default=’lttb’, label=’Algorithm’, names={}, nested_refs=False, objects=[‘lttb’, ‘nth’, ‘viewport’, ‘minmax’, ‘minmax-lttb’, ‘m4’], rx=<param.reactive.reactive_ops object at 0x16a46b650>)The algorithm to use for downsampling: - lttb: Largest Triangle Three Buckets downsample algorithm. - nth: Selects every n-th point. - viewport: Selects all points in a given viewport. - minmax: Selects the min and max value in each bin (requires tsdownsample). - m4: Selects the min, max, first and last value in each bin (requires tsdownsample). - minmax-lttb: First selects n_out * minmax_ratio min and max values, then further reduces these to n_out values using the Largest Triangle Three Buckets algorithm (requires tsdownsample).
parallel
= param.Boolean(allow_refs=False, default=False, label=’Parallel’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a463610>)The number of threads to use (if tsdownsample is available).
minmax_ratio
= param.Integer(allow_refs=False, bounds=(0, None), default=4, inclusive_bounds=(True, True), label=’Minmax ratio’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a46b610>)For the minmax-lttb algorithm determines the ratio of candidate values to generate with the minmax algorithm before further downsampling with LTTB.
neighbor_points
= param.Boolean(allow_None=True, allow_refs=False, label=’Neighbor points’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a462ad0>)Whether to add the neighbor points to the range before downsampling. By default this is only enabled for the viewport algorithm.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
element
Module#
Collection of either extremely generic or simple Operation examples.
- class holoviews.operation.element.apply_when(*, operation, predicate, name)[source]#
Bases:
ParameterizedFunction
Applies a selection depending on the current zoom range. If the supplied predicate function returns a True it will apply the operation otherwise it will return the raw element after the selection. For example the following will apply datashading if the number of points in the current viewport exceed 1000 otherwise just returning the selected points element:
apply_when(points, operation=datashade, predicate=lambda x: x > 1000)
operation
= param.Callable(allow_refs=False, label=’Operation’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a51c0d0>)predicate
= param.Callable(allow_None=True, allow_refs=False, label=’Predicate’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a511050>)
- class holoviews.operation.element.chain(*, operations, output_type, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Defining an Operation chain is an easy way to define a new Operation from a series of existing ones. The argument is a list of Operation (or Operation instances) that are called in sequence to generate the returned element.
chain(operations=[gradient, threshold.instance(level=2)])
This operation can accept an Image instance and would first compute the gradient before thresholding the result at a level of 2.0.
Instances are only required when arguments need to be passed to individual operations so the resulting object is a function over a single argument.
Parameters inherited from:
holoviews.core.operation.Operation
: dynamic, input_ranges, link_inputs, streamsgroup
= param.String(allow_refs=False, default=’’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16916c150>)The group assigned to the result after having applied the chain. Defaults to the group produced by the last operation in the chain
output_type
= param.Parameter(allow_refs=False, default=<class ‘holoviews.element.raster.Image’>, label=’Output type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x1696d8090>)The output type of the chain operation. Must be supplied if the chain is to be used as a channel operation.
operations
= param.List(allow_refs=False, bounds=(0, None), class_=<class ‘holoviews.core.operation.Operation’>, default=[], item_type=<class ‘holoviews.core.operation.Operation’>, label=’Operations’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168f52bd0>)A list of Operations (or Operation instances) that are applied on the input from left to right.
- find(operation, skip_nonlinked=True)[source]#
Returns the first found occurrence of an operation while performing a backward traversal of the chain pipeline.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.element.collapse(*, fn, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Given an overlay of Element types, collapse into single Element object using supplied function. Collapsing aggregates over the key dimensions of each object applying the supplied fn to each group.
This is an example of an Operation that does not involve any Raster types.
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamsfn
= param.Callable(allow_refs=False, default=<function mean at 0x103fe22b0>, label=’Fn’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a545710>)The function that is used to collapse the curve y-values for each x-value.
- fn(axis=None, dtype=None, out=None, keepdims=<no value>, *, where=<no value>)[source]#
Compute the arithmetic mean along the specified axis.
Returns the average of the array elements. The average is taken over the flattened array by default, otherwise over the specified axis. float64 intermediate and return values are used for integer inputs.
Parameters#
- aarray_like
Array containing numbers whose mean is desired. If a is not an array, a conversion is attempted.
- axisNone or int or tuple of ints, optional
Axis or axes along which the means are computed. The default is to compute the mean of the flattened array.
Added 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. See ufuncs-output-type for more details.- keepdimsbool, optional
If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.
If the default value is passed, then keepdims will not be passed through to the mean method of sub-classes of ndarray, however any non-default value will be. If the sub-class’ method does not implement keepdims any exceptions will be raised.
- wherearray_like of bool, optional
Elements to include in the mean. See ~numpy.ufunc.reduce for details.
Added in version 1.20.0.
Returns#
- mndarray, see dtype parameter above
If out=None, returns a new array containing the mean values, otherwise a reference to the output array is returned.
See Also#
average : Weighted average std, var, nanmean, nanstd, nanvar
Notes#
The arithmetic mean is the sum of the elements along the axis divided by the number of elements.
Note that for floating-point input, the mean is computed using the same precision the input has. Depending on the input data, this can cause the results to be inaccurate, especially for float32 (see example below). Specifying a higher-precision accumulator using the dtype keyword can alleviate this issue.
By default, float16 results are computed using float32 intermediates for extra precision.
Examples#
>>> a = np.array([[1, 2], [3, 4]]) >>> np.mean(a) 2.5 >>> np.mean(a, axis=0) array([2., 3.]) >>> np.mean(a, axis=1) array([1.5, 3.5])
In single precision, mean can be inaccurate:
>>> a = np.zeros((2, 512*512), dtype=np.float32) >>> a[0, :] = 1.0 >>> a[1, :] = 0.1 >>> np.mean(a) 0.54999924
Computing the mean in float64 is more accurate:
>>> np.mean(a, dtype=np.float64) 0.55000000074505806 # may vary
Specifying a where argument:
>>> a = np.array([[5, 9, 13], [14, 10, 12], [11, 15, 19]]) >>> np.mean(a) 12.0 >>> np.mean(a, where=[[True], [False], [False]]) 9.0
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.element.contours(*, filled, levels, overlaid, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Given a Image with a single channel, annotate it with contour lines for a given set of contour levels.
The return is an NdOverlay with a Contours layer for each given level, overlaid on top of the input Image.
Parameters inherited from:
holoviews.core.operation.Operation
: dynamic, input_ranges, link_inputs, streamsgroup
= param.String(allow_refs=False, default=’Level’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a56b450>)The group assigned to the output contours.
levels
= param.ClassSelector(allow_refs=False, class_=(<class ‘list’>, <class ‘int’>), default=10, label=’Levels’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a560d10>)A list of scalar values used to specify the contour levels.
filled
= param.Boolean(allow_refs=False, default=False, label=’Filled’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a4c2350>)Whether to generate filled contours
overlaid
= param.Boolean(allow_refs=False, default=False, label=’Overlaid’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a5606d0>)Whether to overlay the contour on the supplied Element.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.element.convolve(*, kernel_roi, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Apply a convolution to an overlay using the top layer as the kernel for convolving the bottom layer. Both Image elements in the input overlay should have a single value dimension.
Parameters inherited from:
holoviews.core.operation.Operation
: dynamic, input_ranges, link_inputs, streamsgroup
= param.String(allow_refs=False, default=’Convolution’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a580ad0>)The group assigned to the convolved output.
kernel_roi
= param.NumericTuple(allow_refs=False, default=(0, 0, 0, 0), label=’Kernel roi’, length=4, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a593dd0>)A 2-dimensional slice of the kernel layer to use in the convolution in lbrt (left, bottom, right, top) format. By default, no slicing is applied.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.element.decimate(*, max_samples, random_seed, x_range, y_range, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Decimates any column based Element to a specified number of random rows if the current element defined by the x_range and y_range contains more than max_samples. By default the operation returns a DynamicMap with a RangeXY stream allowing dynamic downsampling.
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesdynamic
= param.Boolean(allow_refs=False, default=True, label=’Dynamic’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a5b1950>)Enables dynamic processing by default.
link_inputs
= param.Boolean(allow_refs=False, default=True, label=’Link inputs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a5b3010>)By default, the link_inputs parameter is set to True so that when applying shade, backends that support linked streams update RangeXY streams on the inputs of the shade operation.
streams
= param.ClassSelector(allow_refs=False, class_=(<class ‘dict’>, <class ‘list’>), default=[<class ‘holoviews.streams.RangeXY’>], label=’Streams’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a5b31d0>)List of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.
max_samples
= param.Integer(allow_refs=False, default=5000, inclusive_bounds=(True, True), label=’Max samples’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a5b36d0>)Maximum number of samples to display at the same time.
random_seed
= param.Integer(allow_refs=False, default=42, inclusive_bounds=(True, True), label=’Random seed’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a5b3bd0>)Seed used to initialize randomization.
x_range
= param.NumericTuple(allow_None=True, allow_refs=False, label=’X range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a5b3010>)The x_range as a tuple of min and max x-value. Auto-ranges if set to None.
y_range
= param.NumericTuple(allow_None=True, allow_refs=False, label=’Y range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a5b1950>)The x_range as a tuple of min and max y-value. Auto-ranges if set to None.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.element.factory(*, args, kwargs, output_type, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Simple operation that constructs any element that accepts some other element as input. For instance, RGB and HSV elements can be created from overlays of Image elements.
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamsoutput_type
= param.Parameter(allow_refs=False, default=<class ‘holoviews.element.raster.RGB’>, label=’Output type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a47e590>)The output type of the factor operation. By default, if three overlaid Images elements are supplied, the corresponding RGB element will be returned.
args
= param.List(allow_refs=False, bounds=(0, None), default=[], label=’Args’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a46f4d0>)The list of positional argument to pass to the factory
kwargs
= param.Dict(allow_refs=False, class_=<class ‘dict’>, default={}, label=’Kwargs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x168f509d0>)The dict of keyword arguments to pass to the factory
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.element.function(*, args, fn, input_type, kwargs, output_type, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamsoutput_type
= param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ‘type’>, label=’Output type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a4a7150>)The output type of the method operation
input_type
= param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ‘type’>, label=’Input type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a439e10>)The object type the method is defined on
fn
= param.Callable(allow_refs=False, label=’Fn’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a35d450>)The function to apply.
args
= param.List(allow_refs=False, bounds=(0, None), default=[], label=’Args’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a442c10>)The list of positional argument to pass to the method
kwargs
= param.Dict(allow_refs=False, class_=<class ‘dict’>, default={}, label=’Kwargs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a439e10>)The dict of keyword arguments to pass to the method
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.element.gradient(*, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Compute the gradient plot of the supplied Image.
If the Image value dimension is cyclic, the smallest step is taken considered the cyclic range
Parameters inherited from:
holoviews.core.operation.Operation
: dynamic, input_ranges, link_inputs, streamsgroup
= param.String(allow_refs=False, default=’Gradient’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a5f4f10>)The group assigned to the output gradient matrix.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.element.gridmatrix(*, chart_type, diagonal_operation, diagonal_type, overlay_dims, name)[source]#
Bases:
ParameterizedFunction
The gridmatrix operation takes an Element or HoloMap of Elements as input and creates a GridMatrix object, which plots each dimension in the Element against each other dimension. This provides a very useful overview of high-dimensional data and is inspired by pandas and seaborn scatter_matrix implementations.
chart_type
= param.Parameter(allow_refs=False, default=<class ‘holoviews.element.chart.Scatter’>, label=’Chart type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a6077d0>)The Element type used to display bivariate distributions of the data.
diagonal_type
= param.Parameter(allow_None=True, allow_refs=False, label=’Diagonal type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a614ed0>)The Element type along the diagonal, may be a Histogram or any other plot type which can visualize a univariate distribution. This parameter overrides diagonal_operation.
diagonal_operation
= param.Parameter(allow_refs=False, default=<class ‘holoviews.operation.element.histogram’>, label=’Diagonal operation’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a607490>)The operation applied along the diagonal, may be a histogram-operation or any other function which returns a viewable element.
overlay_dims
= param.List(allow_refs=False, bounds=(0, None), default=[], label=’Overlay dims’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a614f50>)If a HoloMap is supplied, this will allow overlaying one or more of its key dimensions.
- class holoviews.operation.element.histogram(*, bin_range, bins, cumulative, dimension, frequency_label, groupby, groupby_range, log, mean_weighted, nonzero, normed, num_bins, style_prefix, weight_dimension, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Returns a Histogram of the input element data, binned into num_bins over the bin_range (if specified) along the specified dimension.
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamsbin_range
= param.NumericTuple(allow_None=True, allow_refs=False, label=’Bin range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a622990>)Specifies the range within which to compute the bins.
bins
= param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ‘numpy.ndarray’>, <class ‘list’>, <class ‘tuple’>, <class ‘str’>), label=’Bins’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a630250>)An explicit set of bin edges or a method to find the optimal set of bin edges, e.g. ‘auto’, ‘fd’, ‘scott’ etc. For more documentation on these approaches see the np.histogram_bin_edges documentation.
cumulative
= param.Boolean(allow_refs=False, default=False, label=’Cumulative’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a622610>)Whether to compute the cumulative histogram
dimension
= param.String(allow_None=True, allow_refs=False, label=’Dimension’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a623ed0>)Along which dimension of the Element to compute the histogram.
frequency_label
= param.String(allow_None=True, allow_refs=False, label=’Frequency label’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a622610>)Format string defining the label of the frequency dimension of the Histogram.
groupby
= param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ‘str’>, <class ‘holoviews.core.dimension.Dimension’>), label=’Groupby’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a6228d0>)Defines a dimension to group the Histogram returning an NdOverlay of Histograms.
groupby_range
= param.Selector(allow_refs=False, default=’shared’, label=’Groupby range’, names={}, nested_refs=False, objects=[‘shared’, ‘separated’], rx=<param.reactive.reactive_ops object at 0x16a630410>)Whether to group the histograms along the same range or separate them.
log
= param.Boolean(allow_refs=False, default=False, label=’Log’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a623e10>)Whether to use base 10 logarithmic samples for the bin edges.
mean_weighted
= param.Boolean(allow_refs=False, default=False, label=’Mean weighted’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a622a90>)Whether the weighted frequencies are averaged.
normed
= param.Selector(allow_refs=False, default=False, label=’Normed’, names={}, nested_refs=False, objects=[True, False, ‘integral’, ‘height’], rx=<param.reactive.reactive_ops object at 0x16a630250>)Controls normalization behavior. If True or ‘integral’, then density=True is passed to np.histogram, and the distribution is normalized such that the integral is unity. If False, then the frequencies will be raw counts. If ‘height’, then the frequencies are normalized such that the max bin height is unity.
nonzero
= param.Boolean(allow_refs=False, default=False, label=’Nonzero’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a622a90>)Whether to use only nonzero values when computing the histogram
num_bins
= param.Integer(allow_refs=False, default=20, inclusive_bounds=(True, True), label=’Num bins’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a630610>)Number of bins in the histogram .
weight_dimension
= param.String(allow_None=True, allow_refs=False, label=’Weight dimension’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a622a90>)Name of the dimension the weighting should be drawn from
style_prefix
= param.String(allow_None=True, allow_refs=False, label=’Style prefix’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a623ed0>)Used for setting a common style for histograms in a HoloMap or AdjointLayout.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.element.image_overlay(*, default_range, fill, spec, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Operation to build a overlay of images to a specification from a subset of the required elements.
This is useful for reordering the elements of an overlay, duplicating layers of an overlay or creating blank image elements in the appropriate positions.
For instance, image_overlay may build a three layered input suitable for the RGB factory operation even if supplied with one or two of the required channels (creating blank channels for the missing elements).
Note that if there is any ambiguity regarding the match, the strongest match will be used. In the case of a tie in match strength, the first layer in the input is used. One successful match is always required.
Parameters inherited from:
holoviews.core.operation.Operation
: dynamic, input_ranges, link_inputs, streamsgroup
= param.String(allow_refs=False, default=’Transform’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a652b50>)The group assigned to the resulting overlay.
spec
= param.String(allow_refs=False, default=’’, label=’Spec’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a648350>)Specification of the output Overlay structure. For instance: Image.R * Image.G * Image.B Will ensure an overlay of this structure is created even if (for instance) only (Image.R * Image.B) is supplied. Elements in the input overlay that match are placed in the appropriate positions and unavailable specification elements are created with the specified fill group.
fill
= param.Number(allow_refs=False, default=0, inclusive_bounds=(True, True), label=’Fill’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a648750>)default_range
= param.Tuple(allow_refs=False, default=(0, 1), label=’Default range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a653e10>)The default range that will be set on the value_dimension of any automatically created blank image elements.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.element.interpolate_curve(*, interpolation, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Resamples a Curve using the defined interpolation method, e.g. to represent changes in y-values as steps.
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamsinterpolation
= param.Selector(allow_refs=False, default=’steps-mid’, label=’Interpolation’, names={}, nested_refs=False, objects=[‘steps-pre’, ‘steps-mid’, ‘steps-post’, ‘linear’], rx=<param.reactive.reactive_ops object at 0x16a6662d0>)Controls the transition point of the step along the x-axis.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.element.method(*, args, input_type, kwargs, method_name, output_type, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Operation that wraps a method call
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamsoutput_type
= param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ‘type’>, label=’Output type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a67b010>)The output type of the method operation
input_type
= param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ‘type’>, label=’Input type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a686790>)The object type the method is defined on
method_name
= param.String(allow_refs=False, default=’__call__’, label=’Method name’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a685390>)The method name
args
= param.List(allow_refs=False, bounds=(0, None), default=[], label=’Args’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a686710>)The list of positional argument to pass to the method
kwargs
= param.Dict(allow_refs=False, class_=<class ‘dict’>, default={}, label=’Kwargs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a685390>)The dict of keyword arguments to pass to the method
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.element.operation(*, op, output_type, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
The most generic operation that wraps any callable into an Operation. The callable needs to accept an HoloViews component and a key (that may be ignored) and must return a new HoloViews component.
This class may be useful for turning a HoloViews method into an operation to define as compositor operation. For instance, the following definition:
operation.instance(op=lambda x, k: x.collapse(np.subtract))
Could be used to implement a collapse operation to subtracts the data between Rasters in an Overlay.
Parameters inherited from:
holoviews.core.operation.Operation
: dynamic, input_ranges, link_inputs, streamsgroup
= param.String(allow_refs=False, default=’Operation’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a69bd90>)The group assigned to the result after having applied the operator.
output_type
= param.Parameter(allow_None=True, allow_refs=False, label=’Output type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a6ad4d0>)The output element type which may be None to disable type checking. May be used to declare useful information to other code in HoloViews, e.g. required for tab-completion support of operations registered with compositors.
op
= param.Callable(allow_refs=False, label=’Op’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a69b890>)The operation used to generate a new HoloViews object returned by the operation. By default, the identity operation is applied.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.element.threshold(*, high, level, low, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Threshold a given Image whereby all values higher than a given level map to the specified high value and all values lower than that level map to the specified low value.
Parameters inherited from:
holoviews.core.operation.Operation
: dynamic, input_ranges, link_inputs, streamsgroup
= param.String(allow_refs=False, default=’Threshold’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a6ce6d0>)The group assigned to the thresholded output.
level
= param.Number(allow_refs=False, default=0.5, inclusive_bounds=(True, True), label=’Level’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a6c82d0>)The value at which the threshold is applied. Values lower than the threshold map to the ‘low’ value and values above map to the ‘high’ value.
high
= param.Number(allow_refs=False, default=1.0, inclusive_bounds=(True, True), label=’High’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a6c88d0>)The value given to elements greater than (or equal to) the threshold.
low
= param.Number(allow_refs=False, default=0.0, inclusive_bounds=(True, True), label=’Low’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a6c8210>)The value given to elements below the threshold.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.element.transform(*, operator, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Generic Operation to transform an input Image or RGBA element into an output Image. The transformation is defined by the supplied callable that accepts the data of the input Image (typically a numpy array) and returns the transformed data of the output Image.
This operator is extremely versatile; for instance, you could implement an alternative to the explicit threshold operator with:
operator=lambda x: np.clip(x, 0, 0.5)
Alternatively, you can implement a transform computing the 2D autocorrelation using the scipy library with:
operator=lambda x: scipy.signal.correlate2d(x, x)
Parameters inherited from:
holoviews.core.operation.Operation
: dynamic, input_ranges, link_inputs, streamsgroup
= param.String(allow_refs=False, default=’Transform’, label=’Group’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a6edbd0>)The group assigned to the result after applying the transform.
operator
= param.Callable(allow_None=True, allow_refs=False, label=’Operator’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a6ef2d0>)Function of one argument that transforms the data in the input Image to the data in the output Image. By default, acts as the identity function such that the output matches the input.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
normalization
Module#
Data normalization operations.
Normalizing input data into a valid range is a common operation and often required before further processing. The semantics of normalization are dependent on the element type being normalized making it difficult to provide a general and consistent interface.
The Normalization class is used to define such an interface and subclasses are used to implement the appropriate normalization operations per element type. Unlike display normalization, data normalizations result in transformations to the stored data within each element.
- class holoviews.operation.normalization.Normalization(*, data_range, keys, ranges, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Base class for all normalization operation.
This class standardizes how normalization is specified using the ranges and keys parameter. The ranges parameter is designed to be very flexible, allowing a concise description for simple normalization while allowing complex key- and element- specific normalization to also be specified.
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamsdata_range
= param.Boolean(allow_refs=False, default=False, label=’Data range’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16a9a9ad0>)Whether normalization is allowed to use the minimum and maximum values of the existing data to infer an appropriate range
ranges
= param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ‘dict’>, <class ‘list’>), default={}, label=’Ranges’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16aa81bd0>)The simplest value of this parameter is None to skip all normalization. The next simplest value is an empty dictionary to only applies normalization to Dimensions with explicitly declared ranges. The next most common specification is a dictionary of values and tuple ranges. The value keys are the names of the dimensions to be normalized and the tuple ranges are of form (lower-bound, upper-bound). For instance, you could specify: {‘Height’:(0, 200), ‘z’:(0,1)} In this case, any element with a ‘Height’ or ‘z’ dimension (or both) will be normalized to the supplied ranges. Finally, element-specific normalization may also be specified by supplying a match tuple of form (<type>, <group>, <label>). A 1- or 2-tuple may be supplied by omitting the <group>, <label> or just the <label> components respectively. This tuple key then uses the dictionary value-range specification described above. For instance, you could normalize only the Image elements of group pattern using: {(‘Image’,’Pattern’):{‘Height’:(0, 200), ‘z’:(0,1)}}) Key-wise normalization is possible for all these formats by supplying a list of such dictionary specification that will then be zipped with the keys parameter (if specified).
keys
= param.List(allow_None=True, allow_refs=False, bounds=(0, None), label=’Keys’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16aa81fd0>)If supplied, this list of keys is zipped with the supplied list of ranges. These keys are used to supply key specific normalization for HoloMaps containing matching key values, enabling per-element normalization.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- get_ranges(element, key)[source]#
Method to get the appropriate normalization range dictionary given a key and element.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.normalization.raster_normalization(*, data_range, keys, ranges, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Normalization
Normalizes elements of type Raster.
For Raster elements containing (NxM) data, this will normalize the array/matrix into the specified range if value_dimension matches a key in the ranges dictionary.
For elements containing (NxMxD) data, the (NxM) components of the third dimensional are normalized independently if the corresponding value dimensions are selected by the ranges dictionary.
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamsholoviews.operation.normalization.Normalization
: data_range, ranges, keys- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- get_ranges(element, key)[source]#
Method to get the appropriate normalization range dictionary given a key and element.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.normalization.subcoordinate_group_ranges(*, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Compute the data range group-wise in a subcoordinate_y overlay, and set the dimension range of each Chart element based on the value computed for its group.
This operation is useful to visually apply a group-wise min-max normalisation.
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streams- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
resample
Module#
- class holoviews.operation.resample.LinkableOperation(*, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Abstract baseclass for operations supporting linked inputs.
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, streamslink_inputs
= param.Boolean(allow_refs=False, default=True, label=’Link inputs’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ac6cf90>)By default, the link_inputs parameter is set to True so that when applying an operation, backends that support linked streams update RangeXY streams on the inputs of the operation. Disable when you do not want the resulting plot to be interactive, e.g. when trying to display an interactive plot a second time.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.resample.ResampleOperation1D(*, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
LinkableOperation
Abstract baseclass for resampling operations
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesholoviews.operation.resample.LinkableOperation
: link_inputsdynamic
= param.Boolean(allow_refs=False, default=True, label=’Dynamic’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ac27050>)Enables dynamic processing by default.
streams
= param.ClassSelector(allow_refs=False, class_=(<class ‘dict’>, <class ‘list’>), default=[<class ‘holoviews.streams.PlotSize’>, <class ‘holoviews.streams.RangeX’>], label=’Streams’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ac24b10>)List or dictionary of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.
x_range
= param.Tuple(allow_None=True, allow_refs=False, label=’X range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ac27110>)The x_range as a tuple of min and max x-value. Auto-ranges if set to None.
x_sampling
= param.Number(allow_None=True, allow_refs=False, inclusive_bounds=(True, True), label=’X sampling’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ac24590>)Specifies the smallest allowed sampling interval along the x axis.
width
= param.Integer(allow_refs=False, default=400, inclusive_bounds=(True, True), label=’Width’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ac242d0>)The width of the output image in pixels.
height
= param.Integer(allow_refs=False, default=400, inclusive_bounds=(True, True), label=’Height’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ac24750>)The height of the output image in pixels.
pixel_ratio
= param.Number(allow_None=True, allow_refs=False, bounds=(0, None), inclusive_bounds=(False, False), label=’Pixel ratio’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ac240d0>)Pixel ratio applied to the height and width. Useful for higher resolution screens where the PlotSize stream reports ‘nominal’ dimensions in pixels that do not match the physical pixels. For instance, setting pixel_ratio=2 can give better results on Retina displays. Also useful for using lower resolution for speed. If not set explicitly, the zoom level of the browsers will be used, if available.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.resample.ResampleOperation2D(*, element_type, expand, precompute, target, y_range, y_sampling, height, pixel_ratio, width, x_range, x_sampling, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
ResampleOperation1D
Abstract baseclass for resampling operations
Parameters inherited from:
holoviews.core.operation.Operation
: group, input_rangesholoviews.operation.resample.LinkableOperation
: link_inputsholoviews.operation.resample.ResampleOperation1D
: x_range, x_sampling, width, height, pixel_ratiodynamic
= param.Boolean(allow_refs=False, default=True, label=’Dynamic’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16abf2d50>)Enables dynamic processing by default.
streams
= param.ClassSelector(allow_refs=False, class_=(<class ‘dict’>, <class ‘list’>), default=[<class ‘holoviews.streams.PlotSize’>, <class ‘holoviews.streams.RangeXY’>], label=’Streams’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ab211d0>)List or dictionary of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.
expand
= param.Boolean(allow_refs=False, default=True, label=’Expand’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16abf38d0>)Whether the x_range and y_range should be allowed to expand beyond the extent of the data. Setting this value to True is useful for the case where you want to ensure a certain size of output grid, e.g. if you are doing masking or other arithmetic on the grids. A value of False ensures that the grid is only just as large as it needs to be to contain the data, which will be faster and use less memory if the resulting aggregate is being overlaid on a much larger background.
y_range
= param.Tuple(allow_None=True, allow_refs=False, label=’Y range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ab21750>)The y-axis range as a tuple of min and max y value. Auto-ranges if set to None.
y_sampling
= param.Number(allow_None=True, allow_refs=False, inclusive_bounds=(True, True), label=’Y sampling’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ab23750>)Specifies the smallest allowed sampling interval along the y axis.
target
= param.ClassSelector(allow_None=True, allow_refs=False, class_=<class ‘holoviews.core.data.Dataset’>, label=’Target’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ab21750>)A target Dataset which defines the desired x_range, y_range, width and height.
element_type
= param.ClassSelector(allow_refs=False, class_=(<class ‘holoviews.core.data.Dataset’>,), default=<class ‘holoviews.element.raster.Image’>, label=’Element type’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16abf2a50>)The type of the returned Elements, must be a 2D Dataset type.
precompute
= param.Boolean(allow_refs=False, default=False, label=’Precompute’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16abf2d50>)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.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
stats
Module#
- class holoviews.operation.stats.bivariate_kde(*, bandwidth, bw_method, contours, cut, filled, levels, n_samples, x_range, y_range, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Computes a 2D kernel density estimate (KDE) of the first two dimensions in the input data. Kernel density estimation is a non-parametric way to estimate the probability density function of a random variable.
The KDE works by placing 2D Gaussian kernel at each sample with the supplied bandwidth. These kernels are then summed to produce the density estimate. By default a good bandwidth is determined using the bw_method but it may be overridden by an explicit value.
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamscontours
= param.Boolean(allow_refs=False, default=True, label=’Contours’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16acebf10>)Whether to compute contours from the KDE, determines whether to return an Image or Contours/Polygons.
bw_method
= param.Selector(allow_refs=False, default=’scott’, label=’Bw method’, names={}, nested_refs=False, objects=[‘scott’, ‘silverman’], rx=<param.reactive.reactive_ops object at 0x16ad9a090>)Method of automatically determining KDE bandwidth
bandwidth
= param.Number(allow_None=True, allow_refs=False, inclusive_bounds=(True, True), label=’Bandwidth’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ad9a910>)Allows supplying explicit bandwidth value rather than relying on scott or silverman method.
cut
= param.Number(allow_refs=False, default=3, inclusive_bounds=(True, True), label=’Cut’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ad9a690>)Draw the estimate to cut * bw from the extreme data points.
filled
= param.Boolean(allow_refs=False, default=False, label=’Filled’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ad98550>)Controls whether to return filled or unfilled contours.
levels
= param.ClassSelector(allow_refs=False, class_=(<class ‘list’>, <class ‘int’>), default=10, label=’Levels’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ad99d10>)A list of scalar values used to specify the contour levels.
n_samples
= param.Integer(allow_refs=False, default=100, inclusive_bounds=(True, True), label=’N samples’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ad9a690>)Number of samples to compute the KDE over.
x_range
= param.NumericTuple(allow_None=True, allow_refs=False, label=’X range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ad99e50>)The x_range as a tuple of min and max x-value. Auto-ranges if set to None.
y_range
= param.NumericTuple(allow_None=True, allow_refs=False, label=’Y range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ad9a350>)The x_range as a tuple of min and max y-value. Auto-ranges if set to None.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.stats.univariate_kde(*, bandwidth, bin_range, bw_method, cut, dimension, filled, groupby, n_samples, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Computes a 1D kernel density estimate (KDE) along the supplied dimension. Kernel density estimation is a non-parametric way to estimate the probability density function of a random variable.
The KDE works by placing a Gaussian kernel at each sample with the supplied bandwidth. These kernels are then summed to produce the density estimate. By default a good bandwidth is determined using the bw_method but it may be overridden by an explicit value.
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamsbw_method
= param.Selector(allow_refs=False, default=’scott’, label=’Bw method’, names={}, nested_refs=False, objects=[‘scott’, ‘silverman’], rx=<param.reactive.reactive_ops object at 0x16ad83410>)Method of automatically determining KDE bandwidth
bandwidth
= param.Number(allow_None=True, allow_refs=False, inclusive_bounds=(True, True), label=’Bandwidth’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ad85050>)Allows supplying explicit bandwidth value rather than relying on scott or silverman method.
cut
= param.Number(allow_refs=False, default=3, inclusive_bounds=(True, True), label=’Cut’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ad85410>)Draw the estimate to cut * bw from the extreme data points.
bin_range
= param.NumericTuple(allow_None=True, allow_refs=False, label=’Bin range’, length=2, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ad84810>)Specifies the range within which to compute the KDE.
dimension
= param.String(allow_None=True, allow_refs=False, label=’Dimension’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ad82fd0>)Along which dimension of the Element to compute the KDE.
filled
= param.Boolean(allow_refs=False, default=True, label=’Filled’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ad84690>)Controls whether to return filled or unfilled KDE.
n_samples
= param.Integer(allow_refs=False, default=100, inclusive_bounds=(True, True), label=’N samples’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ad853d0>)Number of samples to compute the KDE over.
groupby
= param.ClassSelector(allow_None=True, allow_refs=False, class_=(<class ‘str’>, <class ‘holoviews.core.dimension.Dimension’>), label=’Groupby’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ad84790>)Defines a dimension to group the Histogram returning an NdOverlay of Histograms.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
timeseries
Module#
- class holoviews.operation.timeseries.RollingBase(*, center, min_periods, rolling_window, name)[source]#
Bases:
Parameterized
Parameters shared between rolling and rolling_outlier_std.
center
= param.Boolean(allow_refs=False, default=True, label=’Center’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ae3e550>)Whether to set the x-coordinate at the center or right edge of the window.
min_periods
= param.Integer(allow_None=True, allow_refs=False, inclusive_bounds=(True, True), label=’Min periods’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ae03f10>)Minimum number of observations in window required to have a value (otherwise result is NaN).
rolling_window
= param.Integer(allow_refs=False, default=10, inclusive_bounds=(True, True), label=’Rolling window’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ae022d0>)The window size over which to operate.
- class holoviews.operation.timeseries.resample(*, closed, function, label, rule, dynamic, group, input_ranges, link_inputs, streams, name)[source]#
Bases:
Operation
Resamples a timeseries of dates with a frequency and function.
Parameters inherited from:
holoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamsclosed
= param.Selector(allow_None=True, allow_refs=False, label=’Closed’, names={}, nested_refs=False, objects=[‘left’, ‘right’], rx=<param.reactive.reactive_ops object at 0x16ae0e3d0>)Which side of bin interval is closed
function
= param.Callable(allow_refs=False, default=<function mean at 0x103fe22b0>, label=’Function’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ae0d0d0>)Function for computing new values out of existing ones.
label
= param.Selector(allow_refs=False, default=’right’, label=’Label’, names={}, nested_refs=False, objects=[‘right’], rx=<param.reactive.reactive_ops object at 0x16ae0e310>)The bin edge to label the bin with.
rule
= param.String(allow_refs=False, default=’D’, label=’Rule’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ae0d810>)A string representing the time interval over which to apply the resampling
- function(axis=None, dtype=None, out=None, keepdims=<no value>, *, where=<no value>)[source]#
Compute the arithmetic mean along the specified axis.
Returns the average of the array elements. The average is taken over the flattened array by default, otherwise over the specified axis. float64 intermediate and return values are used for integer inputs.
Parameters#
- aarray_like
Array containing numbers whose mean is desired. If a is not an array, a conversion is attempted.
- axisNone or int or tuple of ints, optional
Axis or axes along which the means are computed. The default is to compute the mean of the flattened array.
Added 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. See ufuncs-output-type for more details.- keepdimsbool, optional
If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.
If the default value is passed, then keepdims will not be passed through to the mean method of sub-classes of ndarray, however any non-default value will be. If the sub-class’ method does not implement keepdims any exceptions will be raised.
- wherearray_like of bool, optional
Elements to include in the mean. See ~numpy.ufunc.reduce for details.
Added in version 1.20.0.
Returns#
- mndarray, see dtype parameter above
If out=None, returns a new array containing the mean values, otherwise a reference to the output array is returned.
See Also#
average : Weighted average std, var, nanmean, nanstd, nanvar
Notes#
The arithmetic mean is the sum of the elements along the axis divided by the number of elements.
Note that for floating-point input, the mean is computed using the same precision the input has. Depending on the input data, this can cause the results to be inaccurate, especially for float32 (see example below). Specifying a higher-precision accumulator using the dtype keyword can alleviate this issue.
By default, float16 results are computed using float32 intermediates for extra precision.
Examples#
>>> a = np.array([[1, 2], [3, 4]]) >>> np.mean(a) 2.5 >>> np.mean(a, axis=0) array([2., 3.]) >>> np.mean(a, axis=1) array([1.5, 3.5])
In single precision, mean can be inaccurate:
>>> a = np.zeros((2, 512*512), dtype=np.float32) >>> a[0, :] = 1.0 >>> a[1, :] = 0.1 >>> np.mean(a) 0.54999924
Computing the mean in float64 is more accurate:
>>> np.mean(a, dtype=np.float64) 0.55000000074505806 # may vary
Specifying a where argument:
>>> a = np.array([[5, 9, 13], [14, 10, 12], [11, 15, 19]]) >>> np.mean(a) 12.0 >>> np.mean(a, where=[[True], [False], [False]]) 9.0
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.timeseries.rolling(*, function, window_type, dynamic, group, input_ranges, link_inputs, streams, center, min_periods, rolling_window, name)[source]#
Bases:
Operation
,RollingBase
Applies a function over a rolling window.
Parameters inherited from:
holoviews.operation.timeseries.RollingBase
: center, min_periods, rolling_windowholoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamswindow_type
= param.Selector(allow_None=True, allow_refs=False, label=’Window type’, names={}, nested_refs=False, objects=[‘boxcar’, ‘triang’, ‘blackman’, ‘hamming’, ‘bartlett’, ‘parzen’, ‘bohman’, ‘blackmanharris’, ‘nuttall’, ‘barthann’, ‘kaiser’, ‘gaussian’, ‘general_gaussian’, ‘slepian’], rx=<param.reactive.reactive_ops object at 0x16ad2bc90>)The shape of the window to apply
function
= param.Callable(allow_refs=False, default=<function mean at 0x103fe22b0>, label=’Function’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ad34b10>)The function to apply over the rolling window.
- function(axis=None, dtype=None, out=None, keepdims=<no value>, *, where=<no value>)[source]#
Compute the arithmetic mean along the specified axis.
Returns the average of the array elements. The average is taken over the flattened array by default, otherwise over the specified axis. float64 intermediate and return values are used for integer inputs.
Parameters#
- aarray_like
Array containing numbers whose mean is desired. If a is not an array, a conversion is attempted.
- axisNone or int or tuple of ints, optional
Axis or axes along which the means are computed. The default is to compute the mean of the flattened array.
Added 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. See ufuncs-output-type for more details.- keepdimsbool, optional
If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, the result will broadcast correctly against the input array.
If the default value is passed, then keepdims will not be passed through to the mean method of sub-classes of ndarray, however any non-default value will be. If the sub-class’ method does not implement keepdims any exceptions will be raised.
- wherearray_like of bool, optional
Elements to include in the mean. See ~numpy.ufunc.reduce for details.
Added in version 1.20.0.
Returns#
- mndarray, see dtype parameter above
If out=None, returns a new array containing the mean values, otherwise a reference to the output array is returned.
See Also#
average : Weighted average std, var, nanmean, nanstd, nanvar
Notes#
The arithmetic mean is the sum of the elements along the axis divided by the number of elements.
Note that for floating-point input, the mean is computed using the same precision the input has. Depending on the input data, this can cause the results to be inaccurate, especially for float32 (see example below). Specifying a higher-precision accumulator using the dtype keyword can alleviate this issue.
By default, float16 results are computed using float32 intermediates for extra precision.
Examples#
>>> a = np.array([[1, 2], [3, 4]]) >>> np.mean(a) 2.5 >>> np.mean(a, axis=0) array([2., 3.]) >>> np.mean(a, axis=1) array([1.5, 3.5])
In single precision, mean can be inaccurate:
>>> a = np.zeros((2, 512*512), dtype=np.float32) >>> a[0, :] = 1.0 >>> a[1, :] = 0.1 >>> np.mean(a) 0.54999924
Computing the mean in float64 is more accurate:
>>> np.mean(a, dtype=np.float64) 0.55000000074505806 # may vary
Specifying a where argument:
>>> a = np.array([[5, 9, 13], [14, 10, 12], [11, 15, 19]]) >>> np.mean(a) 12.0 >>> np.mean(a, where=[[True], [False], [False]]) 9.0
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.
- class holoviews.operation.timeseries.rolling_outlier_std(*, sigma, dynamic, group, input_ranges, link_inputs, streams, center, min_periods, rolling_window, name)[source]#
Bases:
Operation
,RollingBase
Detect outliers using the standard deviation within a rolling window.
Outliers are the array elements outside sigma standard deviations from the smoothed trend line, as calculated from the trend line residuals.
The rolling window is controlled by parameters shared with the rolling operation via the base class RollingBase, to make it simpler to use the same settings for both.
Parameters inherited from:
holoviews.operation.timeseries.RollingBase
: center, min_periods, rolling_windowholoviews.core.operation.Operation
: group, dynamic, input_ranges, link_inputs, streamssigma
= param.Number(allow_refs=False, default=2.0, inclusive_bounds=(True, True), label=’Sigma’, nested_refs=False, rx=<param.reactive.reactive_ops object at 0x16ae9f1d0>)Minimum sigma before a value is considered an outlier.
- classmethod get_overlay_bounds(overlay)[source]#
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
- classmethod get_overlay_label(overlay, default_label='')[source]#
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
- classmethod instance(**params)[source]#
Return an instance of this class, copying parameters from any existing instance provided.