Array Mathematics

  • + 0 comments

    import numpy as np

    N,M = map(int,input().split()) A =np.array([list(map(int,input().split()))for _ in range(N)]) B = np.array([list(map(int,input().split()))for _ in range(N)])

    print(np.add(A, B)) print(np.subtract(A, B)) print(np.multiply(A, B)) print(np.floor_divide(A, B)) print(np.mod(A, B)) print(np.power(A, B))