loading

This Plugin Crashed!

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

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

# An example of integer array indexing.
# The returned array will have shape (3,) and
print(a[[0, 1, 2], [0, 1, 0]])  # Prints "[1 4 5]"

# The above example of integer array indexing is equivalent to this:
print(np.array([a[0, 0], a[1, 1], a[2, 0]]))  # Prints "[1 4 5]"

# When using integer array indexing, you can reuse the same
# element from the source array:
print(a[[0, 0], [1, 1]])  # Prints "[2 2]"

# Equivalent to the previous integer array indexing example
print(np.array([a[0, 1], a[0, 1]]))  # Prints "[2 2]"