Skip to content
Related Articles

Related Articles

Improve Article

numpy.ma.flatnotmasked_contiguous() function | Python

  • Last Updated : 13 Mar, 2021

numpy.ma.flatnotmasked_contiguous() function find contiguous unmasked data in a masked array along the given axis. 
 

Syntax : numpy.ma.flatnotmasked_contiguous(arr)
Parameters : 
arr : [ array_like] The input array.
Return : [slice_list ] A sorted sequence of slice objects (start index, end index).
 

Code #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)

Output : 
 

slice(0, 8, None)

  
Code #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)

Output : 
 

slice(0, 12, None)

 

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course

My Personal Notes arrow_drop_up
Recommended Articles
Page :