1 s = np.arange(13)**2
2 s
array([ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144])
(0, 16, 144)
array([ 1, 4, 9, 16])
array([ 81, 100, 121, 144])
array([64, 36, 16, 4, 0])
1 r = np.arange(36)
2 r.resize((6, 6))
3 r
array([[ 0, 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]])
14
array([21, 22, 23])
array([[ 0, 1, 2, 3, 4],
[ 6, 7, 8, 9, 10]])
array([30, 32, 34])
array([31, 32, 33, 34, 35])
array([[ 0, 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, 30, 30, 30, 30, 30]])