Ticket #1145 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

Cannot create data.Table with class_vars by passing instances to constructor.

Reported by: anze Owned by: janez
Milestone: 2.5 Component: library
Severity: minor Keywords:
Cc: Blocking:
Blocked By:

Description

When creating data.Table with class_vars using (domain, instances) constructor, the following error is raised:

IndexError: invalid list size (4 items expected) (at example 0)

Code to reproduce:

import Orange
c = Orange.feature.Continuous
domain = Orange.data.Domain([c("a1"), c("a2"), c("a3")], c("a4"), class_vars=[c("a5"), c("a6")])
table = Orange.data.Table(domain, [[0.]* 6])

Change History

comment:1 Changed 2 years ago by Janez Demšar <janez.demsar@…>

  • Status changed from new to closed
  • Resolution set to fixed

In [5ea62b7b37bc467f6793f91aec535afc17e2dbce/orange]:

Fixed conversion of Examples from lists and of ExampleTables from numpy arrays to work for domains with multiple classes (fixes #1145)

Note: See TracTickets for help on using tickets.