code: def normalized_hist_mean_cov(x, hist_name: str = ""):
      """Mean normalized histogram and its covariance of list of input histograms
  
      Usage: df['hists'].apply(normalized_hist_mean_cov) ; series.apply(normalized_hist_mean_cov)
  
      :param pd.Series x: pandas series to extract histogram list from.
      :param str hist_name: name of column to extract histograms from. needs to be set with axis=1 (optional)
      :return: mean normalized histogram, covariance probability matrix
      """
      assert isinstance(x, pd.Series)
      if len(hist_name) > 0 and hist_name in x:
          hist_list = x[hist_name]
      else:
          hist_list = x.values
          if len(hist_name) == 0:
              hist_name = "histogram"
  
      if len(hist_list) == 0:
          raise ValueError("List of input histograms is empty.")
  
      # initialize
      o = {
          hist_name + "_mean": None,
          hist_name + "_cov": None,
          hist_name + "_binning": None,
      }
  
      # basic checks
      all_hist = all(
          isinstance(hist, COMMON_HIST_TYPES) for hist in hist_list
      )
      if not all_hist:
          return pd.Series(o)
      similar = check_similar_hists(hist_list)
      if not similar:
          return pd.Series(o)
  
      # get entries as numpy arrays
      if hist_list[0].n_dim == 1:
          entries_list, binning = get_consistent_numpy_entries(
              hist_list, get_bin_labels=True
          )
          entries_list = np.array(entries_list, dtype=float)
      else:
          entries_list, keys = get_consistent_numpy_2dgrids(
              hist_list, get_bin_labels=True
          )
          entries_list = np.array(
              [h.flatten() for h in entries_list], dtype=float
          )
          binning = tuple(keys)
  
      # calculation of mean normalized histogram and its covariance matrix
      (
          normalized_hist_mean,
          normalized_hist_covariance,
      ) = probability_distribution_mean_covariance(entries_list)
  
      o[hist_name + "_mean"] = normalized_hist_mean
      o[hist_name + "_cov"] = normalized_hist_covariance
      o[hist_name + "_binning"] = binning
      return pd.Series(o)
  
imports: import numpy
  import pandas
  from numpy.lib.stride_tricks import as_strided
  from scipy import linalg, stats
  from scipy.stats import linregress, norm
  from popmon.analysis.hist_numpy import check_similar_hists, get_consistent_numpy_2dgrids, get_consistent_numpy_entries, set_2dgrid
  from popmon.hist.hist_utils import COMMON_HIST_TYPES, is_numeric
  from popmon.stats.numpy import probability_distribution_mean_covariance
label_desc: Use image node_id 17 for calling a global function with example usage: normalized_hist_mean_cov(x, hist_name) and returns: pd, pd, pd