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

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

numpy.ma.flatnotmasked_contiguous()函数| Python

numpy.ma.flatnotmasked_contiguous()函数在给定轴的掩码数组中查找连续的未掩码数据。

代码#1:

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


Python3
# Python program explaining
# numpy.ma.flatnotmasked_contiguous() 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_contiguous(arr)
 
print (gfg)


输出 :

slice(0, 8, None)


代码#2:

Python3

# Python program explaining
# numpy.ma.flatnotmasked_contiguous() 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_contiguous(arr)
 
print (gfg)

输出 :

slice(0, 12, None)