Script execution

This commit is contained in:
2019-12-10 14:52:08 +01:00
parent 36501618d9
commit cfed67c50e

19
script/test/scisoftpy.py Normal file
View File

@@ -0,0 +1,19 @@
import scisoftpy as np
print "Meshgrid testing"
x = np.arange(0, 6, 1)
y = np.arange(0, 4, 1)
xy = np.meshgrid(x, y)
xy = np.meshgrid(x, y, indexing="ij")
print xy
a = np.arange(1, 9).reshape(2, 2, 2)
b = np.array([-2, -3, 5, 7]).reshape(2, 2)
self.checkitems([35, 63], np.tensordot(a, b))
self.checkitems([63, 70], np.tensordot(b, a))
a = np.arange(60.0).reshape(3, 4, 5)
b = np.arange(24.0).reshape(4, 3, 2)
print np.tensordot(a, b, axes=([1, 0], [0, 1])