[SciPy-User] asanyarray behavior with sparse matrices?

Robert Kern robert.kern@gmail....
Fri Feb 12 18:44:04 CST 2010

On Fri, Feb 12, 2010 at 18:37, Skipper Seabold <jsseabold@gmail.com> wrote:
> Bug or wishful thinking on my part?

Wishful thinking. asanyarray() leaves subclasses of ndarray alone, but
sparse matrices are not subclasses of ndarray. Not being something
that asanyarray() can recognize as a sequence (len(spX) raises a
TypeError), it interprets it as a scalar object.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco

More information about the SciPy-User mailing list