[Scipy-tickets] [SciPy] #345: spy(sparse) shows upside down, flipd(sparse) doesn't work
SciPy
scipy-tickets at scipy.net
Thu Jan 11 10:56:34 CST 2007
#345: spy(sparse) shows upside down, flipd(sparse) doesn't work
--------------------+-------------------------------------------------------
Reporter: jdpipe | Owner: somebody
Type: defect | Status: closed
Priority: normal | Milestone:
Component: Other | Version:
Severity: normal | Resolution: invalid
Keywords: |
--------------------+-------------------------------------------------------
Changes (by rkern):
* status: new => closed
* resolution: => invalid
Old description:
> Some more probs with the sparse matrix stuff in scipy:
>
> - spy(sparse) shows upside down (but does that for dense as well, c.f.
> spy2 though)
> - flipd(sparse) doesn't work:
>
> In [18]: spy( flipud(io.mmread("/home/john/ascend/slv3mmio.mtx")))
> ---------------------------------------------------------------------------
> exceptions.ValueError Traceback (most
> recent call last)
>
> /home/john/<ipython console>
>
> /usr/lib/python2.4/site-packages/numpy/lib/twodim_base.py in flipud(m)
> 24 m = asanyarray(m)
> 25 if m.ndim < 1:
> ---> 26 raise ValueError, "Input must be >= 1-d."
> 27 return m[::-1,...]
> 28
New description:
Some more probs with the sparse matrix stuff in scipy:
- spy(sparse) shows upside down (but does that for dense as well, c.f.
spy2 though)
- flipud(sparse) doesn't work:
{{{
In [18]: spy( flipud(io.mmread("/home/john/ascend/slv3mmio.mtx")))
---------------------------------------------------------------------------
exceptions.ValueError Traceback (most
recent call last)
/home/john/<ipython console>
/usr/lib/python2.4/site-packages/numpy/lib/twodim_base.py in flipud(m)
24 m = asanyarray(m)
25 if m.ndim < 1:
---> 26 raise ValueError, "Input must be >= 1-d."
27 return m[::-1,...]
28
}}}
Comment:
No, it's from matplotlib. The appropriate thing to fix here is
{{{spy()}}}, not sparse matrices.
{{{flipud()}}} is a function defined on arrays, not sparse arrays, so of
course it doesn't work (nor can it cleanly be made to do so, really). You
should be able to get the same effect, though, with {{{sparse[::-1]}}}.
--
Ticket URL: <http://projects.scipy.org/scipy/scipy/ticket/345#comment:2>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.
More information about the Scipy-tickets
mailing list