Resampling returns a weird datatype m8 [ns]. But if you really need to convert, just use astype like you would for any other conversion: If in doubt, you may verify that the following statement returns.
Returned datatype depends on the. Numpy allows the subtraction of two datetime values, an operation which produces a number with a time unit. Because numpy doesn’t have a physical quantities system in its core, the.
Datetime64[ns] is a general dtype, while <m8[ns] is a specific dtype. Numpy arrays with datetime64[ns] can be seamlessly used within pandas dataframes. Both the datetime64[ns] and <m8[ns] data types can be compared and converted to other data types. General dtypes map to specific dtypes, but may be different from one installation of numpy to the next.
However, there are some differences in how these operations are. General dtypes map to specific dtypes, but may be different from one installation of numpy to the next. However, when i use unique() it gives me another datatype: Datetime64[ns] is a general dtype, while <m8[ns] is a specific dtype.
Pandas series with timestamps internally use the <m8[ns] representation.