From 44823cb3461d6e42f961664e12e7b67c20312518 Mon Sep 17 00:00:00 2001 From: Philip Cook Date: Sun, 1 Dec 2024 21:17:47 -0500 Subject: [PATCH] ENH: Prevent pandas type conversion warning --- ants/label/label_overlap_measures.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ants/label/label_overlap_measures.py b/ants/label/label_overlap_measures.py index 815c4fc0..4b7e7280 100644 --- a/ants/label/label_overlap_measures.py +++ b/ants/label/label_overlap_measures.py @@ -40,5 +40,7 @@ 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) + # Set Label column to object type as it can contain strings + df['Label'] = df['Label'].astype(object) df.loc[0, 'Label'] = 'All' return df