holoviews.core.data.image module#
- class holoviews.core.data.image.ImageInterface(*, name)[source]#
Bases:
GridInterfaceInterface for 2 or 3D arrays representing images of raw luminance values, RGB values or HSV values.
Methods
coords(dataset, dim[, ordered, expanded, edges])Returns the coordinates along a dimension.
dtype(dataset, dimension)Returns the dtype for the selected dimension.
irregular(dataset, dim)ImageInterface does not support irregular data
length(dataset)Returns the number of rows in the Dataset.
range(obj, dim)Computes the minimum and maximum value along a dimension.
redim(dataset, dimensions)Renames dimensions in the data.
reindex(dataset[, kdims, vdims])Reindexes data given new key and value dimensions.
sample(dataset[, samples])Sample the Raster along one or both of its dimensions, returning a reduced dimensionality type, which is either a ItemTable, Curve or Scatter.
select(dataset[, selection_mask])Slice the underlying numpy array in sheet coordinates.
shape(dataset[, gridded])Returns the shape of the data.
unpack_scalar(dataset, data)Given a dataset object and data in the appropriate format for the interface, return a simple scalar.
validate(dataset[, vdims])Validation runs after the Dataset has been constructed and should validate that the Dataset is correctly formed and contains all declared dimensions.
values(dataset, dim[, expanded, flat, ...])The set of samples available along a particular dimension.
aggregate
groupby
init
mask
Parameter Definitions
- 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.
- classmethod dtype(dataset, dimension)[source]#
Returns the dtype for the selected dimension.
- Parameters:
- dataset
Dataset The dataset to query
- dimension
strorDimension Dimension to return the dtype for
- dataset
- Returns:
numpy.dtypeThe dtype of the selected dimension
- classmethod length(dataset)[source]#
Returns the number of rows in the Dataset.
- Parameters:
- dataset
Dataset The dataset to get the length from
- dataset
- Returns:
intLength of the data
- classmethod range(obj, dim)[source]#
Computes the minimum and maximum value along a dimension.
- Parameters:
- dataset
Dataset The dataset to query
- dimension
strorDimension Dimension to compute the range on
- dataset
- Returns:
tuple[Any,Any]Tuple of (min, max) values
Notes
In the past categorical and string columns were handled by sorting the values and taking the first and last value. This behavior is deprecated and will be removed in 2.0. In future the range for these columns will be returned as (None, None).
- classmethod redim(dataset, dimensions)[source]#
Renames dimensions in the data.
- Parameters:
- Returns:
dataData after the dimension names have been transformed
Notes
Only meaningful for data formats that store dimension names.
- classmethod reindex(dataset, kdims=None, vdims=None)[source]#
Reindexes data given new key and value dimensions.
- classmethod sample(dataset, samples=None)[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.
- classmethod select(dataset, selection_mask=None, **selection)[source]#
Slice the underlying numpy array in sheet coordinates.
- classmethod unpack_scalar(dataset, data)[source]#
Given a dataset object and data in the appropriate format for the interface, return a simple scalar.