#Pythonプログラムの説明 #absolute()関数 import numpy as np a = 4 + 3j 印刷 ( "Absolute(4 + 3j):" 、 np.absolute (a)) b = 16 + 13j print ( "絶対値(16 + 13j):" 、 np.absolute (b)) 出力: 絶対値(4 + 3j):5.0絶対値(16 + 13j):20.6155281281 コード# 3:numpy.absolute()のグラフィック表現 #説明するPythonプログラム #absolute()function import numpy as np import matplotlib.pyplot as plt a = np.linspace(start = - 5 、停止 = 5 、 num = 6 、エンドポイント = True ) print ( "グラフィック表現:" 、 np.absolute < / a>(a)) plt.title( "blue:with Absolute赤:絶対なし " ) plt.plot(a、< a href = "https://python.engineering/numpy-absolute-python/"> np.absolute (a)) plt.plot(a、a、color = `red` ) plt.show() 出力: グラフィック表現:[5。 3.1.1。 3. 5.] リンク: https:/ /docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.absolute.html 、 |