摘要: import numpy as np a = np.random.randint(-5, 5, (1, 10)) c=np.sum(a>=1) #条件为大于等于1 print ("随机数组a : "+str(a)) #输出数组a print ("大于等于1的个数: "+str(c)) #输出满足条件 阅读全文
posted @ 2020-08-14 11:26 早上好章鱼哥 阅读(34032) 评论(0) 推荐(1) 编辑