📜  numpy.ma.flatnotmasked_edges()函数| Python

📅  最后修改于: 2022-05-13 01:55:15.040000             🧑  作者: Mango

numpy.ma.flatnotmasked_edges()函数| Python

numpy.ma.flatnotmasked_edges()函数查找第一个和最后一个未屏蔽值的索引。

代码#1:

# Python program explaining
# numpy.ma.flatnotmasked_edges() function
  
# importing numpy as geek  
# and numpy.ma module as ma 
import numpy as geek 
import numpy.ma as ma 
  
arr = geek.ma.arange(12)
  
gfg = geek.ma.flatnotmasked_edges(arr)
  
print (gfg)

输出 :

[ 0, 11]


代码#2:

# Python program explaining
# numpy.ma.flatnotmasked_edges() function
  
# importing numpy as geek  
# and numpy.ma module as ma 
import numpy as geek 
import numpy.ma as ma 
  
arr = geek.ma.arange(12)
arr[:] = geek.ma.masked
  
gfg = geek.ma.flatnotmasked_edges(arr)
  
print (gfg)

输出 :

None