2.8 排序

2.8 排序   import numpy as np x = np.array([2, 1, 4, 3, 5]) np.sort(x) # x的排序結果 array([1, 2, 3, 4, 5])   x.sort() # 排序後賦值給x x array([1, 2, 3, 4, 5])   x = np.array([2, 1, 4, 3, 5]) i = np.argsort(x)
相關文章
相關標籤/搜索