import pandas as pd
from datetime import datetime
pd.datetools.thisYearBegin(datetime(2015,2,1))
This returns Timestamp('2016-01-01 00:00:00'), but should return 2015-01-01. Should thisYearBegin() just be removed? I don't think it's documented.
Comment From: jreback
These are just offset additions.
In [2]: Timestamp('20150101') + pd.offsets.YearBegin(0)
Out[2]: Timestamp('2015-01-01 00:00:00')
In [3]: Timestamp('20150102') + pd.offsets.YearBegin(0)
Out[3]: Timestamp('2016-01-01 00:00:00')
Comment From: craustin
Okay- I guess the "this" in the name confused me. Calling "thisYearBegin()" seems like it should return the first day of the given year.
On Feb 17, 2015, at 19:34, jreback notifications@github.com wrote:
These are just offset additions.
In [2]: Timestamp('20150101') + pd.offsets.YearBegin(0) Out[2]: Timestamp('2015-01-01 00:00:00')
In [3]: Timestamp('20150102') + pd.offsets.YearBegin(0) Out[3]: Timestamp('2016-01-01 00:00:00') — Reply to this email directly or view it on GitHub.
Comment From: jreback
this entire core.datetools
is just an API helper. E.g. is really just provides other names for some offset functions, IMHO just pollluting namespace (though it is separate, and i guess that was the point).
So. I think it would be straightforward to simplify this entire module, basically dumping everything except for the imports. I think you can incorporate _resolve_offset
somewhere else (I think it is for back-compat).
All of the current things like thisYearBegin
I think we can simply deprecate (then remove in a later version). Can you see what would break if you do this?
I know several tests use this module, but they should be changed as well.
Comment From: jorisvandenbossche
datetools
is in the meantime deprecated (https://github.com/pandas-dev/pandas/pull/14105), including thisYearBegin
, so closing this.