holoviews.core.data.grid module#
- class holoviews.core.data.grid.GridInterface(*, name)[source]#
Bases:
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.
Methods
canonicalize
(dataset, data[, data_coords, ...])Canonicalize takes an array of values as input and reorients and transposes it to match the canonical format expected by plotting functions.
compute
(dataset)Should return a computed version of the Dataset.
coords
(dataset, dim[, ordered, expanded, edges])Returns the coordinates along a dimension.
persist
(dataset)Should return a persisted version of the Dataset.
sample
(dataset[, samples])Samples the gridded data into dataset of samples.
add_dimension
aggregate
assign
concat
concat_dim
dimension_type
dtype
groupby
iloc
init
invert_index
irregular
isscalar
key_select_mask
length
mask
ndloc
packed
range
reindex
select
shape
sort
validate
values
Parameter Definitions
- classmethod canonicalize(dataset, data, data_coords=None, virtual_coords=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 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.