numpy.ma.clump_unmasked() function | Python Last Updated : 22 Apr, 2020 Comments Improve Suggest changes Like Article Like Report numpy.ma.clump_unmasked() function returns list of slices corresponding to the unmasked clumps of a 1-D array. Syntax : numpy.ma.clump_unmasked(arr) Parameters : arr : [ndarray] A one-dimensional masked array. Return : [list of slice] The list of slices, one for each continuous region of unmasked elements in a. Code #1 : Python3 # Python program explaining # numpy.ma.clump_unmasked() function # importing numpy as geek # and numpy.ma module as ma import numpy as geek import numpy.ma as ma arr = geek.ma.masked_array(geek.arange(8)) arr[[0, 1, 2, 6]] = geek.ma.masked gfg = geek.ma.clump_unmasked(arr) print (gfg) Output : [slice(3, 6, None), slice(7, 8, None)] Code #2 : Python3 # Python program explaining # numpy.ma.clump_unmasked() function # importing numpy as geek # and numpy.ma module as ma import numpy as geek import numpy.ma as ma arr = geek.ma.masked_array(geek.arange(10)) arr[[0, 1, 2, 6, 8, 9]] = geek.ma.masked gfg = geek.ma.clump_unmasked(arr) print (gfg) Output : [slice(3, 6, None), slice(7, 8, None)] Comment More infoAdvertise with us Next Article numpy.ma.clump_unmasked() function | Python S sanjoy_62 Follow Improve Article Tags : Machine Learning Python-numpy python Python Numpy-Masked Array Practice Tags : Machine Learningpython Similar Reads numpy.ma.clump_masked() function | Python numpy.ma.clump_masked() function returns a list of slices corresponding to the masked clumps of a 1-D array. Syntax : numpy.ma.clump_masked(arr) Parameters : arr : [ndarray] A one-dimensional masked array. Return : [list of slice] The list of slices, one for each continuous region of masked elements 1 min read numpy.ma.where() function - Python numpy.ma.where() function return a masked array with elements from x or y, depending on condition. Syntax : numpy.ma.where(condition, x, y) Parameter : condition : [array_like, bool] Where True, yield x, otherwise yield y. x, y : [array_like, optional] Values from which to choose. x, y and condition 1 min read numpy.ma.allclose() function - Python numpy.ma.allclose() function returns True if two arrays are element-wise equal within a tolerance. This function is equivalent to allclose except that masked values are treated as equal (default) or unequal, depending on the masked_equal argument. Syntax : numpy.ma.allclose(a, b, masked_equal = True 2 min read numpy.ma.filled() function - Python numpy.ma.filled() function return input as an array with masked data replaced by a fill value. If arr is not a MaskedArray, arr itself is returned. If arr is a MaskedArray and fill_value is None, fill_value is set to arr.fill_value. Syntax : numpy.ma.filled(arr, fill_value = None) Parameters : arr : 1 min read numpy.ma.mask_cols() function | Python In thisnumpy.ma.mask_cols() function, mask columns of a 2D array that contain masked values. This function is a shortcut to mask_rowcols with axis equal to 1. Syntax : numpy.ma.mask_cols(arr, axis = None) Parameters : arr : [array_like, MaskedArray] The array to mask. axis : [int, optional] Axis alo 1 min read Like