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.
この非常に単純なコードを使用して、numpy 配列をソートしようとしています。
print np.array([2,0,8,4,1]).sort()
しかし、私は結果を得ています:
None
誰かがここで何が起こっているのか教えてもらえますか?
Pythonのように、配列はおそらくその場でソートされるlist.sort()ので、元の配列がまだ同じであると誤解されることはありません。
list.sort()
arr = np.array([2,0,8,4,1]) arr.sort() print arr