If you have a list of locations, you could just iterate over the list in steps of two:
import numpy as np
# List of locations
locs = [1, 10, 12, 14] # …possibly more
# List for storing linspace output
lins = list()
# Iterate over the locations list in steps of two
for i in range(0, len(locs), 2):
lins.append(np.linspace(locs[i], locs[i+1]))
Note that this solution only works if the number of elements in the locations
list is even. If the number of elements is odd you'll need to modify the for loop; something like:
for i in range(0, len(locs)-1, 2):
Since you're asking about computing the linspace between pairs of elements, your last element would have no paired element anyway.