我在scikit-learn软件包中发现以下行:
if is_sparse:
problem = csr_set_problem(
(<np.ndarray[np.float64_t, ndim=1, mode='c']>X.data).data,
(<np.ndarray[np.int32_t, ndim=1, mode='c']>X.indices).shape,
(<np.ndarray[np.int32_t, ndim=1, mode='c']>X.indices).data,
(<np.ndarray[np.int32_t, ndim=1, mode='c']>X.indptr).shape,
(<np.ndarray[np.int32_t, ndim=1, mode='c']>X.indptr).data,
Y.data, (<np.int32_t>X.shape[1]), bias,
sample_weight.data)
else:
...
我搜索“Python中的尖括号”时,所有结果都是关于文档或者装饰器语法的答案。但我相信这不是它们真正的用途,因为它看起来像实际的逻辑。
以上Python代码中的尖括号是什么作用?我应该去哪里了解更多信息呢?