How to merge 2 i-th element of arrays
The
zip()
function returns a zip object, which is an iterator of tuples where the first item in each passed iterator is paired together, and then the second item in each passed iterator are paired together etc. If the passed iterators have different lengths, the iterator with the least items decides the length of the new iterator.
POS = [i+' '+k for i, k in zip(RA,DEC)]
Use zip
>>> POS = [(i + '\t' + j) for (i,j) in zip(RA, DEC)]
>>> for i in POS:
print(i)
20 12 40.0319 -02 08 39.97
15 15 48.4459 -37 09 16.03
10 57 3.0215 +22 42 39.07