np.dot() से Dot Product
np.dot() vectors या matrices को linear-algebra तरीके से multiply करता है।
In this page:
Syntax
np.dot(a, b)
a @ b
np.dot()
दो 1-D arrays के लिए यह inner product return करता है; 2-D arrays के लिए यह matrix multiplication है। Inner dimensions match होनी चाहिए: (m, n) dot (n, p) (m, p) देता है। @ operator matrices के लिए modern equivalent है।
Note:
दो vectors का dot matching elements की products add करता है।
उदाहरण: np.dot()
import numpy as np
v = np.array([1, 2, 3])
w = np.array([4, 5, 6])
print(np.dot(v, w))
A = np.array([[1, 2], [3, 4]])
B = np.array([[5, 6], [7, 8]])
print(np.dot(A, B))
# Output:
# 32
# [[19 22]
# [43 50]]
Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the
view already swaps in the hi_ translation fields (or blanks these
out if untranslated), so this renders correctly for both languages
without a lang_code check here. #}
आम गलतियां
- dot को element-wise * से confuse करना
- mismatched inner dimensions वाली matrices multiply करना
- यह मान लेना कि order matter नहीं करता
चैप्टर सारांश
- dot vectors के लिए inner product देता है
- 2-D के लिए यह matrix multiplication है
- Inner dimensions agree होनी चाहिए
- Order matter करता है
🔒
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: