프로그래밍 언어ㅤ/ㅤPython

[Python 101] Matrix

Matrix

- 덧셈, 뺄셈

- shape이 같아야 함

- 같은 position끼리 연산함

- 행 기준 합계 : np.sum(arr2d, axis=0)

- 열 기준 합계 : np.sum(arr2d, axis=1)

- 곱셈

1) 단순 곱셈

  • 덧셈, 뺄셈과 같이 같은 position끼리 곱셈
  • a * b

2) dot product

  • (2X3) * (3X2) = (2X2)
  • np.dot(a, b)
  • a.dot(b)

 

Broadcasting

- 숫자의 연산 (단일)

- a = np.array([[1,2,3], [4,5,6]])

- 개념 설명 추가할 것....