Advertisement
Appendko

Untitled

Aug 16th, 2020
1,245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. # 原本
  2. def func_FBR(ind):
  3.     in_ind = tuple(set(np.arange(len(select_mode))).intersection(ind)))
  4.     out_ind = tuple(set(np.arange(len(select_mode))).difference(ind)))
  5.  
  6. # 但是 set 不保證排序 所以有時候index會出錯 越大越有可能順序出錯
  7. # 所以要手動排序 把這幾行改成
  8. def func_FBR(ind):  
  9.     in_ind = tuple(sorted(set(np.arange(len(select_mode))).intersection(ind)))
  10.     out_ind = tuple(sorted(set(np.arange(len(select_mode))).difference(ind)))
  11.    
  12.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement