Orange Forum • View topic - orange and numpy/Numeric arrays

orange and numpy/Numeric arrays

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

orange and numpy/Numeric arrays

Postby emanuele » Sun Apr 30, 2006 13:37

I usually handle numpy arrays and I'd like to feed orange with them (as datasets). I'm a newbie in orange but currently I've just seen orange-python example where datasets come from files (in specific formats). What can I do if I just have a numpy array computed on the fly as dataset? I know that orange uses Numeric library and maybe I can handle numpy->Numeric conversion... but then? Are there simple example out there to show how to solve these problems?

Thanks in advance,


Postby Janez » Tue May 23, 2006 0:07

Here it is.

Code: Select all
import orange, Numeric
d = orange.Domain([orange.FloatVariable('a%i' % x) for x in range(5)])
a = Numeric.array([[1, 2, 3, 4, 5], [5, 4, 3, 2, 1]])
t = orange.ExampleTable(a)

I kept postponing answering this question, thinking I'd have to program something. But it was in Orange all the time, it was just undocumented and forgotten.

Return to Questions & Support