Skip to content

Commit 3e247fa

Browse files
authored
Timedeltas: Understand µs (#32899)
1 parent 650ef90 commit 3e247fa

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

Diff for: doc/source/whatsnew/v1.1.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ Timedelta
260260

261261
- Bug in constructing a :class:`Timedelta` with a high precision integer that would round the :class:`Timedelta` components (:issue:`31354`)
262262
- Bug in dividing ``np.nan`` or ``None`` by :class:`Timedelta`` incorrectly returning ``NaT`` (:issue:`31869`)
263-
-
263+
- Timedeltas now understand ``µs`` as identifier for microsecond (:issue:`32899`)
264264

265265
Timezones
266266
^^^^^^^^^

Diff for: pandas/_libs/tslibs/timedeltas.pyx

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ cdef dict timedelta_abbrevs = {
8282
"us": "us",
8383
"microseconds": "us",
8484
"microsecond": "us",
85+
"µs": "us",
8586
"micro": "us",
8687
"micros": "us",
8788
"u": "us",

Diff for: pandas/tests/scalar/timedelta/test_constructors.py

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def test_construction():
5151
assert Timedelta("1 milli") == timedelta(milliseconds=1)
5252
assert Timedelta("1 millisecond") == timedelta(milliseconds=1)
5353
assert Timedelta("1 us") == timedelta(microseconds=1)
54+
assert Timedelta("1 µs") == timedelta(microseconds=1)
5455
assert Timedelta("1 micros") == timedelta(microseconds=1)
5556
assert Timedelta("1 microsecond") == timedelta(microseconds=1)
5657
assert Timedelta("1.5 microsecond") == Timedelta("00:00:00.000001500")

0 commit comments

Comments
 (0)