holoviews.data Package


data Package

holoviews.core.data. Columns

alias of Dataset

class holoviews.core.data. DataConversion ( element ) [source]

Bases: object

DataConversion is a very simple container object which can be given an existing Dataset Element and provides methods to convert the Dataset into most other Element types.

class holoviews.core.data. 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] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

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.


array Module


dask Module

class holoviews.core.data.dask. DaskInterface ( **params ) [source]

Bases: holoviews.core.data.pandas.PandasInterface

The DaskInterface allows a Dataset objects to wrap a dask DataFrame object. Using dask allows loading data lazily and performing out-of-core operations on the data, making it possible to work on datasets larger than memory.

The DaskInterface covers almost the complete API exposed by the PandasInterface with two notable exceptions:

  1. Sorting is not supported and any attempt at sorting will be ignored with an warning.
  2. Dask does not easily support adding a new column to an existing dataframe unless it is a scalar, add_dimension will therefore error when supplied a non-scalar value.
  1. Not all functions can be easily applied to a dask dataframe so some functions applied with aggregate and reduce will not work.
as_dframe ( dataset )

Returns the data of a Dataset as a dataframe avoiding copying if it already a dataframe type.

cast ( dataset , datatype=None , cast_type=None )

Given a list of Dataset objects, cast them to the specified datatype (by default the format matching the current interface) with the given cast_type (if specified).

concatenate ( dataset , datatype=None )

Utility function to concatenate a list of Column objects, returning a new Dataset object. Note that this is unlike the .concat method which only concatenates the data.

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.core.data.dask.DaskInterface'>)
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.dask.DaskInterface'>)
classmethod iloc ( dataset , index ) [source]

Dask does not support iloc, therefore iloc will execute the call graph and lose the laziness of the operation.

indexed ( dataset , selection )

Given a Dataset object and selection to be applied returns boolean to indicate whether a scalar value has been indexed.

inspect_value = functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.data.dask.DaskInterface'>)
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=' ' , 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.

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

Variant of __repr__ designed for generating a runnable script.

classmethod select_mask ( dataset , selection ) [source]

Given a Dataset object and a dictionary with dimension keys and selection keys (i.e tuple ranges, slices, sets, lists or literals) return a boolean mask over the rows in the Dataset object that have been selected.

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.dask.DaskInterface'>)
set_param = functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.data.dask.DaskInterface'>)
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.

classmethod unpack_scalar ( columns , data ) [source]

Given a columns object and data in the appropriate format for the interface, return a simple scalar.

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.


dictionary Module

class holoviews.core.data.dictionary. DictInterface ( **params ) [source]

Bases: holoviews.core.data.interface.Interface

Interface for simple dictionary-based dataset format. The dictionary keys correspond to the column (i.e dimension) names and the values are collections representing the values in that column.

cast ( dataset , datatype=None , cast_type=None )

Given a list of Dataset objects, cast them to the specified datatype (by default the format matching the current interface) with the given cast_type (if specified).

concatenate ( dataset , datatype=None )

Utility function to concatenate a list of Column objects, returning a new Dataset object. Note that this is unlike the .concat method which only concatenates the data.

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.core.data.dictionary.DictInterface'>)
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.dictionary.DictInterface'>)
indexed ( dataset , selection )

Given a Dataset object and selection to be applied returns boolean to indicate whether a scalar value has been indexed.

inspect_value = functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.data.dictionary.DictInterface'>)
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=' ' , 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.

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

Variant of __repr__ designed for generating a runnable script.

select_mask ( dataset , selection )

Given a Dataset object and a dictionary with dimension keys and selection keys (i.e tuple ranges, slices, sets, lists or literals) return a boolean mask over the rows in the Dataset object that have been selected.

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.dictionary.DictInterface'>)
set_param = functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.data.dictionary.DictInterface'>)
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.

classmethod unpack_scalar ( dataset , data ) [source]

