Merge pull request #175 from lots-o/fix

Add alternative solution of Q.60
This commit is contained in:
Nicolas P. Rougier 2022-03-31 14:22:15 +02:00 committed by GitHub
commit de9b990b1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -778,9 +778,18 @@ hint: any, ~
< a60
# Author: Warren Weckesser
# null : 0
Z = np.random.randint(0,3,(3,10))
print((~Z.any(axis=0)).any())
# null : np.nan
Z=np.array([
[0,1,np.nan],
[1,2,np.nan],
[4,5,np.nan]
])
print(np.isnan(Z).all(axis=0))
< q61
Find the nearest value from a given value in an array (★★☆)