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.
3D ベクトルAのリストを含む配列があります。ベクトルの基準に従って行を並べ替えたい:nvecA.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,:]
2 番目の添え字を削除するだけです。
A[rank]