[SciPy-dev] TypeError: __array_data__ must return a string providing the pointer to data

Nils Wagner nwagner at mecha.uni-stuttgart.de
Fri Oct 21 02:13:11 CDT 2005


Python 2.4 (#2, May 12 2005, 14:45:33)
[GCC 3.3.3 (SuSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from MLab import *
>>> A = rand(3,3)
>>> A
array([[ 0.9462472 ,  0.30814099,  0.65772529],
       [ 0.29040523,  0.58193587,  0.25232399],
       [ 0.8339496 ,  0.36152322,  0.58090246]])
>>> triu(A)
array([[ 0.9462472 ,  0.30814099,  0.65772529],
       [ 0.        ,  0.58193587,  0.25232399],
       [ 0.        ,  0.        ,  0.58090246]])
>>> tril(A)
array([[ 0.9462472 ,  0.        ,  0.        ],
       [ 0.29040523,  0.58193587,  0.        ],
       [ 0.8339496 ,  0.36152322,  0.58090246]])
>>> from scipy import *
Importing io to scipy
Importing special to scipy
Importing sparse to scipy
Importing utils to scipy
Importing interpolate to scipy
Importing optimize to scipy
Importing linalg to scipy
>>> triu(A)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File
"/usr/local/lib/python2.4/site-packages/scipy/base/twodim_base.py", line
103, in triu
    m = asarray(m)
  File "/usr/local/lib/python2.4/site-packages/scipy/base/numeric.py",
line 36, in asarray
    return array(a, dtype, copy=0, fortran=fortran)
TypeError: __array_data__ must return a string providing the pointer to
data.




More information about the Scipy-dev mailing list