Python

[Note] Road to Pythonista

slot

https://qiita.com/tma15/items/1d7fbc4d56ac4b3678e1

@property

http://d.hatena.ne.jp/podhmo/20110526/1306422831

super()

https://qiita.com/Kodaira_/items/42dfe18c81af98bf0db3

numpy.reshape

modifying the "axis" argument for numpy.reshape, we could convert the array into any dimensional matrix.
In this case, I have formatted 32x1 matrix in 1x4x8x1x1, 2x2x2x2x2 or 1x1x1x1x32 dimensional matrix.

np.random.seed(3)
a = np.random.rand(32)
print(a)
print(a.reshape(1,4,8,1,1))
print(a.reshape(2,2,2,2,2))
print(a.reshape(1,1,1,1,32))

np.squeeze()

https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.squeeze.html

np.vstack

https://deepage.net/features/numpy-stack.html