使用NumPy 的where方法,語法更加簡潔,看不到for語句,符合Python哲學:. # 使用NumPy. na = np.array(a). # 一行程式碼. b = np.where(na <.
確定! 回上一頁