Given a dataset object and data in the appropriate format for the interface, return a simple scalar.

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.


grid Module

class holoviews.core.data.grid. GridInterface ( **params ) [source]

Bases: holoviews.core.data.dictionary.DictInterface

Interface for simple dictionary-based dataset format using a compressed representation that uses the cartesian product between key dimensions. As with DictInterface, the dictionary keys correspond to the column (i.e dimension) names and the values are NumPy arrays representing the values in that column.

To use this compressed format, the key dimensions must be orthogonal to one another with each key dimension specifying an axis of the multidimensional space occupied by the value dimension data. For instance, given an temperature recordings sampled regularly across the earth surface, a list of N unique latitudes and M unique longitudes can specify the position of NxM temperature samples.

classmethod canonicalize ( dataset , data , coord_dims=None ) [source]

Canonicalize takes an array of values as input and reorients and transposes it to match the canonical format expected by plotting functions. In addition to the dataset and the particular array to apply transforms to a list of coord_dims may be supplied in case the array indexing does not match the key dimensions of the dataset.

cast ( dataset , datatype=None , cast_type=None )

Given a list of Dataset objects, cast them to the specified datatype (by default the format matching the current interface) with the given cast_type (if specified).

concatenate ( dataset , datatype=None )

Utility function to concatenate a list of Column objects, returning a new Dataset object. Note that this is unlike the .concat method which only concatenates the data.

classmethod coords ( dataset , dim , ordered=False , expanded=False ) [source]

Returns the coordinates along a dimension. Ordered ensures coordinates are in ascending order and expanded creates ND-array matching the dimensionality of the 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.core.data.grid.GridInterface'>)
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.grid.GridInterface'>)
indexed ( dataset , selection )

Given a Dataset object and selection to be applied returns boolean to indicate whether a scalar value has been indexed.

inspect_value = functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.data.grid.GridInterface'>)
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=' ' , 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.

classmethod sample ( dataset , samples=[] ) [source]

Samples the gridded data into dataset of samples.

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

Variant of __repr__ designed for generating a runnable script.

select_mask ( dataset , selection )

Given a Dataset object and a dictionary with dimension keys and selection keys (i.e tuple ranges, slices, sets, lists or literals) return a boolean mask over the rows in the Dataset object that have been selected.

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.grid.GridInterface'>)
set_param = functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.data.grid.GridInterface'>)
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.

unpack_scalar ( dataset , data )

Given a dataset object and data in the appropriate format for the interface, return a simple scalar.

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.


image Module

class holoviews.core.data.image. ImageInterface ( **params ) [source]

Bases: holoviews.core.data.grid.GridInterface

Interface for 2 or 3D arrays representing images of raw luminance values, RGB values or HSV values.

canonicalize ( dataset , data , coord_dims=None )

Canonicalize takes an array of values as input and reorients and transposes it to match the canonical format expected by plotting functions. In addition to the dataset and the particular array to apply transforms to a list of coord_dims may be supplied in case the array indexing does not match the key dimensions of the dataset.

cast ( dataset , datatype=None , cast_type=None )

Given a list of Dataset objects, cast them to the specified datatype (by default the format matching the current interface) with the given cast_type (if specified).

concatenate ( dataset , datatype=None )

Utility function to concatenate a list of Column objects, returning a new Dataset object. Note that this is unlike the .concat method which only concatenates the data.

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.core.data.image.ImageInterface'>)
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.image.ImageInterface'>)
indexed ( dataset , selection )

Given a Dataset object and selection to be applied returns boolean to indicate whether a scalar value has been indexed.

inspect_value = functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.data.image.ImageInterface'>)
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=' ' , 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.

