Vector¶
The Vector type represents a collection of elements of a specific type. All elements in a vector must be of the same type. Otherwise - it becomes a List.
Usage¶
>>> from rayforce import Vector, I64, Symbol
>>> int_vector = Vector(ray_type=I64, length=3)
>>> int_vector
Vector(5) # 5 represents a type code of I64
>>> symbol_vector = Vector(ray_type=Symbol, items=["apple", "banana", "cherry"])
>>> symbol_vector
Vector(5) # 6 represents a type code of Symbol
>>> timestamp_vector = Vector(
ray_type=Timestamp,
items=[
"2025-05-10T14:30:45+00:00",
"2025-05-10T14:30:45+00:00",
"2025-05-10T14:30:45+00:00",
]
)
Accessing the values¶
>>> [i for i in int_vector]
[I64(0), I64(0), I64(0), I64(0), I64(0)]
>>> [i for i in symbol_vector]
[Symbol('apple'), Symbol('banana'), Symbol('cherry')]