numpy ndarray 杩斿洖 index 闂,,鏍囩锛?a hre


鏍囩锛?a href='http://www.byrx.net/so/1/round' title='round'>round

缁忓父閬囧埌闇€瑕佽繑鍥炴弧瓒虫潯浠剁殑index銆?python涓病鏈墂hich鍑芥暟锛屼絾鏈夊垪琛ㄦ帹瀵煎紡锛?鍙互瀹炵幇绫讳技鍔熻兘

y= np.array([3,2,5,20])

y
Out[131]: array([ 3, 2, 5, 20])

[x for x in range(y.shape[0]) if y[x]>3]
Out[129]: [2, 3] 杈撳嚭婊¤冻鏉′欢鐨勭储寮曞彿

In [23]: {i:el for i,el in enumerate(["one","two","three"])}Out[23]: {0: 鈥榦ne鈥? 1: 鈥榯wo鈥? 2: 鈥榯hree鈥榼

numpy ndarray 杩斿洖 index 闂

鏍囩锛?a href='http://www.byrx.net/so/1/round' title='round'>round

鍘熸枃鍦板潃锛歨ttp://www.cnblogs.com/xinping-study/p/7205112.html

评论关闭