& `( X5 K" Q' }, Y; M三维数组示例代码如下: ; c# @* |7 }6 H# w* b % i7 y4 i. Y; V t " @+ ^; z7 |# [$ c4. 数组形状与类型变化6 j# f! \0 f, {9 l* a# i" b
* \8 b) }! h% O# ?' J
1. ndarray.reshape(shape[, order]) Returns an array containing the same data with a new shape. 示例代码如下:4 B! K" K: I# L5 g
- Z4 m' Z# V2 `& R+ R( f/ ]
2. ndarray.resize(new_shape[, refcheck]) Change shape and size of array in-place. 示例代码如下:/ o2 f |/ _7 O( t$ \
- l5 A' i- ?2 g1 L" ~
3. 修改类型 ndarray.astype(type) 示例代码如下:! [% R( C! ]! t+ G
6 R' {8 M& z3 F2 ]9 }' `. I
4. 修改小数位数 ndarray.round(arr, out) Return a with each element rounded to the given number of decimals. 示例代码如下: 7 y. R0 K9 ?* B3 h: Q2 F0 d3 O6 T5 G6 z* p8 i/ t
5. ndarray.flatten([order]) Return a copy of the array collapsed into one dimension. 示例代码如下:1 e5 ^+ [) j( B