class_docstr: An :class:`NAAction` object defines a strategy for handling missing
  data.
  
  "NA" is short for "Not Available", and is used to refer to any value which
  is somehow unmeasured or unavailable. In the long run, it is devoutly
  hoped that numpy will gain first-class missing value support. Until then,
  we work around this lack as best we're able.
  
  There are two parts to this: First, we have to determine what counts as
  missing data. For numerical data, the default is to treat NaN values
  (e.g., ``numpy.nan``) as missing. For categorical data, the default is to
  treat NaN values, and also the Python object None, as missing. (This is
  consistent with how pandas does things, so if you're already using
  None/NaN to mark missing data in your pandas DataFrames, you're good to
  go.)
  
  Second, we have to decide what to do with any missing data when we
  encounter it. One option is to simply discard any rows which contain
  missing data from our design matrices (``drop``). Another option is to
  raise an error (``raise``). A third option would be to simply let the
  missing values pass through into the returned design matrices. However,
  this last option is not yet implemented, because of the lack of any
  standard way to represent missing values in arbitrary numpy matrices;
  we're hoping numpy will get this sorted out before we standardize on
  anything ourselves.
  
  You can control how patsy handles missing data through the ``NA_action=``
  argument to functions like :func:`build_design_matrices` and
  :func:`dmatrix`. If all you want to do is to choose between ``drop`` and
  ``raise`` behaviour, you can pass one of those strings as the
  ``NA_action=`` argument directly. If you want more fine-grained control
  over how missing values are detected and handled, then you can create an
  instance of this class, or your own object that implements the same
  interface, and pass that as the ``NA_action=`` argument instead.
class_docstr_tok: ["An",":","class",":","`","NAAction","`","object","defines","a","strategy","for","handling","missing","data",".","``","NA","''","is","short","for","``","Not","Available","''",",","and","is","used","to","refer","to","any","value","which","is","somehow","unmeasured","or","unavailable",".","In","the","long","run",",","it","is","devoutly","hoped","that","numpy","will","gain","first-class","missing","value","support",".","Until","then",",","we","work","around","this","lack","as","best","we","'re","able",".","There","are","two","parts","to","this",":","First",",","we","have","to","determine","what","counts","as","missing","data",".","For","numerical","data",",","the","default","is","to","treat","NaN","values","(","e.g.",",","``","numpy.nan","``",")","as","missing",".","For","categorical","data",",","the","default","is","to","treat","NaN","values",",","and","also","the","Python","object","None",",","as","missing",".","(","This","is","consistent","with","how","pandas","does","things",",","so","if","you","'re","already","using","None\/NaN","to","mark","missing","data","in","your","pandas","DataFrames",",","you","'re","good","to","go",".",")","Second",",","we","have","to","decide","what","to","do","with","any","missing","data","when","we","encounter","it",".","One","option","is","to","simply","discard","any","rows","which","contain","missing","data","from","our","design","matrices","(","``","drop","``",")",".","Another","option","is","to","raise","an","error","(","``","raise","``",")",".","A","third","option","would","be","to","simply","let","the","missing","values","pass","through","into","the","returned","design","matrices",".","However",",","this","last","option","is","not","yet","implemented",",","because","of","the","lack","of","any","standard","way","to","represent","missing","values","in","arbitrary","numpy","matrices",";","we","'re","hoping","numpy","will","get","this","sorted","out","before","we","standardize","on","anything","ourselves",".","You","can","control","how","patsy","handles","missing","data","through","the","``","NA_action=","``","argument","to","functions","like",":","func",":","`","build_design_matrices","`","and",":","func",":","`","dmatrix","`",".","If","all","you","want","to","do","is","to","choose","between","``","drop","``","and","``","raise","``","behaviour",",","you","can","pass","one","of","those","strings","as","the","``","NA_action=","``","argument","directly",".","If","you","want","more","fine-grained","control","over","how","missing","values","are","detected","and","handled",",","then","you","can","create","an","instance","of","this","class",",","or","your","own","object","that","implements","the","same","interface",",","and","pass","that","as","the","``","NA_action=","``","argument","instead","."]
docstr: Returns a 1-d mask array indicating which rows in an array of
  numerical values contain at least one NA value.
  
  Note that here `arr` is a numpy array or pandas DataFrame.
docstr_tok: ["Returns","a","1-d","mask","array","indicating","which","rows","in","an","array","of","numerical","values","contain","at","least","one","NA","value",".","Note","that","here","`","arr","`","is","a","numpy","array","or","pandas","DataFrame","."]
code: def is_numerical_NA(self, arr):
      """Returns a 1-d mask array indicating which rows in an array of
      numerical values contain at least one NA value.
  
      Note that here `arr` is a numpy array or pandas DataFrame."""
      mask = np.zeros(arr.shape, dtype=bool)
      if "NaN" in self.NA_types:
          mask |= np.isnan(arr)
      if mask.ndim > 1:
          mask = np.any(mask, axis=1)
      return mask
  
file_path: patsy/patsy/missing.py
imports: import numpy
  from patsy import PatsyError
  from patsy.util import safe_isnan, safe_scalar_isnan, no_pickling, assert_no_pickling
label_desc: Use image node_id 3 for calling the NAAction obj's underlying member method code with example usage: obj.is_numerical_NA(arr) and returns: mask