Ticket #1148 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

Cannot create data.Table from MaskedArray

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

Description

import Orange
import numpy as np
c = Orange.feature.Continuous
Orange.data.Table(Orange.data.Domain([c("a1"), c("a2"), c("a3")]), np.ma.zeros((1,3)))

fails, while

import Orange
import numpy as np
c = Orange.feature.Continuous
Orange.data.Table(Orange.data.Domain([c("a1"), c("a2"), c("a3")]), np.zeros((1,3)))

works.

Change History

comment:1 Changed 2 years ago by janez

I fixed it and tried on two simple cases. Please check and close the ticket if OK.

comment:2 Changed 2 years ago by lanz

I now get a seg fault with Anze's above example...

(before it was TypeError: invalid arguments)

comment:3 Changed 2 years ago by janez

Oops, you're right, me too. (The problem with Anze's example is that it's a masked array without a mask.)

comment:4 Changed 2 years ago by janez

It should work now. Masked arrays in numpy < 1.7 suck.

comment:5 Changed 2 years ago by anze

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

Fixed in 4ea62a7a1910.

Note: See TracTickets for help on using tickets.