(S_dict)
return total_order, first_order, (idx, second_order)
Convert Si information into Pandas DataFrame compatible dict.

    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)

    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)
Convert Si information into Pandas DataFrame compatible dict.
Convert Si information into Pandas DataFrame compatible dict .
def Si_to_pandas_dict(S_dict):
    """Convert Si information into Pandas DataFrame compatible dict.

    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)

    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)
    """
    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)
def Si_to_pandas_dict ( S_dict ) : 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 )