Mattia Ziulu wrote: > <[email protected] <mailto:[email protected]>> wrote: > 2) NumPy NumPy NumPy! Doing this without using NumPy is a waste of > time IMO.
> No can do. Or better yet, yes could do, but the whole point here is that > my MatrixFloat gimmick is all a big test for something a lot more > complicated and generalized, where Numpy wouldn't be useful at all. I wouldn't be so sure. Even if you can't directly map your data structure to a numpy array, you need to be able return parts of your data structure as Python types of some sort. If they involve a bunch of numbers then numpy arrays are natural. If you really don't want to use numpy, you could use the std lib array.array objects, but numpy arrays give you so much more. Let's say you are wrapping a sparse matrix object, as DAG suggested. You're right, you can't directly wrap it with a numy array, but you may want: MySparseArray[i, :] or MySparseArray[:, j] to return a numpy array for the row or column. Unless you want a sparse row or column, but I think you'll get my point. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [email protected] _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
