Is it possible to convert something like this;
array([datetime.datetime(2014, 2, 1, 0, 0, 0, 100000),
datetime.datetime(2014, 2, 1, 0, 0, 0, 300000),
datetime.datetime(2014, 2, 1, 0, 0, 0, 500000), ...,
datetime.datetime(2014, 2, 1, 19, 30, 0, 500000),
datetime.datetime(2014, 2, 1, 19, 30, 0, 700000),
datetime.datetime(2014, 2, 1, 19, 30, 0, 900000)], dtype=object)
to this:
array([ 1.39277301e+09, 1.39277301e+09, 1.39277301e+09, ...,
1.39285442e+09, 1.39285442e+09, 1.39285442e+09])
I would basically like to convert the datetime.datetime
into a timestamp
, with dtype = float
.
question from:
https://stackoverflow.com/questions/65933913/convert-date-to-float-in-numpy