[Numpy-discussion] Don't understand this error

David Goldsmith d.l.goldsmith at gmail.com
Wed Jul 28 00:00:53 EDT 2010


Thanks, that was it.

DG

On Tue, Jul 27, 2010 at 3:02 PM, Robert Kern <robert.kern at gmail.com> wrote:

> On Tue, Jul 27, 2010 at 16:59, David Goldsmith <d.l.goldsmith at gmail.com>
> wrote:
> > res = np.fromfunction(make_res, (nx, ny))
> >    File "C:\Python26\lib\site-packages\numpy\core\numeric.py", line 1538,
> in
> > fromfunction
> > args = indices(shape, dtype=dtype)
> >    File "C:\Python26\lib\site-packages\numpy\core\numeric.py", line 1480,
> in
> > indices
> > tmp.shape = (1,)*i + (dim,)+(1,)*(N-i-1)
> > ValueError: total size of new array must be unchanged
> > Script terminated
> >
> > If it's a new array, how can it already have a size that can't be
> changed?
> > What does this error really mean?
>
> indices() creates an array using arange() and repeat() and then
> reshapes it to the appropriate shape. You probably have bad nx or ny
> values.
>
> --
> 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
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>



-- 
Mathematician: noun, someone who disavows certainty when their uncertainty
set is non-empty, even if that set has measure zero.

Hope: noun, that delusive spirit which escaped Pandora's jar and, with her
lies, prevents mankind from committing a general suicide.  (As interpreted
by Robert Graves)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20100727/9c10e56f/attachment.html>


More information about the NumPy-Discussion mailing list