dpnp.isrealobj

dpnp.isrealobj(x)[source]

Return True if x is a not complex type or an array of complex numbers.

The type of the input is checked, not the value. So even if the input has an imaginary part equal to zero, dpnp.isrealobj evaluates to False if the data type is complex.

For full documentation refer to numpy.isrealobj.

Parameters:

x (array_like) -- Input data, in any form that can be converted to an array. This includes scalars, lists, lists of tuples, tuples, tuples of tuples, tuples of lists, and ndarrays.

Returns:

out -- The return value, False if x is of a complex type.

Return type:

bool

See also

dpnp.iscomplexobj

Check for a complex type or an array of complex numbers.

dpnp.isreal

Returns a bool array, where True if input element is real.

Examples

>>> import dpnp as np
>>> np.isrealobj(False)
True
>>> np.isrealobj(1)
True
>>> np.isrealobj(1+0j)
False
>>> np.isrealobj([3, 1+0j, True])
False