This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy | |
def get_masked_arr(arr, fill_val): | |
''' | |
If a masked array is passed, this function does nothing. | |
If a filled array is passed (fill_value must be passed also), it will be transformed into a masked array. | |
''' | |
if isinstance(arr, numpy.ma.MaskedArray): # numpy.ma.MaskedArray |