def _make_masked_array(data, mask):
 if len(data):
  return ma.array(np.array(data), mask=np.array(mask, dtype=u'bool'))
 else:
  return ma.array(np.array(data))

def _make_masked_array ( data , mask ) : if len ( data ) : return ma . array ( np . array ( data ) , mask = np . array ( mask , dtype = u'bool' ) ) else : return ma . array ( np . array ( data ) )
masked arrays of zero length that also have a mask of zero length cause problems in numpy .