From d10dac35277705af8e79df0d83579a74868c9f66 Mon Sep 17 00:00:00 2001 From: Michele Peresano Date: Thu, 15 Apr 2021 11:54:45 +0200 Subject: [PATCH] Check if label is explicitly None because it can be also 0 --- protopipe/mva/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protopipe/mva/utils.py b/protopipe/mva/utils.py index 8b79d41e..bd20ef93 100644 --- a/protopipe/mva/utils.py +++ b/protopipe/mva/utils.py @@ -44,7 +44,7 @@ def prepare_data(ds, derived_features, cuts, select_data=True, label=None): # This is always useful ds["log10_true_energy"] = np.log10(ds["true_energy"]) - if label: # only for classification + if label is not None: # only for classification ds["label"] = np.full(len(ds), label) # This is needed because our reference analysis uses energy as