def _formatter_array_regions(x, centers, window=1, tab_count=0):
    xl = len(x)
    x = np.asarray(x)
    header = ("\t"*tab_count + 'center\tarray values\n' +
              "\t"*tab_count + '------\t------------\n')
    return header + '\n'.join(
        ["\t"*tab_count + "{c}: \t {vals}".format(
            c=c, vals=x[np.max([0, c-window]):np.min([xl, c + window + 1])])
         for c in centers])
Returns a formatted string of sub-sections of an array
dataset/ETHPy150Open scikit-beam/scikit-beam/skbeam/core/spectroscopy.py/_formatter_array_regions