Orange Forum • View topic - Create ExampleTable from numpy array

Create ExampleTable from numpy array

A place to ask questions about methods in Orange and how they are used and other general support.

Create ExampleTable from numpy array

Postby Sachiel » Thu Apr 15, 2010 12:50

Hi All,

I'm trying to create an ExampleTable from a numpy array, with the following code:

Code: Select all
dom = orange.Domain(map(orange.FloatVariable, columns))
table = orange.ExampleTable(dom, data)

columns -> Tuple of 10 elements
data -> numpy.ndarray, with shape (10, 711)

But I obtain the error:
Code: Select all
table = orange.ExampleTable(dom, data)
AttributeError: the number of columns in the array doesn't match the number of attributes

I've tried to transpose the data array (changing columns for rows), but the problem persists. What I am doing wrong?

Postby Ales » Fri Apr 16, 2010 9:24

I cant duplicate this problem.

Can you post the version of orange and python you are using?

Postby Sachiel » Fri Apr 16, 2010 12:19

Sorry for the disturbance, the shape I was stating was not true. I am working with record arrays, and when converting to "normal" arrays I didn't realize I missed some columns (I was monitoring the wrong variable).

Again, sorry for the "false bug" and thank you for the support.

Return to Questions & Support