numpy数组获取对象而不是值

时间:2019-11-17 12:20:24

标签: python arrays numpy

我使用Python3.6和numpy库的最新版本,并且在我调用我制作的函数时:

    def matriz_jacobiana_reducida(self, a, b, c):
    return np.array([
        [-c * np.sin(a) * np.cos(b) - c * np.cos(a) * np.sin(b) - self.a1 * np.sin(a),
         -c * np.cos(a) * np.sin(b) - c * np.sin(a) * np.cos(b),
         np.cos(a) * np.cos(b) - np.sin(a) * np.sin(b)],
        [-c * np.cos(a) * np.cos(b) - c * np.sin(a) * np.sin(b) + self.a1 * np.cos(a),
         -c * np.sin(a) * np.sin(b) + c * np.cos(a) * np.cos(b),
         np.sin(a) * np.cos(b) + np.cos(a) * np.sin(b)],
        [1, 1, 0]
    ])

在循环的第三次迭代中,Im开始得到一些奇怪的东西,而不是numpy矩阵中的值:

[[array([1.85417763]) array([-0.14528501]) array([0.99970679])][array([6.04488775]) array([5.99824076]) array([0.02421417])][1 1 0]]

我试图将值复制到另一个数组中,但是没有用,当我调用此数组时,我开始出现错误:

TypeError: No loop matching the specified signature and casting was found for ufunc det

这种[array(value)] numpy格式背后的原因是什么?

谢谢。

0 个答案:

没有答案