Add alternative solution of Q.60

This commit is contained in:
lots-o committed 2022-03-30 22:19:36 +09:00
1 parent 2cdb74caa6
commit 23f872b229
1 file changed
+9
+9
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 (★★☆)