np.nonzero(theta) returns the index of the values that are non-zero. In your case, it returns, [1, 2, 3] Then, theta[np.nonzero(theta)] returns the values ...
確定! 回上一頁