@dantuluri/

RingedUsefulRepository

Python

No description

fork
loading
Files
  • main.py

This Plugin Crashed!

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

a = np.zeros((2,2))   # Create an array of all zeros
print(a)              # Prints "[[ 0.  0.]
                      #          [ 0.  0.]]"

b = np.ones((1,2))    # Create an array of all ones
print(b)              # Prints "[[ 1.  1.]]"

c = np.full((2,2), 7)  # Create a constant array
print(c)               # Prints "[[ 7.  7.]
                       #          [ 7.  7.]]"

d = np.eye(2)         # Create a 2x2 identity matrix
print(d)              # Prints "[[ 1.  0.]
                      #          [ 0.  1.]]"

e = np.random.random((2,2))  # Create an array filled with random values
print(e)                     # Might print "[[ 0.91940167  0.08143941]
                             #               [ 0.68744134  0.87236687]]"