bundles / numpy 2.4.4 / numpy / datetime_data
built-in
numpy:datetime_data
Signature
built-in
datetime_data ( dtype , / ) Summary
Get information about the step size of a date or time type.
Extended Summary
The returned tuple can be passed as the second argument of numpy.datetime64 and numpy.timedelta64.
Parameters
dtype: dtypeThe dtype object, which must be a
datetime64ortimedelta64type.
Returns
unit: strThe
datetime unit <arrays.dtypes.dateunits>on which this dtype is based.count: intThe number of base units in a step.
Examples
import numpy as np dt_25s = np.dtype('timedelta64[25s]') np.datetime_data(dt_25s) np.array(10, dt_25s).astype('timedelta64[s]')✓
np.datetime64('2010', np.datetime_data(dt_25s))
✓Aliases
-
numpy.datetime_data