此函数用于计算数组元素的反余弦。
numpy.arccos(array, out)
它返回一个数组,其中包含所有数组元素x的逆cos。
链接:https://www.learnfk.comhttps://www.learnfk.com/numpy/numpy-arccos.html
来源:LearnFk无涯教程网
import numpy as np arr = [0, 0.3, -1] print ("Input array : \n", arr) arccos_val = np.arccos(arr) print ("\nInverse cos values : \n", arccos_val)
输出:
Input array : [0, 0.3, -1] Inverse cos values : [1.57079633 1.26610367 3.14159265]
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)