holoviews.data Package


data Package

Inheritance diagram of holoviews.core.data
holoviews.core.data. Columns

alias of holoviews.core.data.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, regex=None, watchers={} )
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, regex=None, watchers={} )
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, watchers={} )
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, watchers={} )
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, watchers={} )
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=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
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]

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs ) [source]

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides ) [source]

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs ) [source]

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None ) [source]

Convert dimension values to a dictionary.

Returns a dictionary of column arrays along each dimension of the element.

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False ) [source]

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

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.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.Dataset'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim ) [source]

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.Dataset'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.Dataset'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) [source]

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

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 Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.Dataset'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

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

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

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 ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True ) [source]

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions ) [source]

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None ) [source]

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs ) [source]

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection ) [source]

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.Dataset'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.Dataset'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False ) [source]

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
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 )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

holoviews.core.data. concat ( datasets , datatype=None ) [source]

Concatenates collection of datasets along NdMapping dimensions.

Concatenates multiple datasets wrapped in an NdMapping type along all of its dimensions. Before concatenation all datasets are cast to the same datatype, which may be explicitly defined or implicitly derived from the first datatype that is encountered. For columnar data concatenation adds the columns for the dimensions being concatenated along and then concatenates all the old and new columns. For gridded data a new axis is created for each dimension being concatenated along and then hierarchically concatenates along each dimension.

Args:
datasets: NdMapping of Datasets to concatenate datatype: Datatype to cast data to before concatenation
Returns:
Concatenated dataset


dask Module

Inheritance diagram of holoviews.core.data.dask
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 ( datasets , 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 ( datasets , datatype=None , new_type=None )

Utility function to concatenate an NdMapping of Dataset objects.

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.dask.DaskInterface'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.dask.DaskInterface'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <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 Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.dask.DaskInterface'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

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 ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

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 ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.dask.DaskInterface'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <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 ( dataset , data ) [source]

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

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring


dictionary Module

Inheritance diagram of holoviews.core.data.dictionary
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.

applies ( obj )

Indicates whether the interface is designed specifically to handle the supplied object’s type. By default simply checks if the object is one of the types declared on the class, however if the type is expensive to import at load time the method may be overridden.

cast ( datasets , 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 ( datasets , datatype=None , new_type=None )

Utility function to concatenate an NdMapping of Dataset objects.

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.dictionary.DictInterface'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.dictionary.DictInterface'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <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 Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.dictionary.DictInterface'>)
loaded ( )

Indicates whether the required dependencies are loaded.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

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 ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

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 ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.dictionary.DictInterface'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <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 ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring


grid Module

Inheritance diagram of holoviews.core.data.grid
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.

applies ( obj )

Indicates whether the interface is designed specifically to handle the supplied object’s type. By default simply checks if the object is one of the types declared on the class, however if the type is expensive to import at load time the method may be overridden.

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

Canonicalize takes an array of values as input and reorients and transposes it to match the canonical format expected by plotting functions. In certain cases the dimensions defined via the kdims of an Element may not match the dimensions of the underlying data. A set of data_coords may be passed in to define the dimensionality of the data, which can then be used to np.squeeze the data to remove any constant dimensions. If the data is also irregular, i.e. contains multi-dimensional coordinates, a set of virtual_coords can be supplied, required by some interfaces (e.g. xarray) to index irregular datasets with a virtual integer index. This ensures these coordinates are not simply dropped.

cast ( datasets , 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 ( datasets , datatype=None , new_type=None )

Utility function to concatenate an NdMapping of Dataset objects.

classmethod coords ( dataset , dim , ordered=False , expanded=False , edges=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 ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.grid.GridInterface'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.grid.GridInterface'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <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 Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.grid.GridInterface'>)
loaded ( )

Indicates whether the required dependencies are loaded.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

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 ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

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 ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.grid.GridInterface'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <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 ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring


image Module

Inheritance diagram of holoviews.core.data.image
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.

applies ( obj )

Indicates whether the interface is designed specifically to handle the supplied object’s type. By default simply checks if the object is one of the types declared on the class, however if the type is expensive to import at load time the method may be overridden.

canonicalize ( dataset , data , data_coords=None , virtual_coords=[] )

Canonicalize takes an array of values as input and reorients and transposes it to match the canonical format expected by plotting functions. In certain cases the dimensions defined via the kdims of an Element may not match the dimensions of the underlying data. A set of data_coords may be passed in to define the dimensionality of the data, which can then be used to np.squeeze the data to remove any constant dimensions. If the data is also irregular, i.e. contains multi-dimensional coordinates, a set of virtual_coords can be supplied, required by some interfaces (e.g. xarray) to index irregular datasets with a virtual integer index. This ensures these coordinates are not simply dropped.

cast ( datasets , 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 ( datasets , datatype=None , new_type=None )

Utility function to concatenate an NdMapping of Dataset objects.

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.image.ImageInterface'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.image.ImageInterface'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <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 Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.image.ImageInterface'>)
classmethod irregular ( dataset , dim ) [source]

ImageInterface does not support irregular data

loaded ( )

Indicates whether the required dependencies are loaded.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

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 ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

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 ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.image.ImageInterface'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <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 , compute=True ) [source]

The set of samples available along a particular dimension.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring


interface Module

Inheritance diagram of holoviews.core.data.interface
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


ndelement Module


pandas Module

Inheritance diagram of holoviews.core.data.pandas

xarray Module

Inheritance diagram of holoviews.core.data.xarray