numpy - python "is" returns True but "==" returns False -


"==" should not be returned unless true "gives" right? [101]: NPNAN NPNN is NPNAN Out [101]: Really [102]: NPNAN == NP. Nan out [102]: In the wrong [103]: NP. NaN == np.nan out [103]: False [104]: np.NaN == np.NAN out [104]: Incorrect

Edit:

What float Nain bus are the 3 expressions for the legacy of the old NMP versions or for their other uses?

No, for no you have found one of the exceptions. According to, the NAN is not equal to anything, not even by itself:

Compared with an NAN, always gives an anord result while comparing itself.

Not only behave like this:

  & gt; & Gt; & Gt; Nain = float ('nan')> gt; & Gt; & Gt; Nain hai nain true & gt; & Gt; & Gt; Nain == Nain false   

As per the IEEE standard, there will be any programming language implementing floating point arithmetic.

Common Capitalization Name for Multiple Spelling. It is an abbreviation for not a number and individual people have briefly taken advantage of it briefly

is always the same object Is going to be true , but == is also not guaranteed to return boolean. From:

Through the conference, for a successful comparison, the incorrect and true are returned, however, So if the comparison operator is used in the Boolean reference (for example, if is in the statement state), then python bool () value To determine whether the result is true or false.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -