Orange Forum • View topic - How to create data object without a file

How to create data object without a file

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

How to create data object without a file

Postby jxu » Thu Apr 11, 2013 5:45

Is there any way to create the data object NOT from Orange.data.Table() ? I think there should be some where to directly set values and attributes, but don't know how. thanks.

Re: How to create data object without a file

Postby Ales » Fri Apr 12, 2013 9:53

Code: Select all
import Orange
domain = Orange.data.Domain([Orange.feature.Discrete("A", values=["a", "b"]), Orange.feature.Continuous("B")], None)
table = Orange.data.Table(domain, [["a", 1.0], ["b", 2.0]])
print table[0]

See the full documentation for Orange.data.Table.


Return to Questions & Support