nitypes.vector.Vector

class nitypes.vector.Vector(values: collections.abc.Iterable[TScalar], units: str = '', *, value_type: type[TScalar] | None = None)

Bases: collections.abc.MutableSequence[TScalar]

A sequence of scalar values with units information.

Constructing

To construct a vector data object, use the Vector class:

>>> Vector([False, True])
nitypes.vector.Vector(values=[False, True], units='')
>>> Vector([0, 1, 2])
nitypes.vector.Vector(values=[0, 1, 2], units='')
>>> Vector([5.0, 6.0], 'volts')
nitypes.vector.Vector(values=[5.0, 6.0], units='volts')
>>> Vector(["one", "two"], "volts")
nitypes.vector.Vector(values=['one', 'two'], units='volts')
__slots__ = ['_values', '_value_type', '_extended_properties']
property units: str

The unit of measurement, such as volts, of the vector.

Return type:

str

property extended_properties: nitypes.waveform.ExtendedPropertyDictionary

The extended properties for the vector.

Note

Data stored in the extended properties dictionary may not be encrypted when you send it over the network or write it to a TDMS file.

Return type:

nitypes.waveform.ExtendedPropertyDictionary

__getitem__(index: int) TScalar
__getitem__(index: slice) collections.abc.MutableSequence[TScalar]

Return the TimeDelta at the specified location.

__setitem__(index: int, value: TScalar) None
__setitem__(index: slice, value: collections.abc.Iterable[TScalar]) None

Set value(s) at the specified location.

__delitem__(index: int | slice) None

Delete item(s) from the specified location.

Parameters:

index (int | slice)

Return type:

None

__len__() int

Return the length of the Vector.

Return type:

int

insert(index: int, value: TScalar) None

Insert a value at the specified location.

Parameters:
  • index (int)

  • value (TScalar)

Return type:

None

__eq__(value: object, /) bool

Return self==value.

Parameters:

value (object)

Return type:

bool

__reduce__() tuple[Any, Ellipsis]

Return object state for pickling.

Return type:

tuple[Any, Ellipsis]

__repr__() str

Return repr(self).

Return type:

str

__str__() str

Return str(self).

Return type:

str

append(value)

S.append(value) – append value to the end of the sequence

clear()

S.clear() -> None – remove all items from S

reverse()

S.reverse() – reverse IN PLACE

extend(values)

S.extend(iterable) – extend sequence by appending elements from the iterable

pop(index=-1)

S.pop([index]) -> item – remove and return item at index (default last). Raise IndexError if list is empty or index is out of range.

remove(value)

S.remove(value) – remove first occurrence of value. Raise ValueError if the value is not present.

__iadd__(values)
__abc_tpflags__ = 32
__iter__()
__contains__(value)
__reversed__()
index(value, start=0, stop=None)

S.index(value, [start, [stop]]) -> integer – return first index of value. Raises ValueError if the value is not present.

Supporting start and stop arguments is optional, but recommended.

count(value)

S.count(value) -> integer – return number of occurrences of value

classmethod __subclasshook__(C)
__class_getitem__
Parameters: