Index#

class gwpy.types.Index(
value: astropy.units.Quantity | ArrayLike,
unit=None,
dtype=<class 'numpy.inexact'>,
copy=True,
order=None,
subok=False,
ndmin=0,
)[source]#

Bases: Quantity

1-D Quantity array for indexing a Series.

See also

astropy.units.Quantity

For parameters supported when creating an Index array.

Attributes Summary

regular

True if this index is linearly increasing.

Methods Summary

define(start, step, num[, dtype])

Define a new Index using numpy.arange.

is_regular()

Determine whether this Index contains linearly increasing samples.

Attributes Documentation

regular[source]#

True if this index is linearly increasing.

Methods Documentation

classmethod define(
start: float,
step: float,
num: int,
dtype: DTypeLike = None,
) Self[source]#

Define a new Index using numpy.arange.

The output is basically:

start + numpy.arange(num) * step
Parameters:
startNumber

The starting value of the index.

stepNumber

The step size of the index.

numint

The size of the index (number of samples).

dtypenumpy.dtype, None, optional

The desired dtype of the index, if not given, defaults to the higher-precision dtype from start and step.

Returns:
indexIndex

A new Index created from the given parameters.

is_regular() bool[source]#

Determine whether this Index contains linearly increasing samples.

This also works for linear decrease.