Closed
Description
In [7]: pd.Timedelta(1, unit='Y')
Out[7]: Timedelta('365 days 05:49:12')
In [8]: pd.Timedelta(1, unit='M')
Out[8]: Timedelta('30 days 10:29:06')
The above does not make much sense, so lets deprecate this (similar for to_timedelta
).
For the case where those unit abbreviations are used in a string, Y
already raises, while M
is actually interpreted as minutes:
ValueError: invalid abbreviation: Y
In [13]: pd.to_timedelta('1M')
Out[13]: Timedelta('0 days 00:01:00')