OSDir


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

round


> M = np.array([[0, 9],[2, 7]], dtype=int)
> np.linalg.det(M)
> -18.000000000000004
> round(np.linalg.det(M))

np.linalg.det(M) has type numpy.float64, not float. Try this:

>>> round(float(np.linalg.det(M)))
-18

Lutz