-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Week ('W') does not work as suffixes for a string passed to Timedelta. #12691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
note that |
Given that we think of deprecating those units (see #14024), I think this can be closed (no need to fix this) |
Since we will fully deprecate/remove 'Y' and 'M' (for month) as allowed units, renamed this issue for the remaining issue with 'W' (this can be allowed). |
@jreback ive been looking at this for unrelated reasons: where do these come from? (T for minutes, L for milli, ...) |
I initially posted this on #12136, as I intended to fix it with the same patch, but I think it deserves its own issue as my initial idea for a fix may in fact change the behaviour for strings suffixed by capital
M
. Previously, those would be interpreted as minutes because of theunit.lower()
in https://github.com/pydata/pandas/blob/master/pandas/tslib.pyx#L2820Apparently,
timedelta_from_spec()
doesn't recognize all the abbreviations that are allowed in theunit
parameter. Consider for example:while
Same goes for Week.
Month is slightly trickier. As noted above, we have this inconsistency that we might want to do something about:
The text was updated successfully, but these errors were encountered: