[Numpy-discussion] GSoC proposal -- Numpy SciPy

Blake Griffith blake.a.griffith at gmail.com
Wed May 1 15:02:55 EDT 2013


There are several situations where that comes up (Like comparing two sparse
matrices A == B) There is a SparseEfficiancyWarning that can be thrown, but
the way this should be implemented still needs to be discussed. I will be
writing a specification on how ufuncs and ndarrays are handled by the
sparse package, the spec can be found here
https://github.com/cowlicks/scipy-sparse-ndarray-and-ufunc-spec/blob/master/Spec.markdown.
In general, a unary ufunc operating on a sparse matrix should return a
sparse matrix.

If you really want to do cos(sparse) you will be able to. But if you are
just interested in the initially non zero elements should probably do
something like: sparse.data = np.cos(sparse.data)



On Wed, May 1, 2013 at 1:32 PM, Daπid <davidmenhur at gmail.com> wrote:

> On 1 May 2013 20:12, Blake Griffith <blake.a.griffith at gmail.com> wrote:
> > However, it would still be useful to have ufuncs working well with the
> > sparse package.
>
> How are you planning to deal with ufunc(0) != 0? cos(sparse) is actually
> dense.
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130501/7fb57211/attachment.html>


More information about the NumPy-Discussion mailing list