holoviews.core.data.array module#
- class holoviews.core.data.array.ArrayInterface(*, name)[source]#
Bases:
InterfaceMethods
add_dimension(dataset, dimension, dim_pos, ...)Returns a copy of the data with the dimension values added.
array(dataset, dimensions)Returns the data as a numpy.ndarray containing the selected dimensions.
assign(dataset, new_data)Adds a dictionary containing data for multiple new dimensions to a copy of the dataset.data.
dtype(dataset, dimension)Returns the dtype for the selected dimension.
iloc(dataset, index)Implements integer indexing on the rows and columns of the data.
isscalar(dataset, dim)Whether the selected dimension is a scalar value.
reindex(dataset[, kdims, vdims])Reindexes data given new key and value dimensions.
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, ...])Returns the values along a dimension of the dataset.
aggregate
dimension_type
groupby
init
mask
sample
select
sort
Parameter Definitions
- classmethod add_dimension(dataset, dimension, dim_pos, values, vdim)[source]#
Returns a copy of the data with the dimension values added.
- Parameters:
- dataset
Dataset The Dataset to add the dimension to
- dimension
Dimension The dimension to add
- dim_pos
int The position in the data to add it to
- valuesarray_like
The array of values to add
- vdimbool
Whether the data is a value dimension
- dataset
- Returns:
dataA copy of the data with the new dimension
- classmethod array(dataset, dimensions)[source]#
Returns the data as a numpy.ndarray containing the selected dimensions.
- Parameters:
- Returns:
np.ndarrayA Numpy ndarray containing the selected dimensions
- classmethod assign(dataset, new_data)[source]#
Adds a dictionary containing data for multiple new dimensions to a copy of the dataset.data.
- Parameters:
- dataset
Dataset The Dataset to add the dimension to
- new_data
dict Dictionary containing new data to add to the Dataset
- dataset
- Returns:
dataA copy of the data with the new data dimensions added
- 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 iloc(dataset, index)[source]#
Implements integer indexing on the rows and columns of the data.
- Parameters:
- Returns:
dataIndexed data
Notes
Only implement for tabular interfaces.
- classmethod reindex(dataset, kdims=None, vdims=None)[source]#
Reindexes data given new key and value dimensions.
- classmethod unpack_scalar(dataset, data)[source]#
Given a dataset object and data in the appropriate format for the interface, return a simple scalar.
- classmethod validate(dataset, vdims=True)[source]#
Validation runs after the Dataset has been constructed and should validate that the Dataset is correctly formed and contains all declared dimensions.
- classmethod values(dataset, dim, expanded=True, flat=True, compute=True, keep_index=False)[source]#
Returns the values along a dimension of the dataset.
- Parameters:
- dataset
Dataset The dataset to query
- dimension
strorDimension Dimension to return the values for
- expandedbool,
defaultTrue When false returns unique values along the dimension
- flatbool,
defaultTrue Whether to flatten the array
- computebool,
defaultTrue Whether to load lazy data into memory as a NumPy array
- keep_indexbool,
defaultFalse Whether to return the data with an index (if present)
- dataset
- Returns:
- array_like
Dimension values in the requested format
Notes
The expanded keyword has different behavior for gridded interfaces where it determines whether 1D coordinates are expanded into a multi-dimensional array.