Ticket #1146 (closed bug: fixed)
Instance hashes and comparisons
|Reported by:||lanz||Owned by:||janez|
The documentations says that data instances compute hashes and can be used for keys in dictionaries etc.
First of all, the hashes are not very good:
>>> import Orange >>> brown = Orange.data.Table('brown-selected') >>> len(brown) 186 >>> len(set(hash(ins) for ins in brown)) 41
Secondly, instances with different domains can not be in the same dict, because there are a lot of collisions:
>>> len(set(hash(ins) for ins in brown).intersection(hash(ins) for ins in iris)) 30
And instances can not be compared:
>>> brown == iris Traceback (most recent call last): File "<stdin>", line 1, in <module> orange.KernelException: 'orange.Example': examples are from different domains
If it is possible to get a quick fix, could at least brown == iris return False instead of throwing an exception?
- Status changed from new to closed
- Resolution set to fixed