From 2e6c519cd31a86b51bf9dad3172b2a40bab217ac Mon Sep 17 00:00:00 2001 From: "Martin K. Scherer" Date: Tue, 12 Mar 2024 08:55:33 +0100 Subject: [PATCH] Update weldx/tags/time/timedeltaindex.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Çağtay Fabry --- weldx/tags/time/timedeltaindex.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/weldx/tags/time/timedeltaindex.py b/weldx/tags/time/timedeltaindex.py index 72b2467f6..b0aeac6eb 100644 --- a/weldx/tags/time/timedeltaindex.py +++ b/weldx/tags/time/timedeltaindex.py @@ -13,9 +13,8 @@ def _handle_converted_pd_tdi_units(node: TaggedDict): """Convert changed units in Pandas.Datetimeindex to valid values.""" - unit = node["freq"][-1] - if unit in PANDAS_OLD_UNIT_SUFFIXES.keys(): - node["freq"] = node["freq"][:-1] + PANDAS_OLD_UNIT_SUFFIXES[unit] + for suf in PANDAS_OLD_UNIT_SUFFIXES: + node["freq"] = node["freq"].replace(suf, PANDAS_OLD_UNIT_SUFFIXES[suf]) class TimedeltaIndexConverter(WeldxConverter):