- API reference
- pandas arrays, scalars, and data types
- pandas.api.t...
pandas.api.types.is_timedelta64_ns_dtype#
- pandas.api.types.is_timedelta64_ns_dtype(arr_or_dtype)[source]#
Check whether the provided array or dtype is of the timedelta64[ns] dtype.
This is a very specific dtype, so generic ones likenp.timedelta64will return False if passed into this function.
- Parameters:
- arr_or_dtypearray-like or dtype
The array or dtype to check.
- Returns:
- boolean
Whether or not the array or dtype is of the timedelta64[ns] dtype.
Examples
>>>frompandas.core.dtypes.commonimportis_timedelta64_ns_dtype>>>is_timedelta64_ns_dtype(np.dtype('m8[ns]'))True>>>is_timedelta64_ns_dtype(np.dtype('m8[ps]'))# Wrong frequencyFalse>>>is_timedelta64_ns_dtype(np.array([1,2],dtype='m8[ns]'))True>>>is_timedelta64_ns_dtype(np.array([1,2],dtype=np.timedelta64))False
On this page