opatio.index.floatvectorindex module¶
- class opatio.index.floatvectorindex.FloatVectorIndex(vector: Tuple[float, ...], hashPrecision: int)[source]¶
Bases:
object
Represents an index for a float vector with hashing and serialization capabilities.
- Parameters:
- copy() FloatVectorIndex [source]¶
Create a copy of the float vector index.
Examples
>>> index = FloatVectorIndex((1.12345, 2.6789), hashPrecision=3) >>> hash(index) 1234567890123456789 >>> bytes(index) b'...' >>> len(index) 2 >>> index[0] 1.123
- copy() FloatVectorIndex [source]¶
Create a copy of the float vector index.
- Returns:
A new instance of FloatVectorIndex with the same values.
- Return type:
Examples
>>> index = FloatVectorIndex((1.12345, 2.6789), hashPrecision=3) >>> index_copy = index.copy() >>> index_copy.vector (1.12345, 2.6789)