Home > other >  2020.6 the python based learning assignments
2020.6 the python based learning assignments

Time:12-04

1 using the numpy, arrang, reshape, generate array shape is the array of [4] 2
> The import numpy as np
> X=np. Arange (24). Reshape (2 and 4)
> X
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]]])
> X.t ranspose ((0, 2, 1))
Array ([[[0, 4, 8],
[1, 5, 9],
[2, 6, 10],
[3, 7, 11]],

[[12, 16, 20],
[13, 17, 21],
[14, 18, 22],
[15, 19, 23]]])
> X.t ranspose ((2, 0))
Array ([[12] [0,,
[4, 16],
[8, 20]],

[[1, 13],
[5, 17],
[9, 21]],

[[2, 14],
[6, 18],
[10, 22]],

[[3, 15],
[7, 19],
[11, 23]]])

CodePudding user response:

Where are the problems?
  • Related