In article <ytz8wlqgncf....@burgos.aip.de>, Ole Streicher <ole-usenet...@gmx.net> wrote: > >I am trying to initialize a class inherited from numpy.ndarray: > >from numpy import ndarray > >class da(ndarray): > def __init__(self, mydata): > ndarray.__init__(self, 0) > self.mydata = mydata > >When I now call the constructor of da: >da(range(100)) > >I get the message: > >ValueError: sequence too large; must be smaller than 32 > >which I do not understand. This message is generated by the constructor >of ndarray, but the ndarray constructor (ndarray.__init__()) has only >"0" as argument, and calling "ndarray(0)" directly works perfect.
Did you read the docs? According to http://docs.scipy.org/numpy/docs/numpy.ndarray/#numpy-ndarray the first argument to an ndarray constructor is the shape, and I suppose arrays might be limited to 32 dimensions. Anyway, I suggest that you subscribe to one of the NumPy mailing lists and ask there: http://scipy.org/Mailing_Lists -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." --Red Adair -- http://mail.python.org/mailman/listinfo/python-list