New ScreenPanel
This commit is contained in:
31
script/np.py
Executable file
31
script/np.py
Executable file
@@ -0,0 +1,31 @@
|
||||
import numpy as np
|
||||
import sys
|
||||
|
||||
|
||||
def add(a1, a2):
|
||||
#raise Exception("Test")
|
||||
x = np.array(a1, dtype=np.float64)
|
||||
y = np.array(a2, dtype=np.float64)
|
||||
return np.add(x, y).tolist()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print sys.argv
|
||||
x = np.array([[1,2],[3,4]], dtype=np.float64)
|
||||
y = np.array([[5,6],[7,8]], dtype=np.float64)
|
||||
print "---------------"
|
||||
print x + y
|
||||
print np.add(x, y)
|
||||
print np.add(x, y).tolist()
|
||||
print "---------------"
|
||||
print x - y
|
||||
print np.subtract(x, y)
|
||||
print "---------------"
|
||||
print x * y
|
||||
print np.multiply(x, y)
|
||||
print "---------------"
|
||||
print x / y
|
||||
print np.divide(x, y)
|
||||
print "---------------"
|
||||
print np.sqrt(x)
|
||||
print "---------------"
|
||||
Reference in New Issue
Block a user