classmethod sample ( dataset , samples=[] ) [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.

classmethod select ( dataset , selection_mask=None , **selection ) [source]

Slice the underlying numpy array in sheet coordinates.

select_mask ( dataset , selection )

Given a Dataset object and a dictionary with dimension keys and selection keys (i.e tuple ranges, slices, sets, lists or literals) return a boolean mask over the rows in the Dataset object that have been selected.

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.image.ImageInterface'>)
set_param = functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.data.image.ImageInterface'>)
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.

classmethod unpack_scalar ( dataset , data ) [source]

Given a dataset object and data in the appropriate format for the interface, return a simple scalar.

classmethod values ( dataset , dim , expanded=True , flat=True ) [source]

The set of samples available along a particular dimension.

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.


interface Module

exception holoviews.core.data.interface. DataError ( msg , interface=None ) [source]

Bases: ValueError

DataError is raised when the data cannot be interpreted

with_traceback ( )

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class holoviews.core.data.interface. iloc ( dataset ) [source]

Bases: object

iloc is small wrapper object that allows row, column based indexing into a Dataset using the .iloc property. It supports the usual numpy and pandas iloc indexing semantics including integer indices, slices, lists and arrays of values. For more information see the Dataset.iloc property docstring.

class holoviews.core.data.interface. ndloc ( dataset ) [source]

Bases: object

ndloc is a small wrapper object that allows ndarray-like indexing for gridded Datasets using the .ndloc property. It supports the standard NumPy ndarray indexing semantics including integer indices, slices, lists and arrays of values. For more information see the Dataset.ndloc property docstring.


iris Module


multipath Module

class holoviews.core.data.multipath. MultiInterface ( **params ) [source]

Bases: holoviews.core.data.interface.Interface

MultiInterface allows wrapping around a list of tabular datasets including dataframes, the columnar dictionary format or 2D tabular NumPy arrays. Using the split method the list of tabular data can be split into individual datasets.

The interface makes the data appear a list of tabular datasets as a single dataset. The length, shape and values methods therefore make the data appear like a single array of concatenated subpaths, separated by NaN values.

cast ( dataset , datatype=None , cast_type=None )

Given a list of Dataset objects, cast them to the specified datatype (by default the format matching the current interface) with the given cast_type (if specified).

concatenate ( dataset , datatype=None )

Utility function to concatenate a list of Column objects, returning a new Dataset object. Note that this is unlike the .concat method which only concatenates the data.

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.core.data.multipath.MultiInterface'>)
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.multipath.MultiInterface'>)
indexed ( dataset , selection )

Given a Dataset object and selection to be applied returns boolean to indicate whether a scalar value has been indexed.

inspect_value = functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.data.multipath.MultiInterface'>)
classmethod isscalar ( dataset , dim ) [source]

Tests if dimension is scalar in each subpath.

classmethod length ( dataset ) [source]

Returns the length of the multi-tabular dataset making it appear like a single array of concatenated subpaths separated by NaN values.

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=' ' , 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.

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

Variant of __repr__ designed for generating a runnable script.

classmethod select ( dataset , selection_mask=None , **selection ) [source]

Applies selectiong on all the subpaths.

select_mask ( dataset , selection )

Given a Dataset object and a dictionary with dimension keys and selection keys (i.e tuple ranges, slices, sets, lists or literals) return a boolean mask over the rows in the Dataset object that have been selected.

classmethod select_paths ( dataset , selection ) [source]

Allows selecting paths with usual NumPy slicing index.

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.multipath.MultiInterface'>)
set_param = functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.data.multipath.MultiInterface'>)
classmethod shape ( dataset ) [source]

Returns the shape of all subpaths, making it appear like a single array of concatenated subpaths separated by NaN values.

classmethod split ( dataset , start , end , datatype , **kwargs ) [source]

Splits a multi-interface Dataset into regular Datasets using regular tabular interfaces.

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.

classmethod values ( dataset , dimension , expanded , flat ) [source]

Returns a single concatenated array of all subpaths separated by NaN values. If expanded keyword is False an array of arrays is returned.

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.


pandas Module


xarray Module