-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.py
68 lines (57 loc) · 1.14 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import numpy as np
from matplotlib import pyplot as plt
# x = np.arange(5)
#
# fig = 1
# f1 = plt.figure()
# h = plt.plot(x)
# plt.show(block=False)
# plt.waitforbuttonpress()
#
# f2 = plt.figure()
# h = plt.plot(x)
# plt.show(block=False)
# plt.waitforbuttonpress()
#
# plt.figure(f1.number)
# h = plt.plot(x+5)
# plt.show(block=False)
# plt.waitforbuttonpress()
A = np.array([[2.0, 5, 0], [0, 0, 1], [2, 3.0, 2.0]])
b = np.array([1, -1, 0])
# print "A shape:" + str(A.shape)
# print A
# print "b shape: " + str(b.shape)
# print b
#
# c = np.dot(A,b)
# print "c shape: " + str(c.shape)
# print c
# print A
# R = np.roll(A, 1, axis=1)
# print R
# print A
# a = np.array([0,0,1,1,2], dtype='float')
# b = np.array([0,1,0,1,3], dtype='float')
#
# with np.errstate(divide='ignore', invalid='ignore'):
# c = np.true_divide(a,b)
# # c[c == np.inf] = 0
# # c = np.nan_to_num(c)
#
# print('c: {0}'.format(c))
# print c
# alpha = np.arctan2(1,0)
# print alpha
# M = np.arange(12).reshape((3,4))
#
# suma = np.sum(M, axis=0)
# print suma
#
# aa = M / suma
# print aa
# multi = np.zeros((2, 3, 4))
# # print multi
# multi[1, 0, 0] = 1
#
# print multi[:,:,:]