def _get_mask(X, value_to_mask):
 if ((value_to_mask == 'NaN') or np.isnan(value_to_mask)):
  return np.isnan(X)
 else:
  return (X == value_to_mask)

def _get_mask ( X , value_to_mask ) : if ( ( value_to_mask == 'NaN' ) or np . isnan ( value_to_mask ) ) : return np . isnan ( X ) else : return ( X == value_to_mask )
compute the boolean mask x == missing_values .