holoviews.element Package ¶
element
Package
¶
-
class
holoviews.element.
Contours
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.element.path.Path
Contours is a type of Path that is also associated with a value (the contour level).
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Contours, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Image in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Contours optionally accept a value dimension, corresponding to the supplied values.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ObjectSelector
datatype
( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’], instantiate=True, objects=[], pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
param Number
level
( allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - Optional level associated with the set of Contours.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.path.Contours'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.path.Contours'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.path.Contours'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Bypasses selection on data and sets extents based on selection.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.path.Contours'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.path.Contours'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
split
( start=None , end=None , datatype=None , **kwargs ) ¶ -
The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
RGB
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.element.raster.Image
An RGB element is a Image containing channel data for the the red, green, blue and (optionally) the alpha channels. The values of each channel must be in the range 0.0 to 1.0.
In input array may have a shape of NxMx4 or NxMx3. In the latter case, the defined alpha dimension parameter is appended to the list of value dimensions.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=RGB, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Raster in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(3, 4), constant=False, default=[Dimension(‘R’), Dimension(‘G’), Dimension(‘B’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The dimension description of the data held in the matrix. If an alpha channel is supplied, the defined alpha_dimension is automatically appended to this list.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘image’, ‘grid’, ‘xarray’, ‘cube’, ‘dataframe’, ‘dictionary’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
param ClassSelector
bounds
( allow_None=False, constant=False, default=BoundingBox(radius=0.5), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The bounding region in sheet coordinates containing the data.
-
param ClassSelector
alpha_dimension
( allow_None=False, constant=False, default=A, instantiate=False, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The alpha dimension definition to add the value dimensions if an alpha channel is supplied.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates.
-
closest_cell_center
( x , y ) ¶ -
Given arbitrary sheet coordinates, return the sheet coordinates of the center of the closest unit.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.raster.RGB'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.raster.RGB'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.raster.RGB'>) ¶
-
classmethod
load_image
( filename , height=1 , array=False , bounds=None , bare=False , **kwargs ) [source] ¶ -
Returns an raster element or raw numpy array from a PNG image file, using matplotlib.
The specified height determines the bounds of the raster object in sheet coordinates: by default the height is 1 unit with the width scaled appropriately by the image aspect ratio.
Note that as PNG images are encoded as RGBA, the red component maps to the first channel, the green component maps to the second component etc. For RGB elements, this mapping is trivial but may be important for subclasses e.g. for HSV elements.
Setting bare=True will apply options disabling axis labels displaying just the bare image. Any additional keyword arguments will be passed to the Image object.
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
matrix2sheet
( float_row , float_col ) ¶ -
Convert a floating-point location (float_row,float_col) in matrix coordinates to its corresponding location (x,y) in sheet coordinates.
Valid for scalar or array float_row and float_col.
Inverse of sheet2matrix().
-
matrixidx2sheet
( row , col ) ¶ -
Return (x,y) where x and y are the floating point coordinates of the center of the given matrix cell (row,col). If the matrix cell represents a 0.2 by 0.2 region, then the center location returned would be 0.1,0.1.
NOTE: This is NOT the strict mathematical inverse of sheet2matrixidx(), because sheet2matrixidx() discards all but the integer portion of the continuous matrix coordinate.
Valid only for scalar or array row and col.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
rgb
¶ -
Returns the corresponding RGB element.
Other than the updating parameter definitions, this is the only change needed to implemented an arbitrary colorspace as a subclass of RGB.
-
sample
( samples=[] , **kwargs ) ¶ -
Allows sampling of an Image as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. On an Image the coordinates are continuously indexed and will always snap to the nearest coordinate.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.raster.RGB'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.raster.RGB'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sheet2matrix
( x , y ) ¶ -
Convert a point (x,y) in Sheet coordinates to continuous matrix coordinates.
Returns (float_row,float_col), where float_row corresponds to y, and float_col to x.
Valid for scalar or array x and y.
Note about Bounds For a Sheet with BoundingBox(points=((-0.5,-0.5),(0.5,0.5))) and density=3, x=-0.5 corresponds to float_col=0.0 and x=0.5 corresponds to float_col=3.0. float_col=3.0 is not inside the matrix representing this Sheet, which has the three columns (0,1,2). That is, x=-0.5 is inside the BoundingBox but x=0.5 is outside. Similarly, y=0.5 is inside (at row 0) but y=-0.5 is outside (at row 3) (it’s the other way round for y because the matrix row index increases as y decreases).
-
sheet2matrixidx
( x , y ) ¶ -
Convert a point (x,y) in sheet coordinates to the integer row and column index of the matrix cell in which that point falls, given a bounds and density. Returns (row,column).
Note that if coordinates along the right or bottom boundary are passed into this function, the returned matrix coordinate of the boundary will be just outside the matrix, because the right and bottom boundaries are exclusive.
Valid for scalar or array x and y.
-
sheetcoordinates_of_matrixidx
( ) ¶ -
Return x,y where x is a vector of sheet coordinates representing the x-center of each matrix cell, and y represents the corresponding y-center of the cell.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
xdensity
¶ -
The spacing between elements in an underlying matrix representation, in the x direction.
-
ydensity
¶ -
The spacing between elements in an underlying matrix representation, in the y direction.
-
param String
-
class
holoviews.element.
Scatter3D
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.core.element.Element3D
,holoviews.element.chart.Scatter
Scatter3D object represents a number of coordinates in 3D-space. Additionally Scatter3D points may have any number of value dimensions. The data may therefore be supplied as NxD matrix where N represents the number of samples, and D the number of key and value dimensions.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Scatter3D, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(0, None), constant=False, default=[Dimension(‘x’), Dimension(‘y’), Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Scatter3D can have optional value dimensions, which may be mapped onto color and size.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None, None, None), instantiate=False, length=6, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 3D space defined as (xmin, ymin, zmin, xmax, ymax, zmax).
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart3d.Scatter3D'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart3d.Scatter3D'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart3d.Scatter3D'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart3d.Scatter3D'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart3d.Scatter3D'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
HLine
( y , **params ) [source] ¶ -
Bases:
holoviews.element.annotation.Annotation
Horizontal line annotation at the given position
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=HLine, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ClassSelector
y
( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The y-position of the VLine which make be numeric or a timestamp.
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.annotation.HLine'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.annotation.HLine'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.annotation.HLine'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=[] , function=None , **reduce_map ) ¶ -
Base class signature to demonstrate API for reducing Elements, using some reduce function, e.g. np.mean, which is applied along a particular Dimension. The dimensions and reduce functions should be passed as keyword arguments or as a list of dimensions and a single function.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **sample_values ) ¶ -
Base class signature to demonstrate API for sampling Elements. To sample an Element supply either a list of samples or keyword arguments, where the key should match an existing key dimension on the Element.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.annotation.HLine'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.annotation.HLine'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Spread
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.element.chart.ErrorBars
Spread is a Chart Element type representing a spread of values as given by a mean and standard error or confidence intervals. Just like the ErrorBars Element type, mean and deviations from the mean should be supplied as either an Nx3 or Nx4 array representing the x-values, mean values and symmetric or asymmetric errors respective. Internally the data is always expanded to an Nx4 array.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Spread, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the quantity measured by the ErrorBars object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(1, 2), constant=True, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The Dimensions corresponding to the x- and y-positions of the error bars.
-
param List
vdims
( allow_None=False, bounds=(1, 3), constant=True, default=[Dimension(‘y’), Dimension(‘yerror’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.Spread'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.Spread'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.Spread'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.Spread'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.Spread'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Annotation
( data , **params ) [source] ¶ -
Bases:
holoviews.core.element.Element2D
An Annotation is a special type of element that is designed to be overlaid on top of any arbitrary 2D element. Annotations have neither key nor value dimensions allowing them to be overlaid over any type of data.
Note that one or more Annotations can be displayed without being overlaid on top of any other data. In such instances (by default) they will be displayed using the unit axis limits (0.0-1.0 in both directions) unless an explicit ‘extents’ parameter is supplied. The extents of the bottom Annotation in the Overlay is used when multiple Annotations are displayed together.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Annotation, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.annotation.Annotation'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.annotation.Annotation'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.annotation.Annotation'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=[] , function=None , **reduce_map ) ¶ -
Base class signature to demonstrate API for reducing Elements, using some reduce function, e.g. np.mean, which is applied along a particular Dimension. The dimensions and reduce functions should be passed as keyword arguments or as a list of dimensions and a single function.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **sample_values ) ¶ -
Base class signature to demonstrate API for sampling Elements. To sample an Element supply either a list of samples or keyword arguments, where the key should match an existing key dimension on the Element.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.annotation.Annotation'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.annotation.Annotation'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Trisurface
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.core.element.Element3D
,holoviews.element.chart.Scatter
Trisurface object represents a number of coordinates in 3D-space, represented as a Surface of triangular polygons.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Trisurface, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(0, None), constant=False, default=[Dimension(‘x’), Dimension(‘y’), Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Trisurface can have optional value dimensions, which may be mapped onto color and size.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None, None, None), instantiate=False, length=6, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 3D space defined as (xmin, ymin, zmin, xmax, ymax, zmax).
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart3d.Trisurface'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart3d.Trisurface'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart3d.Trisurface'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart3d.Trisurface'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart3d.Trisurface'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
ErrorBars
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.element.chart.Chart
ErrorBars is a Chart Element type representing any number of errorbars situated in a 2D space. The errors must be supplied as an Nx3 or Nx4 array representing the x/y-positions and either the symmetric error or asymmetric errors respectively.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=ErrorBars, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the quantity measured by the ErrorBars object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(1, 2), constant=True, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The Dimensions corresponding to the x- and y-positions of the error bars.
-
param List
vdims
( allow_None=False, bounds=(1, 3), constant=True, default=[Dimension(‘y’), Dimension(‘yerror’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.ErrorBars'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.ErrorBars'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.ErrorBars'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.ErrorBars'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.ErrorBars'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Raster
( data , kdims=None , vdims=None , extents=None , **params ) [source] ¶ -
Bases:
holoviews.core.element.Element2D
Raster is a basic 2D element type for presenting either numpy or dask arrays as two dimensional raster images.
Arrays with a shape of (N,M) are valid inputs for Raster whereas subclasses of Raster (e.g. RGB) may also accept 3D arrays containing channel information.
Raster does not support slicing like the Image or RGB subclasses and the extents are in matrix coordinates if not explicitly specified.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Raster, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Raster in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The dimension description of the data held in the matrix.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dim , expanded=True , flat=True ) [source] ¶ -
The set of samples available along a particular dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.raster.Raster'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.raster.Raster'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.raster.Raster'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=None , function=None , **reduce_map ) [source] ¶ -
Reduces the Raster using functions provided via the kwargs, where the keyword is the dimension to be reduced. Optionally a label_prefix can be provided to prepend to the result Element label.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **sample_values ) [source] ¶ -
Sample the Raster along one or both of its dimensions, returning a reduced dimensionality type, which is either a ItemTable, Curve or Scatter. If two dimension samples and a new_xaxis is provided the sample will be the value of the sampled unit indexed by the value in the new_xaxis tuple.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.raster.Raster'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.raster.Raster'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Arrow
( x , y , text='' , direction='<' , points=40 , arrowstyle='->' , **params ) [source] ¶ -
Bases:
holoviews.element.annotation.Annotation
Draw an arrow to the given xy position with optional text at distance ‘points’ away. The direction of the arrow may be specified as well as the arrow head style.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Arrow, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ClassSelector
x
( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The x-position of the arrow which make be numeric or a timestamp.
-
param ClassSelector
y
( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The y-position of the arrow which make be numeric or a timestamp.
-
param String
text
( allow_None=False, basestring=<class ‘str’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - Text associated with the arrow.
-
param ObjectSelector
direction
( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=<, instantiate=False, objects=[‘<’, ‘^’, ‘>’, ‘v’], pickle_default_value=True, precedence=None, readonly=False ) - The cardinal direction in which the arrow is pointing. Accepted arrow directions are ‘<’, ‘^’, ‘>’ and ‘v’.
-
param ObjectSelector
arrowstyle
( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=->, instantiate=False, objects=[‘-‘, ‘->’, ‘-[‘, ‘-|>’, ‘<->’, ‘<|-|>’], pickle_default_value=True, precedence=None, readonly=False ) - The arrowstyle used to draw the arrow. Accepted arrow styles are ‘-‘, ‘->’, ‘-[‘, ‘- |>', '<->' and '<| - | >’
-
param Number
points
( allow_None=False, bounds=None, constant=False, default=40, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - Font size of arrow text (if any).
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.annotation.Arrow'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.annotation.Arrow'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.annotation.Arrow'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=[] , function=None , **reduce_map ) ¶ -
Base class signature to demonstrate API for reducing Elements, using some reduce function, e.g. np.mean, which is applied along a particular Dimension. The dimensions and reduce functions should be passed as keyword arguments or as a list of dimensions and a single function.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **sample_values ) ¶ -
Base class signature to demonstrate API for sampling Elements. To sample an Element supply either a list of samples or keyword arguments, where the key should match an existing key dimension on the Element.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.annotation.Arrow'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.annotation.Arrow'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Bivariate
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.element.stats.StatisticsElement
Bivariate elements are containers for two dimensional data, which is to be visualized as a kernel density estimate. The data should be supplied in a tabular format of x- and y-columns.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Bivariate, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, 1), constant=False, default=[Dimension(‘Density’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.stats.Bivariate'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.stats.Bivariate'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.stats.Bivariate'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.stats.Bivariate'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.stats.Bivariate'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Nodes
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.element.chart.Points
Nodes is a simple Element representing Graph nodes as a set of Points. Unlike regular Points, Nodes must define a third key dimension corresponding to the node index.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Nodes, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(3, 3), constant=False, default=[Dimension(‘x’), Dimension(‘y’), Dimension(‘index’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Points in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.graphs.Nodes'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.graphs.Nodes'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.graphs.Nodes'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.graphs.Nodes'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.graphs.Nodes'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Graph
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.core.data.Dataset
,holoviews.core.element.Element2D
Graph is high-level Element representing both nodes and edges. A Graph may be defined in an abstract form representing just the abstract edges between nodes and optionally may be made concrete by supplying a Nodes Element defining the concrete positions of each node. If the node positions are supplied the EdgePaths (defining the concrete edges) can be inferred automatically or supplied explicitly.
The constructor accepts regular columnar data defining the edges or a tuple of the abstract edges and nodes, or a tuple of the abstract edges, nodes, and edgepaths.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Graph, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘start’), Dimension(‘end’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
edgepaths
¶ -
Returns the fixed EdgePaths or computes direct connections between supplied nodes.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.graphs.Graph'>) ¶
-
classmethod
from_networkx
( G , layout_function , nodes=None , **kwargs ) [source] ¶ -
Generate a HoloViews Graph from a networkx.Graph object and networkx layout function. Any keyword arguments will be passed to the layout function.
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.graphs.Graph'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.graphs.Graph'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
nodes
¶ -
Computes the node positions the first time they are requested if no explicit node information was supplied.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , selection_mode='edges' , **selection ) [source] ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
Selecting by a node dimensions selects all edges and nodes that are connected to the selected nodes. To select only edges between the selected nodes set the selection_mode to ‘nodes’.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.graphs.Graph'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.graphs.Graph'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Spikes
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.element.chart.Chart
Spikes is a 1D or 2D Element, which represents a series of vertical or horizontal lines distributed along some dimension. If an additional dimension is supplied it will be used to specify the height of the lines. The Element may therefore be used to represent 1D distributions, spectrograms or spike trains in electrophysiology.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Spikes, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.Spikes'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.Spikes'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.Spikes'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.Spikes'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.Spikes'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Element
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.core.dimension.ViewableElement
,holoviews.core.layout.Composable
,holoviews.core.overlay.Overlayable
Element is the baseclass for all ViewableElement types, with an x- and y-dimension. Subclasses should define the data storage in the constructor, as well as methods and properties, which define how the data maps onto the x- and y- and value dimensions.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Element, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords ) [source] ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
classmethod
collapse_data
( data , function=None , kdims=None , **kwargs ) [source] ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension. This method must be implemented for all Dimensioned type.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.element.Element'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.element.Element'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) [source] ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.element.Element'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=[] , function=None , **reduce_map ) [source] ¶ -
Base class signature to demonstrate API for reducing Elements, using some reduce function, e.g. np.mean, which is applied along a particular Dimension. The dimensions and reduce functions should be passed as keyword arguments or as a list of dimensions and a single function.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **sample_values ) [source] ¶ -
Base class signature to demonstrate API for sampling Elements. To sample an Element supply either a list of samples or keyword arguments, where the key should match an existing key dimension on the Element.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.element.Element'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.element.Element'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) [source] ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
ItemTable
( data , **params ) [source] ¶ -
Bases:
holoviews.core.element.Element
A tabular element type to allow convenient visualization of either a standard Python dictionary, an OrderedDict or a list of tuples (i.e. input suitable for an OrderedDict constructor). If an OrderedDict is used, the headings will be kept in the correct order. Tables store heterogeneous data with different labels.
Dimension objects are also accepted as keys, allowing dimensional information (e.g type and units) to be associated per heading.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=ItemTable, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(0, 0), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - ItemTables hold an index Dimension for each value they contain, i.e. they are equivalent to the keys.
-
param List
vdims
( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘Default’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - ItemTables should have only index Dimensions.
-
cell_type
( row , col ) [source] ¶ -
Returns the cell type given a row and column index. The common basic cell types are ‘data’ and ‘heading’.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.tabular.ItemTable'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.tabular.ItemTable'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.tabular.ItemTable'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
pprint_cell
( row , col ) [source] ¶ -
Get the formatted cell value for the given row and column indices.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.tabular.ItemTable'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.tabular.ItemTable'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
QuadMesh
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.element.raster.Raster
QuadMesh is a Raster type to hold x- and y- bin values with associated values. The x- and y-values of the QuadMesh may be supplied either as the edges of each bin allowing uneven sampling or as the bin centers, which will be converted to evenly sampled edges.
As a secondary but less supported mode QuadMesh can contain a mesh of quadrilateral coordinates that is not laid out in a grid. The data should then be supplied as three separate 2D arrays for the x-/y-coordinates and grid values.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=QuadMesh, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Raster in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The dimension description of the data held in the matrix.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
classmethod
collapse_data
( data_list , function , kdims=None , **kwargs ) [source] ¶ -
Allows collapsing the data of a number of QuadMesh Elements with a function.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.raster.QuadMesh'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.raster.QuadMesh'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.raster.QuadMesh'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=None , function=None , **reduce_map ) ¶ -
Reduces the Raster using functions provided via the kwargs, where the keyword is the dimension to be reduced. Optionally a label_prefix can be provided to prepend to the result Element label.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **sample_values ) ¶ -
Sample the Raster along one or both of its dimensions, returning a reduced dimensionality type, which is either a ItemTable, Curve or Scatter. If two dimension samples and a new_xaxis is provided the sample will be the value of the sampled unit indexed by the value in the new_xaxis tuple.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.raster.QuadMesh'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.raster.QuadMesh'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
HSV
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.element.raster.RGB
Example of a commonly used color space subclassed from RGB used for working in a HSV (hue, saturation and value) color space.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=HSV, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Raster in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(3, 4), constant=False, default=[Dimension(‘H’), Dimension(‘S’), Dimension(‘V’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The dimension description of the data held in the array. If an alpha channel is supplied, the defined alpha_dimension is automatically appended to this list.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘image’, ‘grid’, ‘xarray’, ‘cube’, ‘dataframe’, ‘dictionary’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
param ClassSelector
bounds
( allow_None=False, constant=False, default=BoundingBox(radius=0.5), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The bounding region in sheet coordinates containing the data.
-
param ClassSelector
alpha_dimension
( allow_None=False, constant=False, default=A, instantiate=False, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The alpha dimension definition to add the value dimensions if an alpha channel is supplied.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates.
-
closest_cell_center
( x , y ) ¶ -
Given arbitrary sheet coordinates, return the sheet coordinates of the center of the closest unit.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.raster.HSV'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.raster.HSV'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.raster.HSV'>) ¶
-
load_image
( filename , height=1 , array=False , bounds=None , bare=False , **kwargs ) ¶ -
Returns an raster element or raw numpy array from a PNG image file, using matplotlib.
The specified height determines the bounds of the raster object in sheet coordinates: by default the height is 1 unit with the width scaled appropriately by the image aspect ratio.
Note that as PNG images are encoded as RGBA, the red component maps to the first channel, the green component maps to the second component etc. For RGB elements, this mapping is trivial but may be important for subclasses e.g. for HSV elements.
Setting bare=True will apply options disabling axis labels displaying just the bare image. Any additional keyword arguments will be passed to the Image object.
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
matrix2sheet
( float_row , float_col ) ¶ -
Convert a floating-point location (float_row,float_col) in matrix coordinates to its corresponding location (x,y) in sheet coordinates.
Valid for scalar or array float_row and float_col.
Inverse of sheet2matrix().
-
matrixidx2sheet
( row , col ) ¶ -
Return (x,y) where x and y are the floating point coordinates of the center of the given matrix cell (row,col). If the matrix cell represents a 0.2 by 0.2 region, then the center location returned would be 0.1,0.1.
NOTE: This is NOT the strict mathematical inverse of sheet2matrixidx(), because sheet2matrixidx() discards all but the integer portion of the continuous matrix coordinate.
Valid only for scalar or array row and col.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
rgb
¶ -
Conversion from HSV to RGB.
-
sample
( samples=[] , **kwargs ) ¶ -
Allows sampling of an Image as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. On an Image the coordinates are continuously indexed and will always snap to the nearest coordinate.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.raster.HSV'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.raster.HSV'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sheet2matrix
( x , y ) ¶ -
Convert a point (x,y) in Sheet coordinates to continuous matrix coordinates.
Returns (float_row,float_col), where float_row corresponds to y, and float_col to x.
Valid for scalar or array x and y.
Note about Bounds For a Sheet with BoundingBox(points=((-0.5,-0.5),(0.5,0.5))) and density=3, x=-0.5 corresponds to float_col=0.0 and x=0.5 corresponds to float_col=3.0. float_col=3.0 is not inside the matrix representing this Sheet, which has the three columns (0,1,2). That is, x=-0.5 is inside the BoundingBox but x=0.5 is outside. Similarly, y=0.5 is inside (at row 0) but y=-0.5 is outside (at row 3) (it’s the other way round for y because the matrix row index increases as y decreases).
-
sheet2matrixidx
( x , y ) ¶ -
Convert a point (x,y) in sheet coordinates to the integer row and column index of the matrix cell in which that point falls, given a bounds and density. Returns (row,column).
Note that if coordinates along the right or bottom boundary are passed into this function, the returned matrix coordinate of the boundary will be just outside the matrix, because the right and bottom boundaries are exclusive.
Valid for scalar or array x and y.
-
sheetcoordinates_of_matrixidx
( ) ¶ -
Return x,y where x is a vector of sheet coordinates representing the x-center of each matrix cell, and y represents the corresponding y-center of the cell.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
xdensity
¶ -
The spacing between elements in an underlying matrix representation, in the x direction.
-
ydensity
¶ -
The spacing between elements in an underlying matrix representation, in the y direction.
-
param String
-
class
holoviews.element.
Bounds
( lbrt , **params ) [source] ¶ -
Bases:
holoviews.element.path.BaseShape
An arbitrary axis-aligned bounding rectangle defined by the (left, bottom, right, top) coordinate positions.
If supplied a single real number as input, this value will be treated as the radius of a square, zero-center box which will be used to compute the corresponding lbrt tuple.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Bounds, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The assigned group name.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Image in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ObjectSelector
datatype
( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’], instantiate=True, objects=[], pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
param NumericTuple
lbrt
( allow_None=False, constant=False, default=(-0.5, -0.5, 0.5, 0.5), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - The (left, bottom, right, top) coordinates of the bounding box.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.path.Bounds'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.path.Bounds'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.path.Bounds'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Bypasses selection on data and sets extents based on selection.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.path.Bounds'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.path.Bounds'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
split
( start=None , end=None , datatype=None , **kwargs ) ¶ -
The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
VLine
( x , **params ) [source] ¶ -
Bases:
holoviews.element.annotation.Annotation
Vertical line annotation at the given position
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=VLine, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ClassSelector
x
( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The x-position of the VLine which make be numeric or a timestamp.
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.annotation.VLine'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.annotation.VLine'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.annotation.VLine'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=[] , function=None , **reduce_map ) ¶ -
Base class signature to demonstrate API for reducing Elements, using some reduce function, e.g. np.mean, which is applied along a particular Dimension. The dimensions and reduce functions should be passed as keyword arguments or as a list of dimensions and a single function.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **sample_values ) ¶ -
Base class signature to demonstrate API for sampling Elements. To sample an Element supply either a list of samples or keyword arguments, where the key should match an existing key dimension on the Element.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.annotation.VLine'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.annotation.VLine'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Dataset
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.core.element.Element
Dataset provides a general baseclass for Element types that contain structured data and supports a range of data formats.
The Dataset class supports various methods offering a consistent way of working with the stored data regardless of the storage format used. These operations include indexing, selection and various ways of aggregating or collapsing the data with a supplied function.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Dataset, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) [source] ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) [source] ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) [source] ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) [source] ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) [source] ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.data.Dataset'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) [source] ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.data.Dataset'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) [source] ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.data.Dataset'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) [source] ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) [source] ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) [source] ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) [source] ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) [source] ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.data.Dataset'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.data.Dataset'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) [source] ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Ellipse
( x , y , spec , **params ) [source] ¶ -
Bases:
holoviews.element.path.BaseShape
Draw an axis-aligned ellipse at the specified x,y position with the given orientation.
The simplest (default) Ellipse is a circle, specified using:
Ellipse(x,y, diameter)
A circle is a degenerate ellipse where the width and height are equal. To specify these explicitly, you can use:
Ellipse(x,y, (width, height))
There is also an aspect parameter allowing you to generate an ellipse by specifying a multiplicating factor that will be applied to the height only.
Note that as a subclass of Path, internally an Ellipse is a sequence of (x,y) sample positions. Ellipse could also be implemented as an annotation that uses a dedicated ellipse artist.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Ellipse, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The assigned group name.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Image in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ObjectSelector
datatype
( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’], instantiate=True, objects=[], pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
param Number
x
( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - The x-position of the ellipse center.
-
param Number
y
( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - The y-position of the ellipse center.
-
param Number
width
( allow_None=False, bounds=None, constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - The width of the ellipse.
-
param Number
height
( allow_None=False, bounds=None, constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - The height of the ellipse.
-
param Number
orientation
( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - Orientation in the Cartesian coordinate system, the counterclockwise angle in radians between the first axis and the horizontal.
-
param Number
aspect
( allow_None=False, bounds=None, constant=False, default=1.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - Optional multiplier applied to the diameter to compute the width in cases where only the diameter value is set.
-
param Number
samples
( allow_None=False, bounds=None, constant=False, default=100, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - The sample count used to draw the ellipse.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.path.Ellipse'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.path.Ellipse'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.path.Ellipse'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Bypasses selection on data and sets extents based on selection.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.path.Ellipse'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.path.Ellipse'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
split
( start=None , end=None , datatype=None , **kwargs ) ¶ -
The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Distribution
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.element.stats.StatisticsElement
Distribution elements provides a representation for a one-dimensional distribution which can be visualized as a kernel density estimate. The data should be supplied in a tabular format and will use the first column.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Distribution, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘Value’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, 1), constant=False, default=[Dimension(‘Density’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.stats.Distribution'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.stats.Distribution'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.stats.Distribution'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.stats.Distribution'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.stats.Distribution'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
VectorField
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.element.chart.Points
A VectorField contains is a collection of vectors where each vector has an associated position in sheet coordinates.
The constructor of VectorField is similar to the constructor of Points: the input data can be an NxM Numpy array where the first two columns corresponds to the X,Y coordinates in sheet coordinates, within the declared bounding region. As with Points, the input can be a tuple of array objects or of objects that can be cast to arrays (the tuple elements are joined column-wise).
The third column maps to the vector angle which must be specified in radians. Note that it is possible to supply a collection which isn’t a numpy array, whereby each element of the collection is assumed to be an iterable corresponding to a single column of the NxM array.
The visualization of any additional columns is decided by the plotting code. For instance, the fourth and fifth columns could correspond to arrow length and colour map value. All that is assumed is that these additional dimension are normalized between 0.0 and 1.0 for the default visualization to work well.
The only restriction is that the final data array is NxM where M>3. In other words, the vector must have a dimensionality of 2 or higher.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=VectorField, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Points in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘Angle’), Dimension(‘Magnitude’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.VectorField'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.VectorField'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.VectorField'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.VectorField'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.VectorField'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Chart
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.core.data.Dataset
,holoviews.core.element.Element2D
The data held within Chart is a numpy array of shape (N, D), where N is the number of samples and D the number of dimensions. Chart Elements are sliceable along up to two key dimensions. The data may be supplied in one of three formats:
- As a numpy array of shape (N, D).
- As a list of length N containing tuples of length D.
- As a tuple of length D containing iterables of length N.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Chart, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.Chart'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.Chart'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.Chart'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.Chart'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.Chart'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
class
holoviews.element.
Surface
( data , kdims=None , vdims=None , extents=None , **params ) [source] ¶ -
Bases:
holoviews.element.raster.Image
,holoviews.core.element.Element3D
Surface Element represents a 3D surface in space. The data should be supplied as a dense NxM matrix.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Surface, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The Surface x and y dimensions of the space defined by the supplied extent.
-
param List
vdims
( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The Surface height dimension.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None, None, None), instantiate=False, length=6, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 3D space defined as (xmin, ymin, zmin, xmax, ymax, zmax).
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘image’, ‘grid’, ‘xarray’, ‘cube’, ‘dataframe’, ‘dictionary’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
param ClassSelector
bounds
( allow_None=False, constant=False, default=BoundingBox(radius=0.5), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The bounding region in sheet coordinates containing the data.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates.
-
closest_cell_center
( x , y ) ¶ -
Given arbitrary sheet coordinates, return the sheet coordinates of the center of the closest unit.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart3d.Surface'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart3d.Surface'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart3d.Surface'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
matrix2sheet
( float_row , float_col ) ¶ -
Convert a floating-point location (float_row,float_col) in matrix coordinates to its corresponding location (x,y) in sheet coordinates.
Valid for scalar or array float_row and float_col.
Inverse of sheet2matrix().
-
matrixidx2sheet
( row , col ) ¶ -
Return (x,y) where x and y are the floating point coordinates of the center of the given matrix cell (row,col). If the matrix cell represents a 0.2 by 0.2 region, then the center location returned would be 0.1,0.1.
NOTE: This is NOT the strict mathematical inverse of sheet2matrixidx(), because sheet2matrixidx() discards all but the integer portion of the continuous matrix coordinate.
Valid only for scalar or array row and col.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **kwargs ) ¶ -
Allows sampling of an Image as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. On an Image the coordinates are continuously indexed and will always snap to the nearest coordinate.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart3d.Surface'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart3d.Surface'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sheet2matrix
( x , y ) ¶ -
Convert a point (x,y) in Sheet coordinates to continuous matrix coordinates.
Returns (float_row,float_col), where float_row corresponds to y, and float_col to x.
Valid for scalar or array x and y.
Note about Bounds For a Sheet with BoundingBox(points=((-0.5,-0.5),(0.5,0.5))) and density=3, x=-0.5 corresponds to float_col=0.0 and x=0.5 corresponds to float_col=3.0. float_col=3.0 is not inside the matrix representing this Sheet, which has the three columns (0,1,2). That is, x=-0.5 is inside the BoundingBox but x=0.5 is outside. Similarly, y=0.5 is inside (at row 0) but y=-0.5 is outside (at row 3) (it’s the other way round for y because the matrix row index increases as y decreases).
-
sheet2matrixidx
( x , y ) ¶ -
Convert a point (x,y) in sheet coordinates to the integer row and column index of the matrix cell in which that point falls, given a bounds and density. Returns (row,column).
Note that if coordinates along the right or bottom boundary are passed into this function, the returned matrix coordinate of the boundary will be just outside the matrix, because the right and bottom boundaries are exclusive.
Valid for scalar or array x and y.
-
sheetcoordinates_of_matrixidx
( ) ¶ -
Return x,y where x is a vector of sheet coordinates representing the x-center of each matrix cell, and y represents the corresponding y-center of the cell.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
xdensity
¶ -
The spacing between elements in an underlying matrix representation, in the x direction.
-
ydensity
¶ -
The spacing between elements in an underlying matrix representation, in the y direction.
-
param String
-
class
holoviews.element.
EdgePaths
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.element.path.Path
EdgePaths is a simple Element representing the paths of edges connecting nodes in a graph.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=EdgePaths, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Image in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ObjectSelector
datatype
( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’], instantiate=True, objects=[], pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.graphs.EdgePaths'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.graphs.EdgePaths'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.graphs.EdgePaths'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Bypasses selection on data and sets extents based on selection.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.graphs.EdgePaths'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.graphs.EdgePaths'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
split
( start=None , end=None , datatype=None , **kwargs ) ¶ -
The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Scatter
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.element.chart.Chart
Scatter is a Element2D type which gets displayed as a number of disconnected points.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Scatter, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.Scatter'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.Scatter'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.Scatter'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.Scatter'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.Scatter'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Box
( x , y , spec , **params ) [source] ¶ -
Bases:
holoviews.element.path.BaseShape
Draw a centered box of a given width at the given position with the specified aspect ratio (if any).
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Box, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The assigned group name.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Image in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ObjectSelector
datatype
( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’], instantiate=True, objects=[], pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
param Number
x
( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - The x-position of the box center.
-
param Number
y
( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - The y-position of the box center.
-
param Number
width
( allow_None=False, bounds=None, constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - The width of the box.
-
param Number
height
( allow_None=False, bounds=None, constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - The height of the box.
-
param Number
orientation
( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - Orientation in the Cartesian coordinate system, the counterclockwise angle in radians between the first axis and the horizontal.
-
param Number
aspect
( allow_None=False, bounds=None, constant=False, default=1.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - Optional multiplier applied to the box size to compute the width in cases where only the length value is set.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.path.Box'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.path.Box'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.path.Box'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Bypasses selection on data and sets extents based on selection.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.path.Box'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.path.Box'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
split
( start=None , end=None , datatype=None , **kwargs ) ¶ -
The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Points
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.element.chart.Chart
Allows sets of points to be positioned over a sheet coordinate system. Each points may optionally be associated with a chosen numeric value.
The input data can be a Nx2 or Nx3 Numpy array where the first two columns corresponds to the X,Y coordinates in sheet coordinates, within the declared bounding region. For Nx3 arrays, the third column corresponds to the magnitude values of the points. Any additional columns will be ignored (use VectorFields instead).
The input data may be also be passed as a tuple of elements that may be numpy arrays or values that can be cast to arrays. When such a tuple is supplied, the elements are joined column-wise into a single array, allowing the magnitudes to be easily supplied separately.
Note that if magnitudes are to be rendered correctly by default, they should lie in the range [0,1].
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Points, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Points in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.Points'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.Points'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.Points'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.Points'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.Points'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
BoxWhisker
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.element.chart.Chart
BoxWhisker represent data as a distributions highlighting the median, mean and various percentiles.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=BoxWhisker, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.BoxWhisker'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.BoxWhisker'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.BoxWhisker'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.BoxWhisker'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.BoxWhisker'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
HeatMap
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.core.data.Dataset
,holoviews.core.element.Element2D
HeatMap is an atomic Element used to visualize two dimensional parameter spaces. It supports sparse or non-linear spaces, dynamically upsampling them to a dense representation, which can be visualized.
A HeatMap can be initialized with any dict or NdMapping type with two-dimensional keys.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=HeatMap, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.raster.HeatMap'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.raster.HeatMap'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.raster.HeatMap'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.raster.HeatMap'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.raster.HeatMap'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Area
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.element.chart.Curve
An Area Element represents the area under a Curve and is specified in the same format as a regular Curve, with the key dimension corresponding to a column of x-values and the value dimension corresponding to a column of y-values. Optionally a second value dimension may be supplied to shade the region between the curves.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Area, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.Area'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.Area'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.Area'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.Area'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.Area'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
classmethod
stack
( areas ) [source] ¶ -
Stacks an (Nd)Overlay of Area or Curve Elements by offsetting their baselines. To stack a HoloMap or DynamicMap use the map method.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Text
( x , y , text , fontsize=12 , halign='center' , valign='center' , rotation=0 , **params ) [source] ¶ -
Bases:
holoviews.element.annotation.Annotation
Draw a text annotation at the specified position with custom fontsize, alignment and rotation.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Text, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ClassSelector
x
( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The x-position of the arrow which make be numeric or a timestamp.
-
param ClassSelector
y
( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The y-position of the arrow which make be numeric or a timestamp.
-
param String
text
( allow_None=False, basestring=<class ‘str’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - The text to be displayed.
-
param Number
fontsize
( allow_None=False, bounds=None, constant=False, default=12, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - Font size of the text.
-
param Number
rotation
( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - Text rotation angle in degrees.
-
param ObjectSelector
halign
( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=center, instantiate=False, objects=[‘left’, ‘right’, ‘center’], pickle_default_value=True, precedence=None, readonly=False ) - The horizontal alignment position of the displayed text. Allowed values are ‘left’, ‘right’ and ‘center’.
-
param ObjectSelector
valign
( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=center, instantiate=False, objects=[‘top’, ‘bottom’, ‘center’], pickle_default_value=True, precedence=None, readonly=False ) - The vertical alignment position of the displayed text. Allowed values are ‘center’, ‘top’ and ‘bottom’.
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.annotation.Text'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.annotation.Text'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.annotation.Text'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=[] , function=None , **reduce_map ) ¶ -
Base class signature to demonstrate API for reducing Elements, using some reduce function, e.g. np.mean, which is applied along a particular Dimension. The dimensions and reduce functions should be passed as keyword arguments or as a list of dimensions and a single function.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **sample_values ) ¶ -
Base class signature to demonstrate API for sampling Elements. To sample an Element supply either a list of samples or keyword arguments, where the key should match an existing key dimension on the Element.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.annotation.Text'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.annotation.Text'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Bars
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.element.chart.Chart
Bars is an Element type, representing a number of stacked and grouped bars, depending the dimensionality of the key and value dimensions. Bars is useful for categorical data, which may be laid via groups, categories and stacks.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Bars, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(1, 3), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.Bars'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.Bars'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.Bars'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.Bars'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.Bars'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Table
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.core.data.Dataset
,holoviews.core.element.Tabular
Table is a Dataset type, which gets displayed in a tabular format and is convertible to most other Element types.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Table, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The group is used to describe the Table.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
cell_type
( row , col ) ¶ -
Returns the cell type given a row and column index. The common basic cell types are ‘data’ and ‘heading’.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.tabular.Table'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.tabular.Table'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.tabular.Table'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
pprint_cell
( row , col ) ¶ -
Get the formatted cell value for the given row and column indices.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.tabular.Table'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.tabular.Table'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Curve
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.element.chart.Chart
Curve is a simple Chart Element providing 1D indexing along the x-axis.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Curve, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.Curve'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.Curve'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.Curve'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.Curve'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.Curve'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Spline
( spline_points , **params ) [source] ¶ -
Bases:
holoviews.element.annotation.Annotation
Draw a spline using the given handle coordinates and handle codes. The constructor accepts a tuple in format (coords, codes).
Follows format of matplotlib spline definitions as used in matplotlib.path.Path with the following codes:
Path.STOP : 0 Path.MOVETO : 1 Path.LINETO : 2 Path.CURVE3 : 3 Path.CURVE4 : 4 Path.CLOSEPLOY: 79
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Spline, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.annotation.Spline'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.annotation.Spline'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.annotation.Spline'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=[] , function=None , **reduce_map ) ¶ -
Base class signature to demonstrate API for reducing Elements, using some reduce function, e.g. np.mean, which is applied along a particular Dimension. The dimensions and reduce functions should be passed as keyword arguments or as a list of dimensions and a single function.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **sample_values ) ¶ -
Base class signature to demonstrate API for sampling Elements. To sample an Element supply either a list of samples or keyword arguments, where the key should match an existing key dimension on the Element.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.annotation.Spline'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.annotation.Spline'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Image
( data , kdims=None , vdims=None , bounds=None , extents=None , xdensity=None , ydensity=None , **params ) [source] ¶ -
Bases:
holoviews.core.data.Dataset
,holoviews.element.raster.Raster
,holoviews.core.sheetcoords.SheetCoordinateSystem
Image is the atomic unit as which 2D data is stored, along with its bounds object. The input data may be a numpy.matrix object or a two-dimensional numpy array.
Allows slicing operations of the data in sheet coordinates or direct access to the data, via the .data attribute.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Image, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Raster in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The dimension description of the data held in the matrix.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘image’, ‘grid’, ‘xarray’, ‘cube’, ‘dataframe’, ‘dictionary’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
param ClassSelector
bounds
( allow_None=False, constant=False, default=BoundingBox(radius=0.5), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The bounding region in sheet coordinates containing the data.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) [source] ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates.
-
closest_cell_center
( x , y ) ¶ -
Given arbitrary sheet coordinates, return the sheet coordinates of the center of the closest unit.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.raster.Image'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.raster.Image'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.raster.Image'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
matrix2sheet
( float_row , float_col ) ¶ -
Convert a floating-point location (float_row,float_col) in matrix coordinates to its corresponding location (x,y) in sheet coordinates.
Valid for scalar or array float_row and float_col.
Inverse of sheet2matrix().
-
matrixidx2sheet
( row , col ) ¶ -
Return (x,y) where x and y are the floating point coordinates of the center of the given matrix cell (row,col). If the matrix cell represents a 0.2 by 0.2 region, then the center location returned would be 0.1,0.1.
NOTE: This is NOT the strict mathematical inverse of sheet2matrixidx(), because sheet2matrixidx() discards all but the integer portion of the continuous matrix coordinate.
Valid only for scalar or array row and col.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **kwargs ) [source] ¶ -
Allows sampling of an Image as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. On an Image the coordinates are continuously indexed and will always snap to the nearest coordinate.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) [source] ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.raster.Image'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.raster.Image'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sheet2matrix
( x , y ) ¶ -
Convert a point (x,y) in Sheet coordinates to continuous matrix coordinates.
Returns (float_row,float_col), where float_row corresponds to y, and float_col to x.
Valid for scalar or array x and y.
Note about Bounds For a Sheet with BoundingBox(points=((-0.5,-0.5),(0.5,0.5))) and density=3, x=-0.5 corresponds to float_col=0.0 and x=0.5 corresponds to float_col=3.0. float_col=3.0 is not inside the matrix representing this Sheet, which has the three columns (0,1,2). That is, x=-0.5 is inside the BoundingBox but x=0.5 is outside. Similarly, y=0.5 is inside (at row 0) but y=-0.5 is outside (at row 3) (it’s the other way round for y because the matrix row index increases as y decreases).
-
sheet2matrixidx
( x , y ) ¶ -
Convert a point (x,y) in sheet coordinates to the integer row and column index of the matrix cell in which that point falls, given a bounds and density. Returns (row,column).
Note that if coordinates along the right or bottom boundary are passed into this function, the returned matrix coordinate of the boundary will be just outside the matrix, because the right and bottom boundaries are exclusive.
Valid for scalar or array x and y.
-
sheetcoordinates_of_matrixidx
( ) ¶ -
Return x,y where x is a vector of sheet coordinates representing the x-center of each matrix cell, and y represents the corresponding y-center of the cell.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) [source] ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
xdensity
¶ -
The spacing between elements in an underlying matrix representation, in the x direction.
-
ydensity
¶ -
The spacing between elements in an underlying matrix representation, in the y direction.
-
param String
-
class
holoviews.element.
Path
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.core.data.Dataset
,holoviews.core.element.Element2D
The Path Element contains a list of Paths stored as tabular data types including arrays, dataframes and dictionary of column arrays. In addition a number of convenient constructors are supported:
- A list of lists containing x/y coordinate tuples.
- A tuple containing an array of length N with the x-values and a second array of shape NxP, where P is the number of paths.
- A list of tuples each containing arrays x and y values.
A Path can be split into subpaths using the split method or combined into a flat view using the dimension_values, table, and dframe methods, where each path is separated by a NaN value.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Path, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Image in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ObjectSelector
datatype
( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’], instantiate=True, objects=[], pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.path.Path'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.path.Path'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.path.Path'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) [source] ¶ -
Bypasses selection on data and sets extents based on selection.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.path.Path'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.path.Path'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
split
( start=None , end=None , datatype=None , **kwargs ) [source] ¶ -
The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
class
holoviews.element.
Polygons
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.element.path.Contours
Polygons is a Path Element type that may contain any number of closed paths with an associated value.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Polygons, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Image in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Polygons optionally accept a value dimension, corresponding to the supplied value.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ObjectSelector
datatype
( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’], instantiate=True, objects=[], pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
param Number
level
( allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - Optional level associated with the set of Contours.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.path.Polygons'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.path.Polygons'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.path.Polygons'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Bypasses selection on data and sets extents based on selection.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.path.Polygons'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.path.Polygons'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
split
( start=None , end=None , datatype=None , **kwargs ) ¶ -
The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.
Histogram
( values , edges=None , **params ) [source] ¶ -
Bases:
holoviews.core.element.Element2D
Histogram contains a number of bins, which are defined by the upper and lower bounds of their edges and the computed bin values.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Histogram, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Dimensions on Element2Ds determine the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘Frequency’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.Histogram'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.Histogram'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.Histogram'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.Histogram'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.Histogram'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
annotation
Module
¶
-
class
holoviews.element.annotation.
Annotation
( data , **params ) [source] ¶ -
Bases:
holoviews.core.element.Element2D
An Annotation is a special type of element that is designed to be overlaid on top of any arbitrary 2D element. Annotations have neither key nor value dimensions allowing them to be overlaid over any type of data.
Note that one or more Annotations can be displayed without being overlaid on top of any other data. In such instances (by default) they will be displayed using the unit axis limits (0.0-1.0 in both directions) unless an explicit ‘extents’ parameter is supplied. The extents of the bottom Annotation in the Overlay is used when multiple Annotations are displayed together.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Annotation, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.annotation.Annotation'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.annotation.Annotation'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.annotation.Annotation'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=[] , function=None , **reduce_map ) ¶ -
Base class signature to demonstrate API for reducing Elements, using some reduce function, e.g. np.mean, which is applied along a particular Dimension. The dimensions and reduce functions should be passed as keyword arguments or as a list of dimensions and a single function.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **sample_values ) ¶ -
Base class signature to demonstrate API for sampling Elements. To sample an Element supply either a list of samples or keyword arguments, where the key should match an existing key dimension on the Element.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.annotation.Annotation'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.annotation.Annotation'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.annotation.
Arrow
( x , y , text='' , direction='<' , points=40 , arrowstyle='->' , **params ) [source] ¶ -
Bases:
holoviews.element.annotation.Annotation
Draw an arrow to the given xy position with optional text at distance ‘points’ away. The direction of the arrow may be specified as well as the arrow head style.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Arrow, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ClassSelector
x
( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The x-position of the arrow which make be numeric or a timestamp.
-
param ClassSelector
y
( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The y-position of the arrow which make be numeric or a timestamp.
-
param String
text
( allow_None=False, basestring=<class ‘str’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - Text associated with the arrow.
-
param ObjectSelector
direction
( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=<, instantiate=False, objects=[‘<’, ‘^’, ‘>’, ‘v’], pickle_default_value=True, precedence=None, readonly=False ) - The cardinal direction in which the arrow is pointing. Accepted arrow directions are ‘<’, ‘^’, ‘>’ and ‘v’.
-
param ObjectSelector
arrowstyle
( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=->, instantiate=False, objects=[‘-‘, ‘->’, ‘-[‘, ‘-|>’, ‘<->’, ‘<|-|>’], pickle_default_value=True, precedence=None, readonly=False ) - The arrowstyle used to draw the arrow. Accepted arrow styles are ‘-‘, ‘->’, ‘-[‘, ‘- |>', '<->' and '<| - | >’
-
param Number
points
( allow_None=False, bounds=None, constant=False, default=40, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - Font size of arrow text (if any).
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.annotation.Arrow'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.annotation.Arrow'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.annotation.Arrow'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=[] , function=None , **reduce_map ) ¶ -
Base class signature to demonstrate API for reducing Elements, using some reduce function, e.g. np.mean, which is applied along a particular Dimension. The dimensions and reduce functions should be passed as keyword arguments or as a list of dimensions and a single function.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **sample_values ) ¶ -
Base class signature to demonstrate API for sampling Elements. To sample an Element supply either a list of samples or keyword arguments, where the key should match an existing key dimension on the Element.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.annotation.Arrow'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.annotation.Arrow'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.annotation.
HLine
( y , **params ) [source] ¶ -
Bases:
holoviews.element.annotation.Annotation
Horizontal line annotation at the given position
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=HLine, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ClassSelector
y
( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The y-position of the VLine which make be numeric or a timestamp.
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.annotation.HLine'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.annotation.HLine'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.annotation.HLine'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=[] , function=None , **reduce_map ) ¶ -
Base class signature to demonstrate API for reducing Elements, using some reduce function, e.g. np.mean, which is applied along a particular Dimension. The dimensions and reduce functions should be passed as keyword arguments or as a list of dimensions and a single function.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **sample_values ) ¶ -
Base class signature to demonstrate API for sampling Elements. To sample an Element supply either a list of samples or keyword arguments, where the key should match an existing key dimension on the Element.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.annotation.HLine'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.annotation.HLine'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.annotation.
Spline
( spline_points , **params ) [source] ¶ -
Bases:
holoviews.element.annotation.Annotation
Draw a spline using the given handle coordinates and handle codes. The constructor accepts a tuple in format (coords, codes).
Follows format of matplotlib spline definitions as used in matplotlib.path.Path with the following codes:
Path.STOP : 0 Path.MOVETO : 1 Path.LINETO : 2 Path.CURVE3 : 3 Path.CURVE4 : 4 Path.CLOSEPLOY: 79
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Spline, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.annotation.Spline'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.annotation.Spline'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.annotation.Spline'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=[] , function=None , **reduce_map ) ¶ -
Base class signature to demonstrate API for reducing Elements, using some reduce function, e.g. np.mean, which is applied along a particular Dimension. The dimensions and reduce functions should be passed as keyword arguments or as a list of dimensions and a single function.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **sample_values ) ¶ -
Base class signature to demonstrate API for sampling Elements. To sample an Element supply either a list of samples or keyword arguments, where the key should match an existing key dimension on the Element.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.annotation.Spline'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.annotation.Spline'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.annotation.
Text
( x , y , text , fontsize=12 , halign='center' , valign='center' , rotation=0 , **params ) [source] ¶ -
Bases:
holoviews.element.annotation.Annotation
Draw a text annotation at the specified position with custom fontsize, alignment and rotation.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Text, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ClassSelector
x
( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The x-position of the arrow which make be numeric or a timestamp.
-
param ClassSelector
y
( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The y-position of the arrow which make be numeric or a timestamp.
-
param String
text
( allow_None=False, basestring=<class ‘str’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - The text to be displayed.
-
param Number
fontsize
( allow_None=False, bounds=None, constant=False, default=12, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - Font size of the text.
-
param Number
rotation
( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - Text rotation angle in degrees.
-
param ObjectSelector
halign
( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=center, instantiate=False, objects=[‘left’, ‘right’, ‘center’], pickle_default_value=True, precedence=None, readonly=False ) - The horizontal alignment position of the displayed text. Allowed values are ‘left’, ‘right’ and ‘center’.
-
param ObjectSelector
valign
( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=center, instantiate=False, objects=[‘top’, ‘bottom’, ‘center’], pickle_default_value=True, precedence=None, readonly=False ) - The vertical alignment position of the displayed text. Allowed values are ‘center’, ‘top’ and ‘bottom’.
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.annotation.Text'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.annotation.Text'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.annotation.Text'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=[] , function=None , **reduce_map ) ¶ -
Base class signature to demonstrate API for reducing Elements, using some reduce function, e.g. np.mean, which is applied along a particular Dimension. The dimensions and reduce functions should be passed as keyword arguments or as a list of dimensions and a single function.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **sample_values ) ¶ -
Base class signature to demonstrate API for sampling Elements. To sample an Element supply either a list of samples or keyword arguments, where the key should match an existing key dimension on the Element.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.annotation.Text'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.annotation.Text'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.annotation.
VLine
( x , **params ) [source] ¶ -
Bases:
holoviews.element.annotation.Annotation
Vertical line annotation at the given position
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=VLine, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ClassSelector
x
( allow_None=False, constant=False, default=0, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The x-position of the VLine which make be numeric or a timestamp.
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.annotation.VLine'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.annotation.VLine'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.annotation.VLine'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=[] , function=None , **reduce_map ) ¶ -
Base class signature to demonstrate API for reducing Elements, using some reduce function, e.g. np.mean, which is applied along a particular Dimension. The dimensions and reduce functions should be passed as keyword arguments or as a list of dimensions and a single function.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **sample_values ) ¶ -
Base class signature to demonstrate API for sampling Elements. To sample an Element supply either a list of samples or keyword arguments, where the key should match an existing key dimension on the Element.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.annotation.VLine'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.annotation.VLine'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
chart
Module
¶
-
class
holoviews.element.chart.
Area
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.element.chart.Curve
An Area Element represents the area under a Curve and is specified in the same format as a regular Curve, with the key dimension corresponding to a column of x-values and the value dimension corresponding to a column of y-values. Optionally a second value dimension may be supplied to shade the region between the curves.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Area, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.Area'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.Area'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.Area'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.Area'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.Area'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
classmethod
stack
( areas ) [source] ¶ -
Stacks an (Nd)Overlay of Area or Curve Elements by offsetting their baselines. To stack a HoloMap or DynamicMap use the map method.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.chart.
Bars
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.element.chart.Chart
Bars is an Element type, representing a number of stacked and grouped bars, depending the dimensionality of the key and value dimensions. Bars is useful for categorical data, which may be laid via groups, categories and stacks.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Bars, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(1, 3), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.Bars'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.Bars'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.Bars'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.Bars'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.Bars'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.chart.
BoxWhisker
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.element.chart.Chart
BoxWhisker represent data as a distributions highlighting the median, mean and various percentiles.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=BoxWhisker, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.BoxWhisker'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.BoxWhisker'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.BoxWhisker'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.BoxWhisker'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.BoxWhisker'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.chart.
Chart
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.core.data.Dataset
,holoviews.core.element.Element2D
The data held within Chart is a numpy array of shape (N, D), where N is the number of samples and D the number of dimensions. Chart Elements are sliceable along up to two key dimensions. The data may be supplied in one of three formats:
- As a numpy array of shape (N, D).
- As a list of length N containing tuples of length D.
- As a tuple of length D containing iterables of length N.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Chart, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.Chart'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.Chart'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.Chart'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.Chart'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.Chart'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
class
holoviews.element.chart.
Curve
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.element.chart.Chart
Curve is a simple Chart Element providing 1D indexing along the x-axis.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Curve, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.Curve'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.Curve'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.Curve'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.Curve'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.Curve'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.chart.
ErrorBars
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.element.chart.Chart
ErrorBars is a Chart Element type representing any number of errorbars situated in a 2D space. The errors must be supplied as an Nx3 or Nx4 array representing the x/y-positions and either the symmetric error or asymmetric errors respectively.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=ErrorBars, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the quantity measured by the ErrorBars object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(1, 2), constant=True, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The Dimensions corresponding to the x- and y-positions of the error bars.
-
param List
vdims
( allow_None=False, bounds=(1, 3), constant=True, default=[Dimension(‘y’), Dimension(‘yerror’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.ErrorBars'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.ErrorBars'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.ErrorBars'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.ErrorBars'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.ErrorBars'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.chart.
Histogram
( values , edges=None , **params ) [source] ¶ -
Bases:
holoviews.core.element.Element2D
Histogram contains a number of bins, which are defined by the upper and lower bounds of their edges and the computed bin values.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Histogram, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Dimensions on Element2Ds determine the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘Frequency’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.Histogram'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.Histogram'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.Histogram'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.Histogram'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.Histogram'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.chart.
Points
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.element.chart.Chart
Allows sets of points to be positioned over a sheet coordinate system. Each points may optionally be associated with a chosen numeric value.
The input data can be a Nx2 or Nx3 Numpy array where the first two columns corresponds to the X,Y coordinates in sheet coordinates, within the declared bounding region. For Nx3 arrays, the third column corresponds to the magnitude values of the points. Any additional columns will be ignored (use VectorFields instead).
The input data may be also be passed as a tuple of elements that may be numpy arrays or values that can be cast to arrays. When such a tuple is supplied, the elements are joined column-wise into a single array, allowing the magnitudes to be easily supplied separately.
Note that if magnitudes are to be rendered correctly by default, they should lie in the range [0,1].
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Points, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Points in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.Points'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.Points'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.Points'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.Points'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.Points'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.chart.
Scatter
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.element.chart.Chart
Scatter is a Element2D type which gets displayed as a number of disconnected points.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Scatter, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.Scatter'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.Scatter'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.Scatter'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.Scatter'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.Scatter'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.chart.
Spikes
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.element.chart.Chart
Spikes is a 1D or 2D Element, which represents a series of vertical or horizontal lines distributed along some dimension. If an additional dimension is supplied it will be used to specify the height of the lines. The Element may therefore be used to represent 1D distributions, spectrograms or spike trains in electrophysiology.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Spikes, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.Spikes'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.Spikes'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.Spikes'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.Spikes'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.Spikes'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.chart.
Spread
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.element.chart.ErrorBars
Spread is a Chart Element type representing a spread of values as given by a mean and standard error or confidence intervals. Just like the ErrorBars Element type, mean and deviations from the mean should be supplied as either an Nx3 or Nx4 array representing the x-values, mean values and symmetric or asymmetric errors respective. Internally the data is always expanded to an Nx4 array.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Spread, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the quantity measured by the ErrorBars object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(1, 2), constant=True, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The Dimensions corresponding to the x- and y-positions of the error bars.
-
param List
vdims
( allow_None=False, bounds=(1, 3), constant=True, default=[Dimension(‘y’), Dimension(‘yerror’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.Spread'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.Spread'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.Spread'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.Spread'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.Spread'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.chart.
VectorField
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.element.chart.Points
A VectorField contains is a collection of vectors where each vector has an associated position in sheet coordinates.
The constructor of VectorField is similar to the constructor of Points: the input data can be an NxM Numpy array where the first two columns corresponds to the X,Y coordinates in sheet coordinates, within the declared bounding region. As with Points, the input can be a tuple of array objects or of objects that can be cast to arrays (the tuple elements are joined column-wise).
The third column maps to the vector angle which must be specified in radians. Note that it is possible to supply a collection which isn’t a numpy array, whereby each element of the collection is assumed to be an iterable corresponding to a single column of the NxM array.
The visualization of any additional columns is decided by the plotting code. For instance, the fourth and fifth columns could correspond to arrow length and colour map value. All that is assumed is that these additional dimension are normalized between 0.0 and 1.0 for the default visualization to work well.
The only restriction is that the final data array is NxM where M>3. In other words, the vector must have a dimensionality of 2 or higher.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=VectorField, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Points in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘Angle’), Dimension(‘Magnitude’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart.VectorField'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart.VectorField'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart.VectorField'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart.VectorField'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart.VectorField'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
chart3d
Module
¶
-
class
holoviews.element.chart3d.
Scatter3D
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.core.element.Element3D
,holoviews.element.chart.Scatter
Scatter3D object represents a number of coordinates in 3D-space. Additionally Scatter3D points may have any number of value dimensions. The data may therefore be supplied as NxD matrix where N represents the number of samples, and D the number of key and value dimensions.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Scatter3D, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(0, None), constant=False, default=[Dimension(‘x’), Dimension(‘y’), Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Scatter3D can have optional value dimensions, which may be mapped onto color and size.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None, None, None), instantiate=False, length=6, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 3D space defined as (xmin, ymin, zmin, xmax, ymax, zmax).
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart3d.Scatter3D'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart3d.Scatter3D'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart3d.Scatter3D'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart3d.Scatter3D'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart3d.Scatter3D'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.chart3d.
Surface
( data , kdims=None , vdims=None , extents=None , **params ) [source] ¶ -
Bases:
holoviews.element.raster.Image
,holoviews.core.element.Element3D
Surface Element represents a 3D surface in space. The data should be supplied as a dense NxM matrix.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Surface, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The Surface x and y dimensions of the space defined by the supplied extent.
-
param List
vdims
( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The Surface height dimension.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None, None, None), instantiate=False, length=6, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 3D space defined as (xmin, ymin, zmin, xmax, ymax, zmax).
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘image’, ‘grid’, ‘xarray’, ‘cube’, ‘dataframe’, ‘dictionary’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
param ClassSelector
bounds
( allow_None=False, constant=False, default=BoundingBox(radius=0.5), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The bounding region in sheet coordinates containing the data.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates.
-
closest_cell_center
( x , y ) ¶ -
Given arbitrary sheet coordinates, return the sheet coordinates of the center of the closest unit.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart3d.Surface'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart3d.Surface'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart3d.Surface'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
matrix2sheet
( float_row , float_col ) ¶ -
Convert a floating-point location (float_row,float_col) in matrix coordinates to its corresponding location (x,y) in sheet coordinates.
Valid for scalar or array float_row and float_col.
Inverse of sheet2matrix().
-
matrixidx2sheet
( row , col ) ¶ -
Return (x,y) where x and y are the floating point coordinates of the center of the given matrix cell (row,col). If the matrix cell represents a 0.2 by 0.2 region, then the center location returned would be 0.1,0.1.
NOTE: This is NOT the strict mathematical inverse of sheet2matrixidx(), because sheet2matrixidx() discards all but the integer portion of the continuous matrix coordinate.
Valid only for scalar or array row and col.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **kwargs ) ¶ -
Allows sampling of an Image as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. On an Image the coordinates are continuously indexed and will always snap to the nearest coordinate.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart3d.Surface'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart3d.Surface'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sheet2matrix
( x , y ) ¶ -
Convert a point (x,y) in Sheet coordinates to continuous matrix coordinates.
Returns (float_row,float_col), where float_row corresponds to y, and float_col to x.
Valid for scalar or array x and y.
Note about Bounds For a Sheet with BoundingBox(points=((-0.5,-0.5),(0.5,0.5))) and density=3, x=-0.5 corresponds to float_col=0.0 and x=0.5 corresponds to float_col=3.0. float_col=3.0 is not inside the matrix representing this Sheet, which has the three columns (0,1,2). That is, x=-0.5 is inside the BoundingBox but x=0.5 is outside. Similarly, y=0.5 is inside (at row 0) but y=-0.5 is outside (at row 3) (it’s the other way round for y because the matrix row index increases as y decreases).
-
sheet2matrixidx
( x , y ) ¶ -
Convert a point (x,y) in sheet coordinates to the integer row and column index of the matrix cell in which that point falls, given a bounds and density. Returns (row,column).
Note that if coordinates along the right or bottom boundary are passed into this function, the returned matrix coordinate of the boundary will be just outside the matrix, because the right and bottom boundaries are exclusive.
Valid for scalar or array x and y.
-
sheetcoordinates_of_matrixidx
( ) ¶ -
Return x,y where x is a vector of sheet coordinates representing the x-center of each matrix cell, and y represents the corresponding y-center of the cell.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
xdensity
¶ -
The spacing between elements in an underlying matrix representation, in the x direction.
-
ydensity
¶ -
The spacing between elements in an underlying matrix representation, in the y direction.
-
param String
-
class
holoviews.element.chart3d.
Trisurface
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.core.element.Element3D
,holoviews.element.chart.Scatter
Trisurface object represents a number of coordinates in 3D-space, represented as a Surface of triangular polygons.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Trisurface, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(0, None), constant=False, default=[Dimension(‘x’), Dimension(‘y’), Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Trisurface can have optional value dimensions, which may be mapped onto color and size.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None, None, None), instantiate=False, length=6, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 3D space defined as (xmin, ymin, zmin, xmax, ymax, zmax).
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.chart3d.Trisurface'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.chart3d.Trisurface'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.chart3d.Trisurface'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.chart3d.Trisurface'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.chart3d.Trisurface'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
comparison
Module
¶
Helper classes for comparing the equality of two HoloViews objects.
These classes are designed to integrate with unittest.TestCase (see the tests directory) while making equality testing easily accessible to the user.
For instance, to test if two Matrix objects are equal you can use:
Comparison.assertEqual(matrix1, matrix2)
This will raise an AssertionError if the two matrix objects are not equal, including information regarding what exactly failed to match.
Note that this functionality could not be provided using comparison methods on all objects as comparison operators only return Booleans and thus would not supply any information regarding why two elements are considered different.
-
class
holoviews.element.comparison.
Comparison
[source] ¶ -
Bases:
holoviews.element.comparison.ComparisonInterface
Class used for comparing two HoloViews objects, including complex composite objects. Comparisons are available as classmethods, the most general being the assertEqual method that is intended to work with any input.
For instance, to test if two Image objects are equal you can use:
Comparison.assertEqual(matrix1, matrix2)
-
assertEqual
( first , second , msg=None ) ¶ -
Classmethod equivalent to unittest.TestCase method
-
failureException
¶ -
alias of
AssertionError
-
simple_equality
( first , second , msg=None ) ¶ -
Classmethod equivalent to unittest.TestCase method (longMessage = False.)
-
-
class
holoviews.element.comparison.
ComparisonInterface
[source] ¶ -
Bases:
object
This class is designed to allow equality testing to work seamlessly with unittest.TestCase as a mix-in by implementing a compatible interface (namely the assertEqual method).
The assertEqual class method is to be overridden by an instance method of the same name when used as a mix-in with TestCase. The contents of the equality_type_funcs dictionary is suitable for use with TestCase.addTypeEqualityFunc.
-
classmethod
assertEqual
( first , second , msg=None ) [source] ¶ -
Classmethod equivalent to unittest.TestCase method
-
failureException
¶ -
alias of
AssertionError
-
classmethod
-
class
holoviews.element.comparison.
ComparisonTestCase
( *args , **kwargs ) [source] ¶ -
Bases:
holoviews.element.comparison.Comparison
,unittest.case.TestCase
Class to integrate the Comparison class with unittest.TestCase.
-
addCleanup
( function , *args , **kwargs ) ¶ -
Add a function, with arguments, to be called when the test is completed. Functions added are called on a LIFO basis and are called after tearDown on test failure or success.
Cleanup items are called even if setUp fails (unlike tearDown).
-
addTypeEqualityFunc
( typeobj , function ) ¶ -
Add a type specific assertEqual style function to compare a type.
This method is for use by TestCase subclasses that need to register their own type equality functions to provide nicer error messages.
- Args:
-
- typeobj: The data type to call this function on when both values
- are of the same type in assertEqual().
- function: The callable taking two arguments and an optional
- msg= argument that raises self.failureException with a useful error message when the two arguments are not equal.
-
assertAlmostEqual
( first , second , places=None , msg=None , delta=None ) ¶ -
Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero, or by comparing that the between the two objects is more than the given delta.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most significant digit).
If the two objects compare equal then they will automatically compare almost equal.
-
assertCountEqual
( first , second , msg=None ) ¶ -
An unordered sequence comparison asserting that the same elements, regardless of order. If the same element occurs more than once, it verifies that the elements occur the same number of times.
- self.assertEqual(Counter(list(first)),
- Counter(list(second)))
- Example:
-
- [0, 1, 1] and [1, 0, 1] compare equal.
- [0, 0, 1] and [0, 1] compare unequal.
-
assertDictContainsSubset
( subset , dictionary , msg=None ) ¶ -
Checks whether dictionary is a superset of subset.
-
assertEqual
( first , second , msg=None ) ¶ -
Classmethod equivalent to unittest.TestCase method
-
assertFalse
( expr , msg=None ) ¶ -
Check that the expression is false.
-
assertGreater
( a , b , msg=None ) ¶ -
Just like self.assertTrue(a > b), but with a nicer default message.
-
assertGreaterEqual
( a , b , msg=None ) ¶ -
Just like self.assertTrue(a >= b), but with a nicer default message.
-
assertIn
( member , container , msg=None ) ¶ -
Just like self.assertTrue(a in b), but with a nicer default message.
-
assertIs
( expr1 , expr2 , msg=None ) ¶ -
Just like self.assertTrue(a is b), but with a nicer default message.
-
assertIsInstance
( obj , cls , msg=None ) ¶ -
Same as self.assertTrue(isinstance(obj, cls)), with a nicer default message.
-
assertIsNone
( obj , msg=None ) ¶ -
Same as self.assertTrue(obj is None), with a nicer default message.
-
assertIsNot
( expr1 , expr2 , msg=None ) ¶ -
Just like self.assertTrue(a is not b), but with a nicer default message.
-
assertIsNotNone
( obj , msg=None ) ¶ -
Included for symmetry with assertIsNone.
-
assertLess
( a , b , msg=None ) ¶ -
Just like self.assertTrue(a < b), but with a nicer default message.
-
assertLessEqual
( a , b , msg=None ) ¶ -
Just like self.assertTrue(a <= b), but with a nicer default message.
-
assertListEqual
( list1 , list2 , msg=None ) ¶ -
A list-specific equality assertion.
- Args:
-
list1: The first list to compare. list2: The second list to compare. msg: Optional message to use on failure instead of a list of
differences.
-
assertLogs
( logger=None , level=None ) ¶ -
Fail unless a log message of level level or higher is emitted on logger_name or its children. If omitted, level defaults to INFO and logger defaults to the root logger.
This method must be used as a context manager, and will yield a recording object with two attributes: output and records . At the end of the context manager, the output attribute will be a list of the matching formatted log messages and the records attribute will be a list of the corresponding LogRecord objects.
Example:
with self.assertLogs('foo', level='INFO') as cm: logging.getLogger('foo').info('first message') logging.getLogger('foo.bar').error('second message') self.assertEqual(cm.output, ['INFO:foo:first message', 'ERROR:foo.bar:second message'])
-
assertMultiLineEqual
( first , second , msg=None ) ¶ -
Assert that two multi-line strings are equal.
-
assertNotAlmostEqual
( first , second , places=None , msg=None , delta=None ) ¶ -
Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero, or by comparing that the between the two objects is less than the given delta.
Note that decimal places (from zero) are usually not the same as significant digits (measured from the most significant digit).
Objects that are equal automatically fail.
-
assertNotEqual
( first , second , msg=None ) ¶ -
Fail if the two objects are equal as determined by the ‘!=’ operator.
-
assertNotIn
( member , container , msg=None ) ¶ -
Just like self.assertTrue(a not in b), but with a nicer default message.
-
assertNotIsInstance
( obj , cls , msg=None ) ¶ -
Included for symmetry with assertIsInstance.
-
assertNotRegex
( text , unexpected_regex , msg=None ) ¶ -
Fail the test if the text matches the regular expression.
-
assertRaises
( expected_exception , *args , **kwargs ) ¶ -
Fail unless an exception of class expected_exception is raised by the callable when invoked with specified positional and keyword arguments. If a different type of exception is raised, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception.
If called with the callable and arguments omitted, will return a context object used like this:
with self.assertRaises(SomeException): do_something()
An optional keyword argument ‘msg’ can be provided when assertRaises is used as a context object.
The context manager keeps a reference to the exception as the ‘exception’ attribute. This allows you to inspect the exception after the assertion:
with self.assertRaises(SomeException) as cm: do_something() the_exception = cm.exception self.assertEqual(the_exception.error_code, 3)
-
assertRaisesRegex
( expected_exception , expected_regex , *args , **kwargs ) ¶ -
Asserts that the message in a raised exception matches a regex.
- Args:
-
expected_exception: Exception class expected to be raised. expected_regex: Regex (re pattern object or string) expected
to be found in error message.args: Function to be called and extra positional args. kwargs: Extra kwargs. msg: Optional message used in case of failure. Can only be used
when assertRaisesRegex is used as a context manager.
-
assertRegex
( text , expected_regex , msg=None ) ¶ -
Fail the test unless the text matches the regular expression.
-
assertSequenceEqual
( seq1 , seq2 , msg=None , seq_type=None ) ¶ -
An equality assertion for ordered sequences (like lists and tuples).
For the purposes of this function, a valid ordered sequence type is one which can be indexed, has a length, and has an equality operator.
- Args:
-
seq1: The first sequence to compare. seq2: The second sequence to compare. seq_type: The expected datatype of the sequences, or None if no
datatype should be enforced.- msg: Optional message to use on failure instead of a list of
- differences.
-
assertSetEqual
( set1 , set2 , msg=None ) ¶ -
A set-specific equality assertion.
- Args:
-
set1: The first set to compare. set2: The second set to compare. msg: Optional message to use on failure instead of a list of
differences.
assertSetEqual uses ducktyping to support different types of sets, and is optimized for sets specifically (parameters must support a difference method).
-
assertTrue
( expr , msg=None ) ¶ -
Check that the expression is true.
-
assertTupleEqual
( tuple1 , tuple2 , msg=None ) ¶ -
A tuple-specific equality assertion.
- Args:
-
tuple1: The first tuple to compare. tuple2: The second tuple to compare. msg: Optional message to use on failure instead of a list of
differences.
-
assertWarns
( expected_warning , *args , **kwargs ) ¶ -
Fail unless a warning of class warnClass is triggered by the callable when invoked with specified positional and keyword arguments. If a different type of warning is triggered, it will not be handled: depending on the other warning filtering rules in effect, it might be silenced, printed out, or raised as an exception.
If called with the callable and arguments omitted, will return a context object used like this:
with self.assertWarns(SomeWarning): do_something()
An optional keyword argument ‘msg’ can be provided when assertWarns is used as a context object.
The context manager keeps a reference to the first matching warning as the ‘warning’ attribute; similarly, the ‘filename’ and ‘lineno’ attributes give you information about the line of Python code from which the warning was triggered. This allows you to inspect the warning after the assertion:
with self.assertWarns(SomeWarning) as cm: do_something() the_warning = cm.warning self.assertEqual(the_warning.some_attribute, 147)
-
assertWarnsRegex
( expected_warning , expected_regex , *args , **kwargs ) ¶ -
Asserts that the message in a triggered warning matches a regexp. Basic functioning is similar to assertWarns() with the addition that only warnings whose messages also match the regular expression are considered successful matches.
- Args:
-
expected_warning: Warning class expected to be triggered. expected_regex: Regex (re pattern object or string) expected
to be found in error message.args: Function to be called and extra positional args. kwargs: Extra kwargs. msg: Optional message used in case of failure. Can only be used
when assertWarnsRegex is used as a context manager.
-
debug
( ) ¶ -
Run the test without collecting errors in a TestResult
-
doCleanups
( ) ¶ -
Execute all cleanup functions. Normally called for you after tearDown.
-
fail
( msg=None ) ¶ -
Fail immediately, with the given message.
-
failureException
¶ -
alias of
AssertionError
-
setUp
( ) ¶ -
Hook method for setting up the test fixture before exercising it.
-
setUpClass
( ) ¶ -
Hook method for setting up class fixture before running tests in the class.
-
shortDescription
( ) ¶ -
Returns a one-line description of the test, or None if no description has been provided.
The default implementation of this method returns the first line of the specified test method’s docstring.
-
simple_equality
( first , second , msg=None ) ¶ -
Classmethod equivalent to unittest.TestCase method (longMessage = False.)
-
skipTest
( reason ) ¶ -
Skip this test.
-
subTest
( msg=<object object> , **params ) ¶ -
Return a context manager that will return the enclosed block of code in a subtest identified by the optional message and keyword parameters. A failure in the subtest marks the test case as failed but resumes execution at the end of the enclosed block, allowing further test code to be executed.
-
tearDown
( ) ¶ -
Hook method for deconstructing the test fixture after testing it.
-
tearDownClass
( ) ¶ -
Hook method for deconstructing the class fixture after running all tests in the class.
-
graphs
Module
¶
-
class
holoviews.element.graphs.
EdgePaths
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.element.path.Path
EdgePaths is a simple Element representing the paths of edges connecting nodes in a graph.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=EdgePaths, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Image in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ObjectSelector
datatype
( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’], instantiate=True, objects=[], pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.graphs.EdgePaths'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.graphs.EdgePaths'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.graphs.EdgePaths'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Bypasses selection on data and sets extents based on selection.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.graphs.EdgePaths'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.graphs.EdgePaths'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
split
( start=None , end=None , datatype=None , **kwargs ) ¶ -
The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.graphs.
Graph
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.core.data.Dataset
,holoviews.core.element.Element2D
Graph is high-level Element representing both nodes and edges. A Graph may be defined in an abstract form representing just the abstract edges between nodes and optionally may be made concrete by supplying a Nodes Element defining the concrete positions of each node. If the node positions are supplied the EdgePaths (defining the concrete edges) can be inferred automatically or supplied explicitly.
The constructor accepts regular columnar data defining the edges or a tuple of the abstract edges and nodes, or a tuple of the abstract edges, nodes, and edgepaths.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Graph, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘start’), Dimension(‘end’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
edgepaths
¶ -
Returns the fixed EdgePaths or computes direct connections between supplied nodes.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.graphs.Graph'>) ¶
-
classmethod
from_networkx
( G , layout_function , nodes=None , **kwargs ) [source] ¶ -
Generate a HoloViews Graph from a networkx.Graph object and networkx layout function. Any keyword arguments will be passed to the layout function.
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.graphs.Graph'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.graphs.Graph'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
nodes
¶ -
Computes the node positions the first time they are requested if no explicit node information was supplied.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , selection_mode='edges' , **selection ) [source] ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
Selecting by a node dimensions selects all edges and nodes that are connected to the selected nodes. To select only edges between the selected nodes set the selection_mode to ‘nodes’.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.graphs.Graph'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.graphs.Graph'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.graphs.
Nodes
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.element.chart.Points
Nodes is a simple Element representing Graph nodes as a set of Points. Unlike regular Points, Nodes must define a third key dimension corresponding to the node index.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Nodes, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(3, 3), constant=False, default=[Dimension(‘x’), Dimension(‘y’), Dimension(‘index’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Points in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.graphs.Nodes'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.graphs.Nodes'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.graphs.Nodes'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.graphs.Nodes'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.graphs.Nodes'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.graphs.
layout_nodes
( **params ) [source] ¶ -
Bases:
holoviews.core.operation.Operation
Accepts a Graph and lays out the corresponding nodes with the supplied networkx layout function. If no layout function is supplied uses a simple circular_layout function. Also supports LayoutAlgorithm function provided in datashader layouts.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=False, default=Operation, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - The group string used to identify the output of the Operation. By default this should match the operation name.
-
param ObjectSelector
dynamic
( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=default, instantiate=False, objects=[‘default’, True, False], pickle_default_value=True, precedence=None, readonly=False ) - Whether the operation should be applied dynamically when a specific frame is requested, specified as a Boolean. If set to ‘default’ the mode will be determined based on the input type, i.e. if the data is a DynamicMap it will stay dynamic.
-
param ClassSelector
input_ranges
( allow_None=True, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - Ranges to be used for input normalization (if applicable) in a format appropriate for the Normalization.ranges parameter. By default, no normalization is applied. If key-wise normalization is required, a 2-tuple may be supplied where the first component is a Normalization.ranges list and the second component is Normalization.keys.
-
param Boolean
link_inputs
( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - If the operation is dynamic, whether or not linked streams should be transferred from the operation inputs for backends that support linked streams. For example if an operation is applied to a DynamicMap with an RangeXY, this switch determines whether the corresponding visualization should update this stream with range changes originating from the newly generated axes.
-
param List
streams
( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - List of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.
-
param Boolean
only_nodes
( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - Whether to return Nodes or Graph.
-
param Callable
layout
( allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - A NetworkX layout function
-
param Dict
kwargs
( allow_None=False, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - Keyword arguments passed to the layout function.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.graphs.layout_nodes'>) ¶
-
get_overlay_bounds
( overlay ) ¶ -
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
-
get_overlay_label
( overlay , default_label='' ) ¶ -
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.graphs.layout_nodes'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.graphs.layout_nodes'>) ¶
-
instance
= functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.element.graphs.layout_nodes'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix='\n ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
process_element
( element , key , **params ) ¶ -
The process_element method allows a single element to be operated on given an externally supplied key.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y
-
search
( element , pattern ) ¶ -
Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.
The input may be a Layout, an Overlay type or a single Element.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.graphs.layout_nodes'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.graphs.layout_nodes'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.graphs.
redim_graph
( parent , mode=None ) [source] ¶ -
Bases:
holoviews.core.dimension.redim
Extension for the redim utility that allows re-dimensioning Graph objects including their nodes and edgepaths.
-
replace_dimensions
( dimensions , overrides ) ¶ -
Replaces dimensions in a list with a dictionary of overrides. Overrides should be indexed by the dimension name with values that is either a Dimension object, a string name or a dictionary specifying the dimension parameters to override.
-
path
Module
¶
A Path element is a way of drawing arbitrary shapes that can be overlayed on top of other elements.
Subclasses of Path are designed to generate certain common shapes quickly and conveniently. For instance, the Box path is often useful for marking areas of a raster image.
Contours is also a subclass of Path but in addition to simply displaying some information, there is a numeric value associated with each collection of paths.
-
class
holoviews.element.path.
BaseShape
( **params ) [source] ¶ -
Bases:
holoviews.element.path.Path
A BaseShape is a Path that can be succinctly expressed by a small number of parameters instead of a full path specification. For instance, a circle may be expressed by the center position and radius instead of an explicit list of path coordinates.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Path, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Image in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ObjectSelector
datatype
( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’], instantiate=True, objects=[], pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( *args , **overrides ) [source] ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.path.BaseShape'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.path.BaseShape'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.path.BaseShape'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Bypasses selection on data and sets extents based on selection.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.path.BaseShape'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.path.BaseShape'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
split
( start=None , end=None , datatype=None , **kwargs ) ¶ -
The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.path.
Bounds
( lbrt , **params ) [source] ¶ -
Bases:
holoviews.element.path.BaseShape
An arbitrary axis-aligned bounding rectangle defined by the (left, bottom, right, top) coordinate positions.
If supplied a single real number as input, this value will be treated as the radius of a square, zero-center box which will be used to compute the corresponding lbrt tuple.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Bounds, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The assigned group name.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Image in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ObjectSelector
datatype
( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’], instantiate=True, objects=[], pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
param NumericTuple
lbrt
( allow_None=False, constant=False, default=(-0.5, -0.5, 0.5, 0.5), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - The (left, bottom, right, top) coordinates of the bounding box.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.path.Bounds'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.path.Bounds'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.path.Bounds'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Bypasses selection on data and sets extents based on selection.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.path.Bounds'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.path.Bounds'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
split
( start=None , end=None , datatype=None , **kwargs ) ¶ -
The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.path.
Box
( x , y , spec , **params ) [source] ¶ -
Bases:
holoviews.element.path.BaseShape
Draw a centered box of a given width at the given position with the specified aspect ratio (if any).
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Box, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The assigned group name.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Image in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ObjectSelector
datatype
( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’], instantiate=True, objects=[], pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
param Number
x
( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - The x-position of the box center.
-
param Number
y
( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - The y-position of the box center.
-
param Number
width
( allow_None=False, bounds=None, constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - The width of the box.
-
param Number
height
( allow_None=False, bounds=None, constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - The height of the box.
-
param Number
orientation
( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - Orientation in the Cartesian coordinate system, the counterclockwise angle in radians between the first axis and the horizontal.
-
param Number
aspect
( allow_None=False, bounds=None, constant=False, default=1.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - Optional multiplier applied to the box size to compute the width in cases where only the length value is set.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.path.Box'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.path.Box'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.path.Box'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Bypasses selection on data and sets extents based on selection.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.path.Box'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.path.Box'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
split
( start=None , end=None , datatype=None , **kwargs ) ¶ -
The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.path.
Contours
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.element.path.Path
Contours is a type of Path that is also associated with a value (the contour level).
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Contours, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Image in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Contours optionally accept a value dimension, corresponding to the supplied values.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ObjectSelector
datatype
( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’], instantiate=True, objects=[], pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
param Number
level
( allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - Optional level associated with the set of Contours.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.path.Contours'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.path.Contours'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.path.Contours'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Bypasses selection on data and sets extents based on selection.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.path.Contours'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.path.Contours'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
split
( start=None , end=None , datatype=None , **kwargs ) ¶ -
The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.path.
Ellipse
( x , y , spec , **params ) [source] ¶ -
Bases:
holoviews.element.path.BaseShape
Draw an axis-aligned ellipse at the specified x,y position with the given orientation.
The simplest (default) Ellipse is a circle, specified using:
Ellipse(x,y, diameter)
A circle is a degenerate ellipse where the width and height are equal. To specify these explicitly, you can use:
Ellipse(x,y, (width, height))
There is also an aspect parameter allowing you to generate an ellipse by specifying a multiplicating factor that will be applied to the height only.
Note that as a subclass of Path, internally an Ellipse is a sequence of (x,y) sample positions. Ellipse could also be implemented as an annotation that uses a dedicated ellipse artist.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Ellipse, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The assigned group name.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Image in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ObjectSelector
datatype
( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’], instantiate=True, objects=[], pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
param Number
x
( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - The x-position of the ellipse center.
-
param Number
y
( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - The y-position of the ellipse center.
-
param Number
width
( allow_None=False, bounds=None, constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - The width of the ellipse.
-
param Number
height
( allow_None=False, bounds=None, constant=False, default=1, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - The height of the ellipse.
-
param Number
orientation
( allow_None=False, bounds=None, constant=False, default=0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - Orientation in the Cartesian coordinate system, the counterclockwise angle in radians between the first axis and the horizontal.
-
param Number
aspect
( allow_None=False, bounds=None, constant=False, default=1.0, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - Optional multiplier applied to the diameter to compute the width in cases where only the diameter value is set.
-
param Number
samples
( allow_None=False, bounds=None, constant=False, default=100, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - The sample count used to draw the ellipse.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.path.Ellipse'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.path.Ellipse'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.path.Ellipse'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Bypasses selection on data and sets extents based on selection.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.path.Ellipse'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.path.Ellipse'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
split
( start=None , end=None , datatype=None , **kwargs ) ¶ -
The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.path.
Path
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.core.data.Dataset
,holoviews.core.element.Element2D
The Path Element contains a list of Paths stored as tabular data types including arrays, dataframes and dictionary of column arrays. In addition a number of convenient constructors are supported:
- A list of lists containing x/y coordinate tuples.
- A tuple containing an array of length N with the x-values and a second array of shape NxP, where P is the number of paths.
- A list of tuples each containing arrays x and y values.
A Path can be split into subpaths using the split method or combined into a flat view using the dimension_values, table, and dframe methods, where each path is separated by a NaN value.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Path, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Image in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ObjectSelector
datatype
( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’], instantiate=True, objects=[], pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.path.Path'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.path.Path'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.path.Path'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) [source] ¶ -
Bypasses selection on data and sets extents based on selection.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.path.Path'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.path.Path'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
split
( start=None , end=None , datatype=None , **kwargs ) [source] ¶ -
The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
class
holoviews.element.path.
Polygons
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.element.path.Contours
Polygons is a Path Element type that may contain any number of closed paths with an associated value.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Polygons, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Image in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Polygons optionally accept a value dimension, corresponding to the supplied value.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param ObjectSelector
datatype
( allow_None=False, check_on_set=False, compute_default_fn=None, constant=False, default=[‘multitabular’], instantiate=True, objects=[], pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
param Number
level
( allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - Optional level associated with the set of Contours.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.path.Polygons'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.path.Polygons'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.path.Polygons'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Bypasses selection on data and sets extents based on selection.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.path.Polygons'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.path.Polygons'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
split
( start=None , end=None , datatype=None , **kwargs ) ¶ -
The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
raster
Module
¶
-
class
holoviews.element.raster.
HSV
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.element.raster.RGB
Example of a commonly used color space subclassed from RGB used for working in a HSV (hue, saturation and value) color space.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=HSV, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Raster in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(3, 4), constant=False, default=[Dimension(‘H’), Dimension(‘S’), Dimension(‘V’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The dimension description of the data held in the array. If an alpha channel is supplied, the defined alpha_dimension is automatically appended to this list.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘image’, ‘grid’, ‘xarray’, ‘cube’, ‘dataframe’, ‘dictionary’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
param ClassSelector
bounds
( allow_None=False, constant=False, default=BoundingBox(radius=0.5), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The bounding region in sheet coordinates containing the data.
-
param ClassSelector
alpha_dimension
( allow_None=False, constant=False, default=A, instantiate=False, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The alpha dimension definition to add the value dimensions if an alpha channel is supplied.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates.
-
closest_cell_center
( x , y ) ¶ -
Given arbitrary sheet coordinates, return the sheet coordinates of the center of the closest unit.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.raster.HSV'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.raster.HSV'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.raster.HSV'>) ¶
-
load_image
( filename , height=1 , array=False , bounds=None , bare=False , **kwargs ) ¶ -
Returns an raster element or raw numpy array from a PNG image file, using matplotlib.
The specified height determines the bounds of the raster object in sheet coordinates: by default the height is 1 unit with the width scaled appropriately by the image aspect ratio.
Note that as PNG images are encoded as RGBA, the red component maps to the first channel, the green component maps to the second component etc. For RGB elements, this mapping is trivial but may be important for subclasses e.g. for HSV elements.
Setting bare=True will apply options disabling axis labels displaying just the bare image. Any additional keyword arguments will be passed to the Image object.
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
matrix2sheet
( float_row , float_col ) ¶ -
Convert a floating-point location (float_row,float_col) in matrix coordinates to its corresponding location (x,y) in sheet coordinates.
Valid for scalar or array float_row and float_col.
Inverse of sheet2matrix().
-
matrixidx2sheet
( row , col ) ¶ -
Return (x,y) where x and y are the floating point coordinates of the center of the given matrix cell (row,col). If the matrix cell represents a 0.2 by 0.2 region, then the center location returned would be 0.1,0.1.
NOTE: This is NOT the strict mathematical inverse of sheet2matrixidx(), because sheet2matrixidx() discards all but the integer portion of the continuous matrix coordinate.
Valid only for scalar or array row and col.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
rgb
¶ -
Conversion from HSV to RGB.
-
sample
( samples=[] , **kwargs ) ¶ -
Allows sampling of an Image as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. On an Image the coordinates are continuously indexed and will always snap to the nearest coordinate.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.raster.HSV'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.raster.HSV'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sheet2matrix
( x , y ) ¶ -
Convert a point (x,y) in Sheet coordinates to continuous matrix coordinates.
Returns (float_row,float_col), where float_row corresponds to y, and float_col to x.
Valid for scalar or array x and y.
Note about Bounds For a Sheet with BoundingBox(points=((-0.5,-0.5),(0.5,0.5))) and density=3, x=-0.5 corresponds to float_col=0.0 and x=0.5 corresponds to float_col=3.0. float_col=3.0 is not inside the matrix representing this Sheet, which has the three columns (0,1,2). That is, x=-0.5 is inside the BoundingBox but x=0.5 is outside. Similarly, y=0.5 is inside (at row 0) but y=-0.5 is outside (at row 3) (it’s the other way round for y because the matrix row index increases as y decreases).
-
sheet2matrixidx
( x , y ) ¶ -
Convert a point (x,y) in sheet coordinates to the integer row and column index of the matrix cell in which that point falls, given a bounds and density. Returns (row,column).
Note that if coordinates along the right or bottom boundary are passed into this function, the returned matrix coordinate of the boundary will be just outside the matrix, because the right and bottom boundaries are exclusive.
Valid for scalar or array x and y.
-
sheetcoordinates_of_matrixidx
( ) ¶ -
Return x,y where x is a vector of sheet coordinates representing the x-center of each matrix cell, and y represents the corresponding y-center of the cell.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
xdensity
¶ -
The spacing between elements in an underlying matrix representation, in the x direction.
-
ydensity
¶ -
The spacing between elements in an underlying matrix representation, in the y direction.
-
param String
-
class
holoviews.element.raster.
HeatMap
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.core.data.Dataset
,holoviews.core.element.Element2D
HeatMap is an atomic Element used to visualize two dimensional parameter spaces. It supports sparse or non-linear spaces, dynamically upsampling them to a dense representation, which can be visualized.
A HeatMap can be initialized with any dict or NdMapping type with two-dimensional keys.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=HeatMap, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.raster.HeatMap'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.raster.HeatMap'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.raster.HeatMap'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.raster.HeatMap'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.raster.HeatMap'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.raster.
Image
( data , kdims=None , vdims=None , bounds=None , extents=None , xdensity=None , ydensity=None , **params ) [source] ¶ -
Bases:
holoviews.core.data.Dataset
,holoviews.element.raster.Raster
,holoviews.core.sheetcoords.SheetCoordinateSystem
Image is the atomic unit as which 2D data is stored, along with its bounds object. The input data may be a numpy.matrix object or a two-dimensional numpy array.
Allows slicing operations of the data in sheet coordinates or direct access to the data, via the .data attribute.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Image, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Raster in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The dimension description of the data held in the matrix.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘image’, ‘grid’, ‘xarray’, ‘cube’, ‘dataframe’, ‘dictionary’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
param ClassSelector
bounds
( allow_None=False, constant=False, default=BoundingBox(radius=0.5), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The bounding region in sheet coordinates containing the data.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) [source] ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates.
-
closest_cell_center
( x , y ) ¶ -
Given arbitrary sheet coordinates, return the sheet coordinates of the center of the closest unit.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.raster.Image'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.raster.Image'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.raster.Image'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
matrix2sheet
( float_row , float_col ) ¶ -
Convert a floating-point location (float_row,float_col) in matrix coordinates to its corresponding location (x,y) in sheet coordinates.
Valid for scalar or array float_row and float_col.
Inverse of sheet2matrix().
-
matrixidx2sheet
( row , col ) ¶ -
Return (x,y) where x and y are the floating point coordinates of the center of the given matrix cell (row,col). If the matrix cell represents a 0.2 by 0.2 region, then the center location returned would be 0.1,0.1.
NOTE: This is NOT the strict mathematical inverse of sheet2matrixidx(), because sheet2matrixidx() discards all but the integer portion of the continuous matrix coordinate.
Valid only for scalar or array row and col.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **kwargs ) [source] ¶ -
Allows sampling of an Image as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. On an Image the coordinates are continuously indexed and will always snap to the nearest coordinate.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) [source] ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.raster.Image'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.raster.Image'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sheet2matrix
( x , y ) ¶ -
Convert a point (x,y) in Sheet coordinates to continuous matrix coordinates.
Returns (float_row,float_col), where float_row corresponds to y, and float_col to x.
Valid for scalar or array x and y.
Note about Bounds For a Sheet with BoundingBox(points=((-0.5,-0.5),(0.5,0.5))) and density=3, x=-0.5 corresponds to float_col=0.0 and x=0.5 corresponds to float_col=3.0. float_col=3.0 is not inside the matrix representing this Sheet, which has the three columns (0,1,2). That is, x=-0.5 is inside the BoundingBox but x=0.5 is outside. Similarly, y=0.5 is inside (at row 0) but y=-0.5 is outside (at row 3) (it’s the other way round for y because the matrix row index increases as y decreases).
-
sheet2matrixidx
( x , y ) ¶ -
Convert a point (x,y) in sheet coordinates to the integer row and column index of the matrix cell in which that point falls, given a bounds and density. Returns (row,column).
Note that if coordinates along the right or bottom boundary are passed into this function, the returned matrix coordinate of the boundary will be just outside the matrix, because the right and bottom boundaries are exclusive.
Valid for scalar or array x and y.
-
sheetcoordinates_of_matrixidx
( ) ¶ -
Return x,y where x is a vector of sheet coordinates representing the x-center of each matrix cell, and y represents the corresponding y-center of the cell.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) [source] ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
xdensity
¶ -
The spacing between elements in an underlying matrix representation, in the x direction.
-
ydensity
¶ -
The spacing between elements in an underlying matrix representation, in the y direction.
-
param String
-
class
holoviews.element.raster.
QuadMesh
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.element.raster.Raster
QuadMesh is a Raster type to hold x- and y- bin values with associated values. The x- and y-values of the QuadMesh may be supplied either as the edges of each bin allowing uneven sampling or as the bin centers, which will be converted to evenly sampled edges.
As a secondary but less supported mode QuadMesh can contain a mesh of quadrilateral coordinates that is not laid out in a grid. The data should then be supplied as three separate 2D arrays for the x-/y-coordinates and grid values.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=QuadMesh, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Raster in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The dimension description of the data held in the matrix.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
classmethod
collapse_data
( data_list , function , kdims=None , **kwargs ) [source] ¶ -
Allows collapsing the data of a number of QuadMesh Elements with a function.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.raster.QuadMesh'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.raster.QuadMesh'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.raster.QuadMesh'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=None , function=None , **reduce_map ) ¶ -
Reduces the Raster using functions provided via the kwargs, where the keyword is the dimension to be reduced. Optionally a label_prefix can be provided to prepend to the result Element label.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **sample_values ) ¶ -
Sample the Raster along one or both of its dimensions, returning a reduced dimensionality type, which is either a ItemTable, Curve or Scatter. If two dimension samples and a new_xaxis is provided the sample will be the value of the sampled unit indexed by the value in the new_xaxis tuple.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.raster.QuadMesh'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.raster.QuadMesh'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.raster.
RGB
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.element.raster.Image
An RGB element is a Image containing channel data for the the red, green, blue and (optionally) the alpha channels. The values of each channel must be in the range 0.0 to 1.0.
In input array may have a shape of NxMx4 or NxMx3. In the latter case, the defined alpha dimension parameter is appended to the list of value dimensions.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=RGB, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Raster in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(3, 4), constant=False, default=[Dimension(‘R’), Dimension(‘G’), Dimension(‘B’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The dimension description of the data held in the matrix. If an alpha channel is supplied, the defined alpha_dimension is automatically appended to this list.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘image’, ‘grid’, ‘xarray’, ‘cube’, ‘dataframe’, ‘dictionary’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
param ClassSelector
bounds
( allow_None=False, constant=False, default=BoundingBox(radius=0.5), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The bounding region in sheet coordinates containing the data.
-
param ClassSelector
alpha_dimension
( allow_None=False, constant=False, default=A, instantiate=False, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The alpha dimension definition to add the value dimensions if an alpha channel is supplied.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates.
-
closest_cell_center
( x , y ) ¶ -
Given arbitrary sheet coordinates, return the sheet coordinates of the center of the closest unit.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.raster.RGB'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.raster.RGB'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.raster.RGB'>) ¶
-
classmethod
load_image
( filename , height=1 , array=False , bounds=None , bare=False , **kwargs ) [source] ¶ -
Returns an raster element or raw numpy array from a PNG image file, using matplotlib.
The specified height determines the bounds of the raster object in sheet coordinates: by default the height is 1 unit with the width scaled appropriately by the image aspect ratio.
Note that as PNG images are encoded as RGBA, the red component maps to the first channel, the green component maps to the second component etc. For RGB elements, this mapping is trivial but may be important for subclasses e.g. for HSV elements.
Setting bare=True will apply options disabling axis labels displaying just the bare image. Any additional keyword arguments will be passed to the Image object.
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
matrix2sheet
( float_row , float_col ) ¶ -
Convert a floating-point location (float_row,float_col) in matrix coordinates to its corresponding location (x,y) in sheet coordinates.
Valid for scalar or array float_row and float_col.
Inverse of sheet2matrix().
-
matrixidx2sheet
( row , col ) ¶ -
Return (x,y) where x and y are the floating point coordinates of the center of the given matrix cell (row,col). If the matrix cell represents a 0.2 by 0.2 region, then the center location returned would be 0.1,0.1.
NOTE: This is NOT the strict mathematical inverse of sheet2matrixidx(), because sheet2matrixidx() discards all but the integer portion of the continuous matrix coordinate.
Valid only for scalar or array row and col.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
rgb
¶ -
Returns the corresponding RGB element.
Other than the updating parameter definitions, this is the only change needed to implemented an arbitrary colorspace as a subclass of RGB.
-
sample
( samples=[] , **kwargs ) ¶ -
Allows sampling of an Image as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. On an Image the coordinates are continuously indexed and will always snap to the nearest coordinate.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.raster.RGB'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.raster.RGB'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sheet2matrix
( x , y ) ¶ -
Convert a point (x,y) in Sheet coordinates to continuous matrix coordinates.
Returns (float_row,float_col), where float_row corresponds to y, and float_col to x.
Valid for scalar or array x and y.
Note about Bounds For a Sheet with BoundingBox(points=((-0.5,-0.5),(0.5,0.5))) and density=3, x=-0.5 corresponds to float_col=0.0 and x=0.5 corresponds to float_col=3.0. float_col=3.0 is not inside the matrix representing this Sheet, which has the three columns (0,1,2). That is, x=-0.5 is inside the BoundingBox but x=0.5 is outside. Similarly, y=0.5 is inside (at row 0) but y=-0.5 is outside (at row 3) (it’s the other way round for y because the matrix row index increases as y decreases).
-
sheet2matrixidx
( x , y ) ¶ -
Convert a point (x,y) in sheet coordinates to the integer row and column index of the matrix cell in which that point falls, given a bounds and density. Returns (row,column).
Note that if coordinates along the right or bottom boundary are passed into this function, the returned matrix coordinate of the boundary will be just outside the matrix, because the right and bottom boundaries are exclusive.
Valid for scalar or array x and y.
-
sheetcoordinates_of_matrixidx
( ) ¶ -
Return x,y where x is a vector of sheet coordinates representing the x-center of each matrix cell, and y represents the corresponding y-center of the cell.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
xdensity
¶ -
The spacing between elements in an underlying matrix representation, in the x direction.
-
ydensity
¶ -
The spacing between elements in an underlying matrix representation, in the y direction.
-
param String
-
class
holoviews.element.raster.
Raster
( data , kdims=None , vdims=None , extents=None , **params ) [source] ¶ -
Bases:
holoviews.core.element.Element2D
Raster is a basic 2D element type for presenting either numpy or dask arrays as two dimensional raster images.
Arrays with a shape of (N,M) are valid inputs for Raster whereas subclasses of Raster (e.g. RGB) may also accept 3D arrays containing channel information.
Raster does not support slicing like the Image or RGB subclasses and the extents are in matrix coordinates if not explicitly specified.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Raster, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=True, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The label of the x- and y-dimension of the Raster in form of a string or dimension object.
-
param List
vdims
( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘z’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The dimension description of the data held in the matrix.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dim , expanded=True , flat=True ) [source] ¶ -
The set of samples available along a particular dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.raster.Raster'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.raster.Raster'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.raster.Raster'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=None , function=None , **reduce_map ) [source] ¶ -
Reduces the Raster using functions provided via the kwargs, where the keyword is the dimension to be reduced. Optionally a label_prefix can be provided to prepend to the result Element label.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **sample_values ) [source] ¶ -
Sample the Raster along one or both of its dimensions, returning a reduced dimensionality type, which is either a ItemTable, Curve or Scatter. If two dimension samples and a new_xaxis is provided the sample will be the value of the sampled unit indexed by the value in the new_xaxis tuple.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.raster.Raster'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.raster.Raster'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
stats
Module
¶
-
class
holoviews.element.stats.
Bivariate
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.element.stats.StatisticsElement
Bivariate elements are containers for two dimensional data, which is to be visualized as a kernel density estimate. The data should be supplied in a tabular format of x- and y-columns.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Bivariate, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(2, 2), constant=False, default=[Dimension(‘x’), Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, 1), constant=False, default=[Dimension(‘Density’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.stats.Bivariate'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.stats.Bivariate'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.stats.Bivariate'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.stats.Bivariate'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.stats.Bivariate'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.stats.
Distribution
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.element.stats.StatisticsElement
Distribution elements provides a representation for a one-dimensional distribution which can be visualized as a kernel density estimate. The data should be supplied in a tabular format and will use the first column.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Distribution, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(1, 1), constant=False, default=[Dimension(‘Value’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, 1), constant=False, default=[Dimension(‘Density’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.stats.Distribution'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.stats.Distribution'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.stats.Distribution'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.stats.Distribution'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.stats.Distribution'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.stats.
StatisticsElement
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.element.chart.Chart
StatisticsElement provides a baseclass for Element types that compute statistics based on the input data. The baseclass overrides standard Dataset methods emulating the existence of the value dimensions.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Chart, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘x’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions of the Chart, determining the number of indexable dimensions.
-
param List
vdims
( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions of the Chart, usually corresponding to a number of dependent variables.
-
param Tuple
extents
( allow_None=False, constant=False, default=(None, None, None, None), instantiate=False, length=4, pickle_default_value=True, precedence=None, readonly=False ) - Allows overriding the extents of the Element in 2D space defined as four-tuple defining the (left, bottom, right and top) edges.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) [source] ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) [source] ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.stats.StatisticsElement'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) [source] ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.stats.StatisticsElement'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.stats.StatisticsElement'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.stats.StatisticsElement'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.stats.StatisticsElement'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
tabular
Module
¶
-
class
holoviews.element.tabular.
ItemTable
( data , **params ) [source] ¶ -
Bases:
holoviews.core.element.Element
A tabular element type to allow convenient visualization of either a standard Python dictionary, an OrderedDict or a list of tuples (i.e. input suitable for an OrderedDict constructor). If an OrderedDict is used, the headings will be kept in the correct order. Tables store heterogeneous data with different labels.
Dimension objects are also accepted as keys, allowing dimensional information (e.g type and units) to be associated per heading.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=ItemTable, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A string describing the data wrapped by the object.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(0, 0), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - ItemTables hold an index Dimension for each value they contain, i.e. they are equivalent to the keys.
-
param List
vdims
( allow_None=False, bounds=(1, None), constant=False, default=[Dimension(‘Default’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - ItemTables should have only index Dimensions.
-
cell_type
( row , col ) [source] ¶ -
Returns the cell type given a row and column index. The common basic cell types are ‘data’ and ‘heading’.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.tabular.ItemTable'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.tabular.ItemTable'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.tabular.ItemTable'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
pprint_cell
( row , col ) [source] ¶ -
Get the formatted cell value for the given row and column indices.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.tabular.ItemTable'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.tabular.ItemTable'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.element.tabular.
Table
( data , kdims=None , vdims=None , **kwargs ) [source] ¶ -
Bases:
holoviews.core.data.Dataset
,holoviews.core.element.Tabular
Table is a Dataset type, which gets displayed in a tabular format and is convertible to most other Element types.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Table, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The group is used to describe the Table.
-
param String
label
( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
-
param Dict
cdims
( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
-
param List
kdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
-
param List
vdims
( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
cell_type
( row , col ) ¶ -
Returns the cell type given a row and column index. The common basic cell types are ‘data’ and ‘heading’.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.tabular.Table'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.tabular.Table'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.
Examples:
-
Index the first row and column:
dataset.iloc[0, 0]
-
Select rows 1 and 2 with a slice:
dataset.iloc[1:3, :]
-
Select with a list of integer coordinates:
dataset.iloc[[0, 2, 3]]
-
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.tabular.Table'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with
image.ndloc[iy, ix]
, whereiy
andix
are integer indices along the y and x dimensions.Examples:
-
Index value in 2D array:
dataset.ndloc[3, 1]
-
Slice along y-axis of 2D array:
dataset.ndloc[2:5, :]
-
Vectorized (non-orthogonal) indexing along x- and y-axes:
dataset.ndloc[[1, 2, 3], [0, 2, 3]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
pprint_cell
( row , col ) ¶ -
Get the formatted cell value for the given row and column indices.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.tabular.Table'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.tabular.Table'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) ¶ -
Sorts the data by the values along the supplied dimensions.
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
table
( datatype=None ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
util
Module
¶
-
class
holoviews.element.util.
categorical_aggregate2d
( **params ) [source] ¶ -
Bases:
holoviews.core.operation.Operation
Generates a gridded Dataset of 2D aggregate arrays indexed by the first two dimensions of the passed Element, turning all remaining dimensions into value dimensions. The key dimensions of the gridded array are treated as categorical indices. Useful for data indexed by two independent categorical variables such as a table of population values indexed by country and year. Data that is indexed by continuous dimensions should be binned before aggregation. The aggregation will retain the global sorting order of both dimensions.
- >> table = Table([(‘USA’, 2000, 282.2), (‘UK’, 2005, 58.89)],
- kdims=[‘Country’, ‘Year’], vdims=[‘Population’])
>> categorical_aggregate2d(table) Dataset({‘Country’: [‘USA’, ‘UK’], ‘Year’: [2000, 2005],
‘Population’: [[ 282.2 , np.NaN], [np.NaN, 58.89]]},kdims=[‘Country’, ‘Year’], vdims=[‘Population’])
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=False, default=Operation, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - The group string used to identify the output of the Operation. By default this should match the operation name.
-
param ObjectSelector
dynamic
( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=default, instantiate=False, objects=[‘default’, True, False], pickle_default_value=True, precedence=None, readonly=False ) - Whether the operation should be applied dynamically when a specific frame is requested, specified as a Boolean. If set to ‘default’ the mode will be determined based on the input type, i.e. if the data is a DynamicMap it will stay dynamic.
-
param ClassSelector
input_ranges
( allow_None=True, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False ) - Ranges to be used for input normalization (if applicable) in a format appropriate for the Normalization.ranges parameter. By default, no normalization is applied. If key-wise normalization is required, a 2-tuple may be supplied where the first component is a Normalization.ranges list and the second component is Normalization.keys.
-
param Boolean
link_inputs
( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - If the operation is dynamic, whether or not linked streams should be transferred from the operation inputs for backends that support linked streams. For example if an operation is applied to a DynamicMap with an RangeXY, this switch determines whether the corresponding visualization should update this stream with range changes originating from the newly generated axes.
-
param List
streams
( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - List of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.
-
param List
datatype
( allow_None=False, bounds=(0, None), constant=False, default=[‘xarray’, ‘grid’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The grid interface types to use when constructing the gridded Dataset.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.element.util.categorical_aggregate2d'>) ¶
-
get_overlay_bounds
( overlay ) ¶ -
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
-
get_overlay_label
( overlay , default_label='' ) ¶ -
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.element.util.categorical_aggregate2d'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.element.util.categorical_aggregate2d'>) ¶
-
instance
= functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.element.util.categorical_aggregate2d'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix='\n ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
process_element
( element , key , **params ) ¶ -
The process_element method allows a single element to be operated on given an externally supplied key.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y
-
search
( element , pattern ) ¶ -
Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.
The input may be a Layout, an Overlay type or a single Element.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.element.util.categorical_aggregate2d'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.element.util.categorical_aggregate2d'>) ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
holoviews.element.util.
compute_edges
( edges ) [source] ¶ -
Computes edges as midpoints of the bin centers. The first and last boundaries are equidistant from the first and last midpoints respectively.
-
holoviews.element.util.
compute_slice_bounds
( slices , scs , shape ) [source] ¶ -
Given a 2D selection consisting of slices/coordinates, a SheetCoordinateSystem and the shape of the array returns a new BoundingBox representing the sliced region.
-
holoviews.element.util.
reduce_fn
( x ) [source] ¶ -
Aggregation function to get the first non-zero value.
-
holoviews.element.util.
split_path
( path ) [source] ¶ -
Split a Path type containing a single NaN separated path into multiple subpaths.