Ray S wrote: > print N.diag(x) > > Works for me... > > I can then do: > >>> import numpy.core.multiarray as MA > >>> xBuf = MA.getbuffer(x) > >>> z = MA.frombuffer(xBuf).reshape((3,3)) >
I see this kind of importing used more often than it should be. It is dangerous to import directly from numpy.core and numpy.lib and even more dangerous to import directly from files in those sub-packages. The organization of the files may change suddenly in the future. The only guarantee is that the numpy name-space will not change suddenly. These namespaces are all incorporated in numpy. Thus, numpy.getbuffer numpy.frombuffer are the recommended ways to use this functionality. -Travis _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion