Add alternative solution of Q.60

This commit is contained in:
lots-o 2022-03-28 09:55:46 +09:00
parent 2cdb74caa6
commit 23f872b229

View File

@ -778,9 +778,18 @@ hint: any, ~
< a60 < a60
# Author: Warren Weckesser # Author: Warren Weckesser
# null : 0
Z = np.random.randint(0,3,(3,10)) Z = np.random.randint(0,3,(3,10))
print((~Z.any(axis=0)).any()) 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 < q61
Find the nearest value from a given value in an array (★★☆) Find the nearest value from a given value in an array (★★☆)