datetime64[ns] astype datetime64[s] #11022
Labels
Datetime
Datetime data dtype
Dtype Conversions
Unexpected or buggy dtype conversions
Duplicate Report
Duplicate issue or pull request
Hello all,
I'm trying to convert a
datetime64[ns]
object to a unix timestamp without anapply
.I was wondering if it was the desired behavior to throw an error when trying to do:
The error:
But if I only take the values and work on this numpy array:
The type is correctly changed and pandas reconvert it to a
datetime64[ns]
object.Could we control this behavior?
So I can convert my
datetime64[ns]
object into a unix timestamp like this:Second question why not have the same behavior for
pandas.Series
?The text was updated successfully, but these errors were encountered: