Skip to content

Commit ff88b30

Browse files
Also catch month and year timedelta variations without a space
1 parent 1f03242 commit ff88b30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/tools/timedeltas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def to_timedelta(arg, unit=None, errors="raise"):
127127
raise ValueError(
128128
"unit must not be specified if the input is/contains a str"
129129
)
130-
elif arg.upper().endswith(" M") or arg.upper().endswith(" Y"):
130+
elif arg.upper().endswith("M") or arg.upper().endswith("Y"):
131131
warnings.warn(
132132
"Denoting units with 'M', 'Y', 'm' or 'y' do not represent unambiguous "
133133
"timedelta values durations and will removed in a future version",

0 commit comments

Comments
 (0)