NumPhp::nulls

Create a new NdArray filled with null

Description

SciPhp\NdArray NumPhp::nulls( mixed $tuple )

NumPhp::nulls() is an alias of NumPy.empty() (Python).

Parameters

$tuple
This parameter can be an array [1, 2, 3] or a tuple of integers (1, 2, 3).

Return Values

The new SciPhp\NdArray

Examples

Example #1: Creating a new NdArray based on a shape

use SciPhp\NumPhp as np;

$x np::nulls([22]);

echo 
$x;

The above example will output:

[[null  null]
 [null  null]]

Example #2: Creating a new NdArray based on a tuple

use SciPhp\NumPhp as np;

$x np::nulls(22);

echo 
$x;

The above example will output:

[[null  null]
 [null  null]]

See Also