Permute the dimensions of an array.
SciPhp\NdArray
NdArray::T
The new SciPhp\NdArray
use SciPhp\NumPhp as np;
$m = np::linspace(1, 9, 9)->reshape(3, 3);
$t = $m->T;
echo "m\n$m", "a=m->T\n$t";
The above example will output:
m [[1 2 3] [4 5 6] [7 8 9]] a=m->T [[1 4 7] [2 5 8] [3 6 9]]