Skip to content

Commit 5899ce2

Browse files
authored
Merge pull request #1678 from nikicc/continuous-metas-sorting
[FIX] OWTable: Sort Continuous metas as floats; not strings
2 parents e3c7b4f + 4f9931e commit 5899ce2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Orange/widgets/utils/itemmodels.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,9 @@ def columnSortKeyData(self, column, role):
10151015
and role == TableModel.ValueRole:
10161016
col_view, _ = self.source.get_column_view(coldesc.var)
10171017
col_data = numpy.asarray(col_view)
1018+
if coldesc.var.is_continuous:
1019+
# continuous from metas have dtype object; cast it to float
1020+
col_data = col_data.astype(float)
10181021
if self.__sortInd is not None:
10191022
col_data = col_data[self.__sortInd]
10201023
return col_data

0 commit comments

Comments
 (0)