Skip to content

Commit

Permalink
Table: check for missing X only if not sparse
Browse files Browse the repository at this point in the history
Missing entries in sparse are considered to be 0.
  • Loading branch information
nikicc committed Jul 1, 2016
1 parent be46877 commit 4f698ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Orange/data/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,8 @@ def total_weight(self):

def has_missing(self):
"""Return `True` if there are any missing attribute or class values."""
return bn.anynan(self.X) or bn.anynan(self._Y)
missing_x = not sp.issparse(self.X) and bn.anynan(self.X) # do not check for sparse X
return missing_x or bn.anynan(self._Y)

def has_missing_class(self):
"""Return `True` if there are any missing class values."""
Expand Down

0 comments on commit 4f698ee

Please sign in to comment.