numpy.iscomplex (array): test element by element whether it is a complex number or not (not infinity or not a number) and returns the result as a logical array.
array: [array_like] Input array whose element we want to test
boolean array containing the result
Is Complex: [ True False] Is Complex: [True False]
< / p>
# Python program illustrating
# numpy.iscomplex () method
numpy as geek
# Returns True / False for each element
) .reshape (
, geek.iscomplex (a))
# Returns True / False value as ANS
# because we mentioned dtpe at the beginning p >
). reshape (
( code >
, geek.iscomplex (b))
, geek.iscomplex (b)) p>
< / p>
Is complex: [[False False False False] [False False False False] [False False False False] [False False False False] [False False False False]] Is complex: False Is complex: [[True] [False]] pre>
These codes will not work for online ID. Please run them on your systems to see how they work
This article is provided by Mohit Gupta_OMG
Become a master in Python by learning coding best practices and advanced programming concepts in Python 3.7. This book is written for Python developers who wish to go further in mastering Python. A...
The ability to identify patterns is an essential component of sensory intelli- gent machines. Pattern recognition is therefore an indispensible component of the so-called “Intelligent Control System...
Vincent Bumgarner has been designing software for nearly 20 years, working in many languages on nearly as many platforms. He started using Splunk in 2007 and has enjoyed watching the product evolve ov...
Systems programming provides the basis for global calculation. Developing performance-sensitive code requires a programming language that allows programmers to control the use of memory, processor tim...