Converting Pandas DataFrame to Orange Table

后端 未结 7 1662
感动是毒
感动是毒 2020-12-08 17:18

I notice that this is an issue on GitHub already. Does anyone have any code that converts a Pandas DataFrame to an Orange Table?

Explicitly, I have the following tab

7条回答
  •  抹茶落季
    2020-12-08 17:39

    Something like this?

    table = Orange.data.Table(df.as_matrix())
    

    The columns in Orange will get generic names (a1, a2...). If you want to copy the names and the types from the data frame, construct Orange.data.Domain object (http://docs.orange.biolab.si/reference/rst/Orange.data.domain.html#Orange.data.Domain.init) from the data frame and pass it as the first argument above.

    See the constructors in http://docs.orange.biolab.si/reference/rst/Orange.data.table.html.

提交回复
热议问题