From f76c5eeb61e012fc7b3f9a271edb3dc61be18615 Mon Sep 17 00:00:00 2001 From: jakakokosar Date: Tue, 12 Jan 2021 09:23:10 +0100 Subject: [PATCH] owkaplanmeier: fix missing values handling The previous solution did not work when dealing with meta attributes. --- orangecontrib/survival_analysis/widgets/owkaplanmeier.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/orangecontrib/survival_analysis/widgets/owkaplanmeier.py b/orangecontrib/survival_analysis/widgets/owkaplanmeier.py index e485277..b8d1623 100644 --- a/orangecontrib/survival_analysis/widgets/owkaplanmeier.py +++ b/orangecontrib/survival_analysis/widgets/owkaplanmeier.py @@ -482,8 +482,10 @@ def generate_plot_curves(self) -> List[EstimatedFunctionCurve]: filter_ = IsDefined(columns=[self.time_var, self.event_var]) # if undefined values are detected in time_var or event_var omit rows with undefined values - if self.data[:, [self.time_var]].has_missing() or self.data[:, [self.event_var]].has_missing(): - self._data = filter_(self.data) + self._data = filter_(self.data) + if len(self.data) == len(self._data): + self._data = None + else: self.Warning.missing_values() data = self.data if self._data is None else self._data