From 5cf9864513557de3701cdfcecade0a01dd51e1aa Mon Sep 17 00:00:00 2001 From: Johannes Hentschel Date: Thu, 19 Oct 2023 22:02:53 +0200 Subject: [PATCH] ignores the FutureWarning issued due to pandas 2.1.0 malfunction --- src/ms3/annotations.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ms3/annotations.py b/src/ms3/annotations.py index 6e57ec3f..07120d05 100644 --- a/src/ms3/annotations.py +++ b/src/ms3/annotations.py @@ -528,13 +528,12 @@ def expand_dcml( # Setting values in-place is fine, ignore the warning in Pandas >= 1.5.0 # This can be removed, if Pandas 1.5.0 does not need to be supported any longer. # See also: https://stackoverflow.com/q/74057367/859591 + # addition: pandas 2.1.0 throws "FutureWarning: Setting an item of incompatible dtype is + # deprecated and will raise in a future error of pandas." because all new columns are interpreted + # seem to default to dtype float64. warnings.filterwarnings( "ignore", category=FutureWarning, - message=( - ".*will attempt to set the values inplace instead of always setting a new array. " - "To retain the old behavior, use either.*" - ), ) df.loc[select_dcml, exp.columns] = exp df.loc[:, key_cols] = df[key_cols].ffill()