Formatting indices for python2.6