Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有A一个包含nvec3D 向量列表的数组,A.shape==(nvec,3). 我想A根据向量的规范重新排序行:
A
nvec
A.shape==(nvec,3)
norm=numpy.square(A).sum(axis=1) rank=numpy.argsort(norm)
我试过A[rank,:]了,但它给了我一个错误。
A[rank,:]
只需删除第二个下标:
A[rank]