Index¶
Handle for an index attached to a NDArray.
Index objects are returned by NDArray indexing APIs such as
blosc2.NDArray.create_index(), blosc2.NDArray.index(), and
blosc2.NDArray.indexes. Use this handle to inspect index metadata and
storage usage, or to drop, rebuild, and compact the index. Users normally do
not instantiate Index directly.
For table indexes, blosc2.ctable.CTableIndex plays the same
user-facing role for CTable objects. It is documented in the
CTable reference because table indexes can target columns and table
expressions.
- class blosc2.Index(array: NDArray, token: str)[source]¶
Handle for an index attached to an
blosc2.NDArray.Indexobjects are returned by NDArray indexing helpers such asblosc2.NDArray.create_index(),blosc2.NDArray.index(), andblosc2.NDArray.indexes. They expose descriptor metadata and convenience methods for dropping, rebuilding, or compacting the underlying index.blosc2.ctable.CTableIndexplays the same user-facing role forblosc2.CTableindexes. Users should not instantiate either class directly.- Attributes:
cbytesTotal compressed size in bytes for this index payload.
cratioCompression ratio for this index payload.
descriptorCopy of the index descriptor dictionary.
fieldStructured-array field indexed by this handle, if any.
kindKind of index, as an
blosc2.IndexKind.nameOptional human-readable name assigned at creation time.
nbytesTotal uncompressed size in bytes for this index payload.
persistentTrue when index sidecars are stored persistently on disk.
staleTrue if the index needs rebuilding before it can be reused.
targetDescriptor of the indexed target.
Methods
- Index.descriptor¶
Copy of the index descriptor dictionary.
- Index.kind¶
Kind of index, as an
blosc2.IndexKind.
- Index.field¶
Structured-array field indexed by this handle, if any.
- Index.name¶
Optional human-readable name assigned at creation time.
- Index.target¶
Descriptor of the indexed target.
- Index.persistent¶
True when index sidecars are stored persistently on disk.
- Index.stale¶
True if the index needs rebuilding before it can be reused.
- Index.nbytes¶
Total uncompressed size in bytes for this index payload.
- Index.cbytes¶
Total compressed size in bytes for this index payload.
- Index.cratio¶
Compression ratio for this index payload.