Numpy MaskedArray.compressed() function – Python
numpy.MaskedArray.compressed() function return all the non-masked data as a 1-D array.
Syntax : numpy.MaskedArray.compressed(self)
Return : [ndarray] A new ndarray holding the non-masked data is returned.
Code #1 :
[0 1 2 3 4 5]
Code #2 :
[0 1 2 3]
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