Currently times are represented by datetime.datetime objects; while parsing string representations of times is done with the library dateutil. However Pandas converts datetime.datetime to pd.Timestamp, and represents times internally as integers. Furthermore pd.Timestamp can automatically and comfortably parse string representations of times.
Therefore port all date computations to pd.Timestamp.
Empty series should be filled with NaN or numpy.datetime64('NaT'), not with None.
Currently times are represented by
datetime.datetime
objects; while parsing string representations of times is done with the librarydateutil
. However Pandas convertsdatetime.datetime
topd.Timestamp
, and represents times internally as integers. Furthermorepd.Timestamp
can automatically and comfortably parse string representations of times.Therefore port all date computations to
pd.Timestamp
.Empty series should be filled with
NaN
ornumpy.datetime64('NaT')
, not with None.http://pandas.pydata.org/pandas-docs/dev/missing_data.html#datetimes
http://docs.scipy.org/doc/numpy-dev/reference/arrays.datetime.html
and discussion at end:
https://github.com/pydata/pandas/issues/3593#issuecomment-17850876