pandas.Timestamp.to_numpy#
- Timestamp.to_numpy(dtype=None, copy=False)#
Convert the Timestamp to a NumPy datetime64.
This is an alias method for Timestamp.to_datetime64(). The dtype and copy parameters are available here only for compatibility. Their values will not affect the return value.
- Parameters:
- dtypedtype, optional
Data type of the output, ignored in this method as the return type is always numpy.datetime64.
- copybool, default False
Whether to ensure that the returned value is a new object. This parameter is also ignored as the method does not support copying.
- Returns:
- numpy.datetime64
See also
DatetimeIndex.to_numpy
Similar method for DatetimeIndex.
Examples
>>> ts = pd.Timestamp('2020-03-14T15:32:52.192548651') >>> ts.to_numpy() numpy.datetime64('2020-03-14T15:32:52.192548651')
Analogous for
pd.NaT
:>>> pd.NaT.to_numpy() numpy.datetime64('NaT')