holoviews.core.data.ibis module#
- class holoviews.core.data.ibis.IbisInterface(*, name)[source]#
Bases:
InterfaceMethods
add_dimension(dataset, dimension, dim_pos, ...)Returns a copy of the data with the dimension values added.
applies(obj)Indicates whether the interface is designed specifically to handle the supplied object's type.
assign(dataset, new_data)Adds a dictionary containing data for multiple new dimensions to a copy of the dataset.data.
compute(dataset)Converts a lazy Dataset to a non-lazy, in-memory format.
has_rowid()histogram(expr, bins[, density, weights])Computes the histogram on the dimension values with support for specific bins, normalization and weighting.
iloc(dataset, index)Implements integer indexing on the rows and columns of the data.
loaded()Indicates whether the required dependencies are loaded.
persist(dataset)Persists the data backing the Dataset in memory.
redim(dataset, dimensions)Renames dimensions in the data.
reindex(dataset[, kdims, vdims])Reindexes data given new key and value dimensions.
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.
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.
aggregate
dframe
dimension_type
dtype
groupby
init
is_rowid_zero_indexed
isscalar
length
mask
nonzero
range
sample
select
shape
sort
values
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 applies(obj)[source]#
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 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 compute(dataset)[source]#
Converts a lazy Dataset to a non-lazy, in-memory format.
- Parameters:
- dataset
Dataset The dataset to compute
- dataset
- Returns:
DatasetDataset with non-lazy data
Notes
This is a no-op if the data is already non-lazy.
- classmethod dframe(*args, **kwargs)[source]#
Returns the data as a pandas.DataFrame containing the selected dimensions.
- classmethod dtype(*args, **kwargs)[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 histogram(expr, bins, density=True, weights=None)[source]#
Computes the histogram on the dimension values with support for specific bins, normalization and weighting.
- Parameters:
- arrayarray_like
In memory representation of the dimension values
- bins
np.ndarray|int An array of bins or the number of bins
- densitybool,
defaultTrue Whether to normalize the histogram
- weightsarray_like,
optional In memory representation of the weighting
- Returns:
tuple[np.ndarray,np.ndarray]Tuple of (histogram values, bin edges)
Notes
Usually the dimension_values and weights are assumed to be arrays but each interface should support data stored in whatever format it uses to store dimensions internally.
- 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 length(*args, **kwargs)[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 nonzero(*args, **kwargs)[source]#
Returns a boolean indicating whether the Dataset contains any data.
- Parameters:
- dataset
Dataset The dataset to check
- dataset
- Returns:
- bool
Whether the dataset is not empty
- classmethod persist(dataset)[source]#
Persists the data backing the Dataset in memory.
- Parameters:
- dataset
Dataset The dataset to persist
- dataset
- Returns:
DatasetDataset with the data persisted to memory
Notes
This is a no-op if the data is already in memory.
- classmethod range(*args, **kwargs)[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 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.
- 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(*args, **kwargs)[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.