#4 Constructing a dataset from a Numeric array doesnt work

open-fixed
nobody
None
5
2005-05-19
2005-05-18
Anonymous
No

i just updated to PyML 0.6.2 and it appears the
following code doesnt work anymore :

m = numarray.random_array.random( ( 10, 20 ) )
d2 = PyML.datafunc.SparseCDataSet( X = m )

i get :

Traceback (most recent call last):
File "tmp.py", line 33, in ?
d2 = PyML.datafunc.SparseCDataSet( X = m )
File
"/home/jess/progs/lib/python2.4/site-packages/PyML/datafunc.py",
line 616, in __init__
L, patternID = self.fromArray(**args)
File
"/home/jess/progs/lib/python2.4/site-packages/PyML/datafunc.py",
line 654, in fromArray
patternID = [str(i) for i in range(1, len(self) + 1)]
File
"/home/jess/progs/lib/python2.4/site-packages/PyML/datafunc.py",
line 1087, in __len__
return self.size()
File
"/home/jess/progs/lib/python2.4/site-packages/PyML/ext/cdataset.py",
line 247, in size
def size(*args): return
_cdataset.SparseDataSet_size(*args)
TypeError: Expected a pointer

Discussion

  • abh
    abh
    2005-05-19

    • status: open --> open-fixed