xdas.coordinates.DenseCoordinate#
- class xdas.coordinates.DenseCoordinate(data=None, dim=None, dtype=None)[source]#
Coordinate backed by an explicit numpy array.
Suitable for irregularly-spaced or small axes where every value must be stored. Look-up is performed via a
pandas.Index.- Parameters:
data (array-like or None, optional) – 1-D array of coordinate values.
Nonecreates an empty coordinate.dim (str, optional) – Dimension name.
dtype (dtype-like, optional) – Cast data to this dtype on construction.
- __init__(data=None, dim=None, dtype=None)[source]#
Initialise the coordinate from subclass-specific data.
Methods
__init__([data, dim, dtype])Initialise the coordinate from subclass-specific data.
copy([deep])Return a copy of this coordinate.
equals(other)Return
Trueif other is the same coordinate type with identical dim and data.from_block(start, size, step[, dim, dtype])Construct a coordinate from a start value, element count, and step size.
get_div_points([tolerance])Return sorted split-point indices where consecutive differences exceed tolerance.
get_sampling_interval([cast])Return the average sample spacing (end-to-end distance divided by N-1).
isdim()Return
Trueif this coordinate is a dimensional coordinate.isscalar()Return
Trueif this is aScalarCoordinate.to_dataarray()Convert this coordinate to a
DataArraywith a single dimension.to_index(item[, method, endpoint])Convert a label-based selector to an integer index or slice.
Attributes
dimName of the dimension this coordinate is associated with, or
None.dtypeNumPy dtype of the underlying coordinate values.
emptyTrueif the coordinate has zero length.endValue at the last element.
A
pandas.Indexview of the underlying data array.indicesInteger array
[0, 1, ..., len(self) - 1].nameThe name under which this coordinate is stored in its parent container.
ndimNumber of dimensions (always 1 for dimensional coordinates).
parentThe parent
Coordinatescontainer, orNoneif unattached.shapeShape tuple
(len(self),).sizeNumber of elements along this coordinate's axis.
startValue at index 0 (first element).
valuesMaterialised numpy array of coordinate values.