code: def perform_univariate_dataframe_analysis(
      df: Optional[pd.DataFrame], col_types: dict
  ) -> dict:
      """
      Returns a python dict containing information about each column of a pandas DataFrame.
      The computed information depends on the type of the column.
  
      Parameters
      ----------
      df : pd.DataFrame
          The dataframe on which the analysis will be performed
      col_types : dict
          Dict of types for each column
  
      Returns
      -------
      d : dict
          A dict containing each column as keys and the corresponding dict of information for each column as values.
      """
      if df is None:
          return dict()
      d = df.describe().to_dict()
      for col in df.columns:
          if col_types[col] == VarType.TYPE_CAT:
              d[col] = {
                  "distinct values": df[col].nunique(),
                  "missing values": df[col].isna().sum(),
              }
  
      for col in d.keys():
          for stat in d[col].keys():
              if stat in ["count", "distinct values"]:
                  d[col][stat] = int(
                      d[col][stat]
                  )  # Keeping the exact number here
              elif isinstance(d[col][stat], float):
                  d[col][stat] = round_to_k(
                      d[col][stat], 3
                  )  # Rounding to 3 important figures
  
      replace_dict_values(d, display_value, ",", ".")
  
      return d
  
imports: from typing import Optional
  import pandas
  from shapash.report.common import VarType, display_value, replace_dict_values
  from shapash.webapp.utils.utils import round_to_k
label_desc: Use image node_id 2 for calling a global function with example usage: perform_univariate_dataframe_analysis(df, col_types) and returns: d, dict