class_docstr: Base class for generator of stats proto from generic data.
class_docstr_tok: ["Base","class","for","generator","of","stats","proto","from","generic","data","."]
docstr: Converts a Numpy dtype to a converter method if applicable.
  
    The converter method takes in a numpy array of objects of the provided
    dtype
    and returns a numpy array of the numbers backing that object for
    statistical
    analysis. Returns None if no converter is necessary.
  
  Args:
    dtype: The numpy dtype to make a converter for.
  
  Returns:
    The converter method or None.
docstr_tok: ["Converts","a","Numpy","dtype","to","a","converter","method","if","applicable",".","The","converter","method","takes","in","a","numpy","array","of","objects","of","the","provided","dtype","and","returns","a","numpy","array","of","the","numbers","backing","that","object","for","statistical","analysis",".","Returns","None","if","no","converter","is","necessary",".","Args",":","dtype",":","The","numpy","dtype","to","make","a","converter","for",".","Returns",":","The","converter","method","or","None","."]
code: def DtypeToNumberConverter(self, dtype):
      """Converts a Numpy dtype to a converter method if applicable.
  
        The converter method takes in a numpy array of objects of the provided
        dtype
        and returns a numpy array of the numbers backing that object for
        statistical
        analysis. Returns None if no converter is necessary.
  
      Args:
        dtype: The numpy dtype to make a converter for.
  
      Returns:
        The converter method or None.
      """
      if np.issubdtype(dtype, np.datetime64):
  
          def DatetimesToNumbers(dt_list):
              return np.array(
                  [pd.Timestamp(dt).value for dt in dt_list]
              )
  
          return DatetimesToNumbers
      elif np.issubdtype(dtype, np.timedelta64):
  
          def TimedetlasToNumbers(td_list):
              return np.array(
                  [pd.Timedelta(td).value for td in td_list]
              )
  
          return TimedetlasToNumbers
      else:
          return None
  
file_path: facets/facets_overview/facets_overview/base_generic_feature_statistics_generator.py
imports: import numpy
  import pandas
  import sys
label_desc: Use image node_id 4 for calling the BaseGenericFeatureStatisticsGenerator obj's underlying member method code with example usage: obj.DtypeToNumberConverter(dtype) and returns: DatetimesToNumbers, np, TimedetlasToNumbers, None, np