# Python-Programm erklärt
# absolute ()-Funktion
import numpy as np
a = 4 + 3j
print ( "Absolut (4 + 3j):" ,
np.absolute (a)) b = 16 + 13j
print ( "Absolutwert (16 + 13j):" ,
np.absolute (b)) Ausgabe: Absolut (4 + 3j): 5,0 Absolutwert ( 16 + 13j): 20,6155281281 Code # 3: Grafische Darstellung von numpy.absolute () # Python-Programm, das die
# absolute () function import numpy as np
import matplotlib.pyplot as plt
a = np.linspace (start = - 5 , stop = 5 ,
num = 6 , Endpunkt = True )
print ( "Graphical Representation:" ,
np.absolute< /a> (a))
plt.title ( "blue: with absolute rot: ohne absolutes " )
plt.plot (a, < a href="https://python.engineering/numpy-absolute-python/">np.absolute (a) )
plt.plot (a, a, color = `red` )
plt.show () Ausgabe: Grafische Darstellung: [5. 3. 1. 1 . 3. 5.] Links: https: / /docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.absolute.html , |