I am iterating over many lists of gpx data to create a plot of cumulative training for 2016. To do so, I set up a loop as follows, where paces is a list of lists of smoothed pacing data from each gpx file and total_distances the associated distances computed from the coordinate data.
for i in range(0, len(paces)):
if i == 0:
# need offset on paces from filtered data/NaN
plt.plot(total_distances[i:i+1][0],
paces[i:i+1][0][10:len(paces[i:i+1][0])+1],
linewidth=.5, ls='-', color='#00FF00', label = 'all runs')
else:
plt.plot(total_distances[i:i+1][0],
paces[i:i+1][0][10:len(paces[i:i+1][0])+1],
linewidth=.5, ls='-', color='#00FF00')
If I do not use the above conditional, the label gets printed as many times as there are lists.
Any suggestions for a my pythonic way of doing this?

total_distances[i:i+1][0]is exactlytotal_distances[i](same withpaces).