[Python] Numpy - ๋ฐฐ์ด ์ฐ์ฐ(Array math), ๋ธ๋ก๋์บ์คํ
(Broadcasting)
ยท
๊ฐ๋ฐ ํ์์บก์/Python
๋ฐฐ์ด ์ฐ์ฐ Numpy ๋ฐฐ์ด์ ๋ํ ์ฌ์น์ฐ์ฐ์ ๋ฐฐ์ด์ ๊ฐ ์์๋ณ๋ก ๋์ํ๋ค. x = np.array([[1, 2], [3, 4]], dtype=np.float64) y = np.array([[5, 6], [7, 8]], dtype=np.float64) + print(x + y) #[[ 6. 8.] #[10. 12.]] print(np.add(x, y)) #[[ 6. 8.] #[10. 12.]] - print(x - y) #[[-4. -4.] #[-4. -4.]] print(np.subtract(x, y)) #[[-4. -4.] #[-4. -4.]] * print(x * y) #[[ 5. 12.] #[21. 32.]] print(np.multiply(x, y)) #[[ 5. 12.] #[21. 32.]] ์ฐธ..