Datetimes with numpy
Datetime support in core TileDB depends on the high-level APIs for each language to provide usability and interoperability with high-level datetime objects. On this page we demonstrate using the TileDB Python API, where np.datetime64
objects can be used directly.
The following example shows how to use np.datetime64
to create a 1D dense TileDB array with a domain of 10 years, at the day resolution.
Note the usage of np.timedelta64
to specify the tile extent of the vector.
Writing a range of values to the array is as expected:
The array can also be sliced using datetimes when reading:
TileDB internally stores datetimes asre int64
values. Therefore, slicing datetime dimensions in this case is just as efficient as other integer domain types.
Last updated