Resize an array
SciPhp\NdArray
NdArray::resize(
mixed
$tuple
)
$tuple
The new SciPhp\NdArray
use SciPhp\NumPhp as np;
$x = np::ar([1, 2, 3])->resize(3, 3);
print $x;
The above example will output:
[[1 2 3] [1 2 3] [1 2 3]]
use SciPhp\NumPhp as np;
$x = np::ar([1, 2, 3])->resize(3, 3);
print $x->resize(2, 2);
The above example will output:
[[1 2] [3 1]]