code: def has_nans(obj):
      
      nans = np.isnan(obj)
      while np.ndim(nans):
          nans = np.any(nans)
      return bool(nans)
docs: Check if obj has any NaNs
  
      Compatible with different behavior of np.isnan, which sometimes applies
      over all axes (py35, py35) and sometimes does not (py34).