數組的四則,比較,邏輯運算

1、四則運算 import numpy as np # 建立數組 ----數組間的運算 arr1 = np.arange(4).reshape((2, 2)) # arr2 = np.arange(4, 8).reshape((2, 2)) arr2 = np.array([[0, 1], [4, 5]]) print("arr1\n", arr1) print("arr2\n", arr2)
相關文章
相關標籤/搜索