Skip to content

Commit 2b4b818

Browse files
Table.__str__: Take the limit parameter into account
1 parent b197077 commit 2b4b818

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Orange/data/table.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,15 @@ def sp_values(matrix, variables):
123123
_, columns = matrix.shape
124124

125125
row_entries, idx = [], 0
126-
while len(row_entries) < 5 and idx < len(variables):
126+
while idx < len(variables):
127+
# Make sure to stop printing variables if we limit the output
128+
if limit and len(row_entries) >= 5:
129+
break
130+
127131
var = variables[idx]
128132
if var.is_discrete or matrix[row, idx]:
129133
row_entries.append("%s=%s" % (var.name, var.str_val(matrix[row, idx])))
134+
130135
idx += 1
131136

132137
s = ", ".join(row_entries)

0 commit comments

Comments
 (0)