class_docstr: NumericalStats contains following basic information:
      - _total_count: total count of values
      - _nan_count: total count of nan values
      - _min: minimum of all values
      - _max: maximum of all values
      - _mean: mean of the values
      - _median: median of the values
      - _sd: standard deviation of the values
      - _histogram: a histogram of value distribution represented by a list of (x_left, x_right, count)
      - _kde: a kernel density estimation curve represented by a list of points
class_docstr_tok: ["NumericalStats","contains","following","basic","information",":","-","_total_count",":","total","count","of","values","-","_nan_count",":","total","count","of","nan","values","-","_min",":","minimum","of","all","values","-","_max",":","maximum","of","all","values","-","_mean",":","mean","of","the","values","-","_median",":","median","of","the","values","-","_sd",":","standard","deviation","of","the","values","-","_histogram",":","a","histogram","of","value","distribution","represented","by","a","list","of","(","x_left",",","x_right",",","count",")","-","_kde",":","a","kernel","density","estimation","curve","represented","by","a","list","of","points"]
docstr: Map stats information into a json object
  
  Returns:
      A json that represent frequency count and total count
docstr_tok: ["Map","stats","information","into","a","json","object","Returns",":","A","json","that","represent","frequency","count","and","total","count"]
code: def to_json(self) -> Dict:
      """
      Map stats information into a json object
  
      Returns:
          A json that represent frequency count and total count
      """
  
      json_obj = dict()
      json_obj[STATSKEY.TOTAL_COUNT] = self._total_count
      json_obj[STATSKEY.MAX] = self._max
      json_obj[STATSKEY.MIN] = self._min
      json_obj[STATSKEY.MEAN] = self._mean
      json_obj[STATSKEY.MEDIAN] = self._median
      json_obj[STATSKEY.STDDEV] = self._sd
      json_obj[STATSKEY.NAN_COUNT] = self._nan_count
  
      json_obj[STATSKEY.DISTRIBUTION] = {}
  
      json_obj[STATSKEY.DISTRIBUTION][STATSKEY.HISTOGRAM] = []
      for bin_left, bin_right, bin_count in self._histogram:
          json_obj[STATSKEY.DISTRIBUTION][STATSKEY.HISTOGRAM].append(
              {
                  STATSKEY.HISTOGRAM_KEY.X_LEFT: bin_left,
                  STATSKEY.HISTOGRAM_KEY.X_RIGHT: bin_right,
                  STATSKEY.HISTOGRAM_KEY.BIN_COUNT: bin_count,
              }
          )
  
      json_obj[STATSKEY.DISTRIBUTION][STATSKEY.KDE] = []
      for x, y in self._kde:
          json_obj[STATSKEY.DISTRIBUTION][STATSKEY.HISTOGRAM].append(
              {STATSKEY.KDE_KEY.X: x, STATSKEY.KDE_KEY.Y: y}
          )
  
      return json_obj
  
imports: from typing import Dict, List, Tuple, Optional, Union
  from xai.data.abstract_stats import AbstractStats
  from xai.data.constants import STATSKEY
  from xai.data.exceptions import InvalidTypeError, InvalidSizeError
label_desc: Use image node_id 18 for calling the NumericalStats obj's underlying member method code with example usage: obj.to_json() and returns: json_obj