Reputation: 3
I am correctly trying to figure out what a piece of code means and I came across this code which I do not understand. Could someone explain this to me?
if np.sum((arr_y != arr_y)) == 0:
print(True)
Upvotes: 0
Views: 43
Reputation: 50278
arr_y != arr_y
is generally used to check NaN values as they are the only one to be different from themselves. Thus, this code just check the number of NaN values is 0 and print True
if so.
Upvotes: 1