def paths_and_probs_to_dict(paths, probs, normalize=False):
    """Turn paths and path probabilities as returned from Transition Path Theory into dictionary.

    Parameters
    ----------
    paths : 1D numpy.ndarray.
        Array of paths where each path is a numpy array of integer on its own.

    probs : 1D numpy.ndarray.
        Array of path probabailities.

    Returns
    -------
    paths_dict : dict.
        Dictionary of paths (tuples) and probabilities (float)
    """
    pathlist = list(tuple(path) for path in paths)

    if normalize:
        psum = sum(probs)
        pathproblist = [prob/psum for prob in probs]
    else:
        pathproblist = list(probs)

    paths_dict = dict(zip(pathlist, pathproblist))

    return paths_dict