Hallo, ich möchte einen array runden.
Nur kommt da etwas komisches raus
Wie es sein muss, gibt round(0.5)
1
komischerweise gibt around(arange(0,1,0.1))
[ 0. 0. 0. 0. 0. 0. 1. 1. 1. 1.]
also von 0.5 rundet er ab auf 0. Wo liegt das Problem? Wie kann ich es beheben?
Im Internet finde ich leider nur schlechte Angaben zum Befehl around, oder ähnlichen.
runden around round
Aus numpy:
Notes
-----
For values exactly halfway between rounded decimal values, Numpy
rounds to the nearest even value. Thus 1.5 and 2.5 round to 2.0,
-0.5 and 0.5 round to 0.0, etc. Results may also be surprising due
to the inexact representation of decimal fractions in the IEEE
floating point standard [1]_ and errors introduced when scaling
by powers of ten.
[url=http://wiki.python-forum.de/PEP%208%20%28%C3%9Cbersetzung%29]PEP 8[/url] - Quak!
[url=http://tutorial.pocoo.org/index.html]Tutorial in Deutsch[/url]
[url=http://tutorial.pocoo.org/index.html]Tutorial in Deutsch[/url]