diff --git a/Orange/widgets/data/owfeatureconstructor.py b/Orange/widgets/data/owfeatureconstructor.py index cf745a13979..1469686ab5c 100644 --- a/Orange/widgets/data/owfeatureconstructor.py +++ b/Orange/widgets/data/owfeatureconstructor.py @@ -733,11 +733,14 @@ def duplicateFeature(self): @staticmethod def check_attrs_values(attr, data): - for i in range(len(data)): - for var in attr: - if not math.isnan(data[i, var]) \ - and int(data[i, var]) >= len(var.values): - return var.name + for var in attr: + col, _ = data.get_column_view(var) + mask = np.isnan(col) + mask = np.greater_equal( + col, len(var.values), out=mask, where=~mask + ) + if mask.any(): + return var.name return None def _validate_descriptors(self, desc):