class_docstr: Generate profiles of histograms using default statistical functions.
  
  Profiles are:
  
  - 1 dim histograms, all: 'count', 'filled', 'distinct', 'nan', 'most_probable_value', 'overflow', 'underflow'.
  - 1 dim histograms, numeric: mean, std, min, max, p01, p05, p16, p50, p84, p95, p99.
  - 1 dim histograms, boolean: fraction of true entries.
  - 2 dim histograms: count, phi_k correlation constant, p-value and Z-score of contingency test.
  - n dim histograms: count (n >= 3)
  
  :param str read_key: key of the input test data to read from the datastore
  :param str store_key: key of the output data to store in the datastore
  :param list features: features of data-frames to pick up from input data (optional)
  :param list ignore_features: features to ignore (optional)
  :param list var_timestamp: list of timestamp variables (optional)
  :param str hist_col: key for histogram in split dictionary
  :param str index_col: key for index in split dictionary
  :param dict stats_functions: function_name, function(bin_labels, bin_counts) dictionary
class_docstr_tok: ["Generate","profiles","of","histograms","using","default","statistical","functions",".","Profiles","are",":","-","1","dim","histograms",",","all",":","'count","'",",","'filled","'",",","'distinct","'",",","'nan","'",",","'most_probable_value","'",",","'overflow","'",",","'underflow","'",".","-","1","dim","histograms",",","numeric",":","mean",",","std",",","min",",","max",",","p01",",","p05",",","p16",",","p50",",","p84",",","p95",",","p99",".","-","1","dim","histograms",",","boolean",":","fraction","of","true","entries",".","-","2","dim","histograms",":","count",",","phi_k","correlation","constant",",","p-value","and","Z-score","of","contingency","test",".","-","n","dim","histograms",":","count","(","n",">","=","3",")",":","param","str","read_key",":","key","of","the","input","test","data","to","read","from","the","datastore",":","param","str","store_key",":","key","of","the","output","data","to","store","in","the","datastore",":","param","list","features",":","features","of","data-frames","to","pick","up","from","input","data","(","optional",")",":","param","list","ignore_features",":","features","to","ignore","(","optional",")",":","param","list","var_timestamp",":","list","of","timestamp","variables","(","optional",")",":","param","str","hist_col",":","key","for","histogram","in","split","dictionary",":","param","str","index_col",":","key","for","index","in","split","dictionary",":","param","dict","stats_functions",":","function_name",",","function","(","bin_labels",",","bin_counts",")","dictionary"]
code: def _profile_1d_histogram(self, name, hist):
      from popmon.analysis import Profiles
  
      # preprocessing value counts and TS
      is_num = is_numeric(hist)
      is_ts = is_timestamp(hist) or name in self.var_timestamp
  
      bin_labels, values = get_bin_centers(hist)
      bin_counts = np.array([v.entries for v in values])
  
      if len(bin_counts) == 0:
          self.logger.warning(f'Histogram "{name}" is empty; skipping.')
          return {}
  
      if is_ts:
          to_timestamp = np.vectorize(lambda x: pd.to_datetime(x).value)
          bin_labels = to_timestamp(bin_labels)
  
      otype = "num" if is_num else "cat"
  
      # calc 1d-histogram statistics
      profile = {}
      if otype == "cat":
          args = [bin_labels, bin_counts]
      else:
          bin_width = hist.bin_width()
          args = [bin_labels, bin_counts, bin_width]
  
      profile.update(Profiles.run(args, dim=1, htype=otype))
  
      args = [bin_labels, bin_counts]
      profile.update(Profiles.run(args, dim=1, htype="all"))
  
      # difference between htype=None and htype="all" are arguments (bin labels vs hist)
      profile.update(Profiles.run([hist], dim=1, htype=None))
      profile.update(Profiles.run([hist], dim=-1, htype=None))
  
      # postprocessing TS
      if is_ts:
          profile = {
              k: pd.Timestamp(v) if k != "std" else pd.Timedelta(v)
              for k, v in profile.items()
          }
  
      return profile
  
file_path: popmon/popmon/analysis/profiling/hist_profiler.py
imports: import numpy
  import pandas
  from popmon.base import Module
  from popmon.hist.hist_utils import get_bin_centers, is_numeric, is_timestamp
label_desc: Use image node_id 2 for calling the HistProfiler obj's underlying member method code with example usage: obj._profile_1d_histogram(name, hist) and returns: profile, dict