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 wine.tab file:

>>> import orange
>>> e = orange.ExampleTable("wine.tab")
>>> 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 wine.tab file ... they are [0-9]*.[0-9]+ (i.e., you can zero characters to the left of the decimal point).

Regards,
Mark

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.

Janez

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.

Janez


Return to Bugs



cron