[Tutor] numerical problem

Ben Finney ben+python at benfinney.id.au
Tue Mar 4 03:01:16 CET 2014


Gabriele Brambilla <gb.gabrielebrambilla at gmail.com> writes:

> www is the quantity I add.
>
> MYMAP[i, j, k] = MYMAP[i, j, k] + www
>
> MYMAP is a numpy array

Unfortunately, we have no idea what values are in ‘MYMAP’ nor ‘www’. So
it's difficult for us to see what might be causing any problem, or even
whether there is any problem.

> I have strong reasons to think that in this operation happens some
> numerical error...Have you suggestions to discover where it is?

Can you show a complete example which demonstrates that there is an
error? For example::

    >>> import numpy
    >>> map = numpy.array([10, 20, 30])
    >>> map[1] + 4
    24

Please show a simple, self-contained, correct example
<URL:http://sscce.org/> like the above, which demonstrates the
problematic behaviour.

You'll also need to be more descriptive of what you think the problem
is: What are you expecting? What are you experiencing instead?

-- 
 \      “Not using Microsoft products is like being a non-smoker 40 or |
  `\     50 years ago: You can choose not to smoke, yourself, but it's |
_o__)               hard to avoid second-hand smoke.” —Michael Tiemann |
Ben Finney



More information about the Tutor mailing list