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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
| import numpy as np
z = np.zeros([3,3]) z : array([[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]])
y = np.eye(3) y : array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]])
t = np.array([[1,2,3],[4,5,6],[7,8,9]]) t.T : array([[1, 4, 7], [2, 5, 8], [3, 6, 9]])
o = np.ones((5,4)) o : array([[1., 1., 1., 1.], [1., 1., 1., 1.], [1., 1., 1., 1.], [1., 1., 1., 1.], [1., 1., 1., 1.]])
f = np.full((3,3),3) f : array([[3, 3, 3], [3, 3, 3], [3, 3, 3]])
l = np.ones_like(f) l : array([[1, 1, 1], [1, 1, 1], [1, 1, 1]])
np.diagonal([[1,2],[3,4]]) : array([1, 4])
np.triu([[1,2,3],[4,5,6],[7,8,9],[10,11,12]]) : array([[1, 2, 3], [0, 5, 6], [0, 0, 9], [0, 0, 0]])
np.tri(4) : array([[1., 0., 0., 0.], [1., 1., 0., 0.], [1., 1., 1., 0.], [1., 1., 1., 1.]])
np.tril([[1,2,3],[4,5,6],[7,8,9],[10,11,12]], -1) : array([[ 0, 0, 0], [ 4, 0, 0], [ 7, 8, 0], [10, 11, 12]])
np.linspace(0,30) : array([ 0. , 0.6122449 , 1.2244898 , 1.83673469, 2.44897959, 3.06122449, 3.67346939, 4.28571429, 4.89795918, 5.51020408, 6.12244898, 6.73469388, 7.34693878, 7.95918367, 8.57142857, 9.18367347, 9.79591837, 10.40816327, 11.02040816, 11.63265306, 12.24489796, 12.85714286, 13.46938776, 14.08163265, 14.69387755, 15.30612245, 15.91836735, 16.53061224, 17.14285714, 17.75510204, 18.36734694, 18.97959184, 19.59183673, 20.20408163, 20.81632653, 21.42857143, 22.04081633, 22.65306122, 23.26530612, 23.87755102, 24.48979592, 25.10204082, 25.71428571, 26.32653061, 26.93877551, 27.55102041, 28.16326531, 28.7755102 , 29.3877551 , 30. ])
np.logspace(1,100) : array([1.00000000e+001, 1.04811313e+003, 1.09854114e+005, 1.15139540e+007, 1.20679264e+009, 1.26485522e+011, 1.32571137e+013, 1.38949549e+015, 1.45634848e+017, 1.52641797e+019, 1.59985872e+021, 1.67683294e+023, 1.75751062e+025, 1.84206997e+027, 1.93069773e+029, 2.02358965e+031, 2.12095089e+033, 2.22299648e+035, 2.32995181e+037, 2.44205309e+039, 2.55954792e+041, 2.68269580e+043, 2.81176870e+045, 2.94705170e+047, 3.08884360e+049, 3.23745754e+051, 3.39322177e+053, 3.55648031e+055, 3.72759372e+057, 3.90693994e+059, 4.09491506e+061, 4.29193426e+063, 4.49843267e+065, 4.71486636e+067, 4.94171336e+069, 5.17947468e+071, 5.42867544e+073, 5.68986603e+075, 5.96362332e+077, 6.25055193e+079, 6.55128557e+081, 6.86648845e+083, 7.19685673e+085, 7.54312006e+087, 7.90604321e+089, 8.28642773e+091, 8.68511374e+093, 9.10298178e+095, 9.54095476e+097, 1.00000000e+100])
np.empty((3,3)) : array([[0.00000000e+000, 0.00000000e+000, 0.00000000e+000], [0.00000000e+000, 0.00000000e+000, 4.36754031e-321], [8.70018274e-313, 6.79038653e-313, 1.24610994e-306]])
|