original_docstring: Returns an array where missing values are replaced by value.
  
      If the dtype is object, nan values and 'nan' string values
      are replaced by value when fill_nan==True.
      
docstring: Returns an array where missing values are replaced by value.
  If the dtype is object, nan values and 'nan' string values
  are replaced by value when fill_nan==True.
docstring_tokens: Returns an array where missing values are replaced by value . If the dtype is object nan values and ' nan ' string values are replaced by value when fill_nan == True .
code: def fillna(ar, value, fill_nan=True, fill_masked=True):
      '''Returns an array where missing values are replaced by value.
  
      If the dtype is object, nan values and 'nan' string values
      are replaced by value when fill_nan==True.
      '''
      if ar.dtype.kind in 'O' and fill_nan:
          strings = ar.astype(str)
          mask = strings == 'nan'
          ar = ar.copy()
          ar[mask] = value
      elif ar.dtype.kind in 'f' and fill_nan:
          mask = np.isnan(ar)
          if np.any(mask):
              ar = ar.copy()
              ar[mask] = value
      if fill_masked and np.ma.isMaskedArray(ar):
          mask = ar.mask
          if np.any(mask):
              ar = ar.data.copy()
              ar[mask] = value
      return ar
code_tokens: def fillna ( ar , value , fill_nan = True , fill_masked = True ) : if ar . dtype . kind in 'O' and fill_nan : strings = ar . astype ( str ) mask = strings == 'nan' ar = ar . copy ( ) ar [ mask ] = value elif ar . dtype . kind in 'f' and fill_nan : mask = np . isnan ( ar ) if np . any ( mask ) : ar = ar . copy ( ) ar [ mask ] = value if fill_masked and np . ma . isMaskedArray ( ar ) : mask = ar . mask if np . any ( mask ) : ar = ar . data . copy ( ) ar [ mask ] = value return ar
short_docstring: Returns an array where missing values are replaced by value.
short_docstring_tokens: Returns an array where missing values are replaced by value .
comment: '''Returns an array where missing values are replaced by value.
  
      If the dtype is object, nan values and 'nan' string values
      are replaced by value when fill_nan==True.
      '''