class_docstr: A data object for netcdf files.
  
  `netcdf_variable` objects are constructed by calling the method
  `netcdf_file.createVariable` on the `netcdf_file` object. `netcdf_variable`
  objects behave much like array objects defined in numpy, except that their
  data resides in a file. Data is read by indexing and written by assigning
  to an indexed subset; the entire array can be accessed by the index ``[:]``
  or (for scalars) by using the methods `getValue` and `assignValue`.
  `netcdf_variable` objects also have attribute `shape` with the same meaning
  as for arrays, but the shape cannot be modified. There is another read-only
  attribute `dimensions`, whose value is the tuple of dimension names.
  
  All other attributes correspond to variable attributes defined in
  the NetCDF file. Variable attributes are created by assigning to an
  attribute of the `netcdf_variable` object.
  
  Parameters
  ----------
  data : array_like
      The data array that holds the values for the variable.
      Typically, this is initialized as empty, but with the proper shape.
  typecode : dtype character code
      Desired data-type for the data array.
  size : int
      Desired element size for the data array.
  shape : sequence of ints
      The shape of the array. This should match the lengths of the
      variable's dimensions.
  dimensions : sequence of strings
      The names of the dimensions used by the variable. Must be in the
      same order of the dimension lengths given by `shape`.
  attributes : dict, optional
      Attribute values (any type) keyed by string names. These attributes
      become attributes for the netcdf_variable object.
  maskandscale : bool, optional
      Whether to automatically scale and/or mask data based on attributes.
      Default is False.
  
  
  Attributes
  ----------
  dimensions : list of str
      List of names of dimensions used by the variable object.
  isrec, shape
      Properties
  
  See also
  --------
  isrec, shape
class_docstr_tok: ["A","data","object","for","netcdf","files",".","`","netcdf_variable","`","objects","are","constructed","by","calling","the","method","`","netcdf_file.createVariable","`","on","the","`","netcdf_file","`","object",".","`","netcdf_variable","`","objects","behave","much","like","array","objects","defined","in","numpy",",","except","that","their","data","resides","in","a","file",".","Data","is","read","by","indexing","and","written","by","assigning","to","an","indexed","subset",";","the","entire","array","can","be","accessed","by","the","index","``","[",":","]","``","or","(","for","scalars",")","by","using","the","methods","`","getValue","`","and","`","assignValue","`",".","`","netcdf_variable","`","objects","also","have","attribute","`","shape","`","with","the","same","meaning","as","for","arrays",",","but","the","shape","can","not","be","modified",".","There","is","another","read-only","attribute","`","dimensions","`",",","whose","value","is","the","tuple","of","dimension","names",".","All","other","attributes","correspond","to","variable","attributes","defined","in","the","NetCDF","file",".","Variable","attributes","are","created","by","assigning","to","an","attribute","of","the","`","netcdf_variable","`","object",".","Parameters","--","--","--","--","--","data",":","array_like","The","data","array","that","holds","the","values","for","the","variable",".","Typically",",","this","is","initialized","as","empty",",","but","with","the","proper","shape",".","typecode",":","dtype","character","code","Desired","data-type","for","the","data","array",".","size",":","int","Desired","element","size","for","the","data","array",".","shape",":","sequence","of","ints","The","shape","of","the","array",".","This","should","match","the","lengths","of","the","variable","'s","dimensions",".","dimensions",":","sequence","of","strings","The","names","of","the","dimensions","used","by","the","variable",".","Must","be","in","the","same","order","of","the","dimension","lengths","given","by","`","shape","`",".","attributes",":","dict",",","optional","Attribute","values","(","any","type",")","keyed","by","string","names",".","These","attributes","become","attributes","for","the","netcdf_variable","object",".","maskandscale",":","bool",",","optional","Whether","to","automatically","scale","and\/or","mask","data","based","on","attributes",".","Default","is","False",".","Attributes","--","--","--","--","--","dimensions",":","list","of","str","List","of","names","of","dimensions","used","by","the","variable","object",".","isrec",",","shape","Properties","See","also","--","--","--","--","isrec",",","shape"]
docstr: Applies the given missing value to the data array.
  
  Returns a numpy.ma array, with any value equal to missing_value masked
  out (unless missing_value is None, in which case the original array is
  returned).
docstr_tok: ["Applies","the","given","missing","value","to","the","data","array",".","Returns","a","numpy.ma","array",",","with","any","value","equal","to","missing_value","masked","out","(","unless","missing_value","is","None",",","in","which","case","the","original","array","is","returned",")","."]
code: def _apply_missing_value(data, missing_value):
      """
      Applies the given missing value to the data array.
  
      Returns a numpy.ma array, with any value equal to missing_value masked
      out (unless missing_value is None, in which case the original array is
      returned).
      """
  
      if missing_value is None:
          newdata = data
      else:
          try:
              missing_value_isnan = np.isnan(missing_value)
          except (TypeError, NotImplementedError):
              # some data types (e.g., characters) cannot be tested for NaN
              missing_value_isnan = False
  
          if missing_value_isnan:
              mymask = np.isnan(data)
          else:
              mymask = data == missing_value
  
          newdata = np.ma.masked_where(mymask, data)
  
      return newdata
  
imports: import warnings
  import weakref
  from operator import mul
  from platform import python_implementation
  import mmap
  import numpy
  from numpy import frombuffer, dtype, empty, array, asarray
  from numpy import little_endian
  from functools import reduce
label_desc: Use image node_id 14 for calling the netcdf_variable obj's underlying member method code with example usage: obj._apply_missing_value(data, missing_value) and returns: newdata