From e114676c64b6613cb067de8e74a55c12e6c6f0e9 Mon Sep 17 00:00:00 2001 From: stnava Date: Wed, 27 Nov 2024 15:21:29 -0500 Subject: [PATCH] PERF: fix type compatibility and style with accessing pandas dataframe --- ants/label/label_overlap_measures.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ants/label/label_overlap_measures.py b/ants/label/label_overlap_measures.py index c11658bd..4dbd9249 100644 --- a/ants/label/label_overlap_measures.py +++ b/ants/label/label_overlap_measures.py @@ -40,6 +40,5 @@ def label_overlap_measures(source_image, target_image): libfn = get_lib_fn("labelOverlapMeasures%iD" % source_image_int.dimension) df = libfn(source_image_int.pointer, target_image_int.pointer) df = pd.DataFrame(df) - with pd.option_context('mode.chained_assignment', None): - df.Label[0] = "All" + df.loc[0, 'Label'] = 'All'.astype(object) return df