loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.04393830414769018","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"aW1wb3J0IG51bXB5IGFzIG5wCgp4ID0gbnAuYXJyYXkoW1sxLDJdLFszLDRdXSkKeSA9IG5wLmFycmF5KFtbNSw2XSxbNyw4XV0pCgp2ID0gbnAuYXJyYXkoWzksMTBdKQp3ID0gbnAuYXJyYXkoWzExLCAxMl0pCgojIElubmVyIHByb2R1Y3Qgb2YgdmVjdG9yczsgYm90aCBwcm9kdWNlIDIxOQpwcmludCh2LmRvdCh3KSkKcHJpbnQobnAuZG90KHYsIHcpKQoKIyBNYXRyaXggLyB2ZWN0b3IgcHJvZHVjdDsgYm90aCBwcm9kdWNlIHRoZSByYW5rIDEgYXJyYXkgWzI5IDY3XQpwcmludCh4LmRvdCh2KSkKcHJpbnQobnAuZG90KHgsIHYpKQoKIyBNYXRyaXggLyBtYXRyaXggcHJvZHVjdDsgYm90aCBwcm9kdWNlIHRoZSByYW5rIDIgYXJyYXkKIyBbWzE5IDIyXQojICBbNDMgNTBdXQpwcmludCh4LmRvdCh5KSkKcHJpbnQobnAuZG90KHgsIHkpKQ=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import numpy as np

x = np.array([[1,2],[3,4]])
y = np.array([[5,6],[7,8]])

v = np.array([9,10])
w = np.array([11, 12])

# Inner product of vectors; both produce 219
print(v.dot(w))
print(np.dot(v, w))

# Matrix / vector product; both produce the rank 1 array [29 67]
print(x.dot(v))
print(np.dot(x, v))

# Matrix / matrix product; both produce the rank 2 array
# [[19 22]
#  [43 50]]
print(x.dot(y))
print(np.dot(x, y))