NumPhp::full

Create a new NdArray filled with a value

Description

SciPhp\NdArray NumPhp::full( array $shape , mixed $value )

Parameters

$shape
An array [1, 2, 3] of integers which represents the shape of the created NdArray.
$value
A float or an integer.

Return Values

The new SciPhp\NdArray

Examples

Example #1: Creating a new NdArray

use SciPhp\NumPhp as np;

$x np::full([12], 6);

echo 
$x;

The above example will output:

[[6  6]]

See Also