code: def Si_to_pandas_dict(S_dict):
      """Convert Si information into Pandas DataFrame compatible dict.
  
  
      Examples
      --------
      >>> X = saltelli.sample(problem, 512)
      >>> Y = Ishigami.evaluate(X)
      >>> Si = sobol.analyze(problem, Y, print_to_console=True)
      >>> T_Si, first_Si, (idx, second_Si) = sobol.Si_to_pandas_dict(Si, problem)
  
  
      Parameters
      ----------
      S_dict : ResultDict
          Sobol sensitivity indices
  
      See Also
      --------
      Si_list_to_dict
  
      Returns
      -------
      tuple : of total, first, and second order sensitivities.
              Total and first order are dicts.
              Second order sensitivities contain a tuple of parameter name
              combinations for use as the DataFrame index and second order
              sensitivities.
              If no second order indices found, then returns tuple of
              (None, None)
      """
      problem = S_dict.problem
      total_order = {"ST": S_dict["ST"], "ST_conf": S_dict["ST_conf"]}
      first_order = {"S1": S_dict["S1"], "S1_conf": S_dict["S1_conf"]}
  
      idx = None
      second_order = None
      if "S2" in S_dict:
          groups = _check_groups(problem)
          if groups:
              names, _ = extract_group_names(groups)
          else:
              names = problem.get("names")
  
          if len(names) > 2:
              idx = list(combinations(names, 2))
          else:
              idx = (names,)
  
          second_order = {
              "S2": [
                  S_dict["S2"][names.index(i[0]), names.index(i[1])]
                  for i in idx
              ],
              "S2_conf": [
                  S_dict["S2_conf"][
                      names.index(i[0]), names.index(i[1])
                  ]
                  for i in idx
              ],
          }
      return total_order, first_order, (idx, second_order)
  
imports: from types import MethodType
  from warnings import warn
  from scipy.stats import norm
  import numpy
  import pandas
  from .None import common_args
  from ..util import read_param_file, ResultDict, extract_group_names, _check_groups
  from multiprocessing import Pool, cpu_count
  from functools import partial
  from itertools import combinations, zip_longest
label_desc: Use image node_id 10 for calling a global function with example usage: Si_to_pandas_dict(S_dict) and returns: total_order,  first_order,  idx,  second_order