Orange Forum • View topic - ExampleTable (.tab format) Load Error

ExampleTable (.tab format) Load Error

Report bugs (or imagined bugs).
(Archived/read-only, please use our ticketing system for reporting bugs and their discussion.)
Forum rules
Archived/read-only, please use our ticketing system for reporting bugs and their discussion.

ExampleTable (.tab format) Load Error

Postby Feanor76 » Wed Jun 06, 2007 20:43

Hi folks,

Using the file:

>>> import orange
>>> e = orange.ExampleTable("")
>>> e[0]
[14.23, 1.71, 2.43, 15.6, 127, 2.80, 3.06, 0, 2.29, 5.640000,
1.04, 3.92, 1065, '1']

From the file itself:
1 14.23 1.71 2.43 15.6 127 2.8 3.06 .28
2.29 5.64 1.04 3.92 1065

The problem is the 8th attribute. In the ExampleTable it is 0 (zero); in the file it is .28.

e.domain["a8"] has the right type:
>>> e.domain["a8"]
FloatVariable 'a8'

I think the problem is that float numbers are expected to be of the form [0-9]+.[0-9]+ .... that is, one or more digits on either side of the decimal. Whereas in the file ... they are [0-9]*.[0-9]+ (i.e., you can zero characters to the left of the decimal point).


Postby Janez » Sun Jul 08, 2007 15:40

Mark, thanks.

I was trickier than this. The number was read correctly (sscanf...), but Orange counts the number of decimals to show when it displays the attribute value. There was a bug in the counting, so the numbers were printed out with zero decimals.


Postby Janez » Sun Jul 08, 2007 19:57

Oops, I cannot commit the code yet because I did some other big and risky changes without making a branch. Since your bug is not critical (everything computes right...), the fix will have to wait for a few more days before coming to the CVS.


Return to Bugs