I\'m dong some unit testing and I need to make sure a function always returns a np.datetime64-like object. However, they can be of any unit (year, day, nanosecond, etc).
You can use issubdtype:
np.issubdtype(comp.dtype, np.datetime64)