Skip to content

Commit bffe1ff

Browse files
committed
Computed stats for specified columns only.
1 parent b5ad055 commit bffe1ff

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

Orange/data/table.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,18 +1365,16 @@ def _compute_basic_stats(self, columns=None,
13651365
if len(rr):
13661366
stats = np.vstack(tuple(rr))
13671367
else:
1368-
columns = [self.domain.index(c) for c in columns]
13691368
nattrs = len(self.domain.attributes)
1370-
Xs = any(0 <= c < nattrs for c in columns) and fast_stats(self.X, W)
1371-
Ys = any(c >= nattrs for c in columns) and fast_stats(self._Y, W)
1372-
ms = any(c < 0 for c in columns) and fast_stats(self.metas, W)
13731369
for column in columns:
1374-
if 0 <= column < nattrs:
1375-
stats.append(Xs[column, :])
1376-
elif column >= nattrs:
1377-
stats.append(Ys[column - nattrs, :])
1370+
c = self.domain.index(column)
1371+
if 0 <= c < nattrs:
1372+
S = fast_stats(self.X[:, [c]], W and W[:, [c]])
1373+
elif c >= nattrs:
1374+
S = fast_stats(self._Y[:, [c-nattrs]], W and W[:, [c-nattrs]])
13781375
else:
1379-
stats.append(ms[-1 - column])
1376+
S = fast_stats(self.metas[:, [-1-c]], W and W[:, [-1-c]])
1377+
stats.append(S[0])
13801378
return stats
13811379

13821380
def _compute_distributions(self, columns=None):

0 commit comments

Comments
 (0)