Calculating distance between two elements only in the array in python
Question: So I have two questions: First I'm trying to print my array that contains 1004
elements but it's printing only the first 29 elements and then jumping to 974
to continue printing. How can I get the full array of 1004 elements?

This is my code

    
    
    paired_data = []
    for x in data:
        closest, ignored = pairwise_distances_argmin_min(x, result)
        paired_data.append([x, result[closest]])
    #print paired_data
    S = pd.DataFrame(paired_data, columns=['x','center'])
    print S
    # distance
    Y = pdist(S, 'euclidean')
    print Y
    

Also I want to calculate the distance between each two elements of the array.
for example

0 [5, 4] [3, 2]

1 [22, -10] [78, 90]

I want to calculate the distance( Euclidean ) between [5, 4] and [3, 2] and so
on for all the rest of the array.


Answer: Another solution to #1:

    
    
    print(S.to_string())    # print the entire table
    

and to get distances

    
    
    # assumes Python 3
    from functools import partial
    
    def dist(row, col1, col2):
        return sum((c2 - c1)**2 for c1,c2 in zip(row[col1], row[col2])) ** 0.5
    
    # compose a function (name the columns it applies to)
    s_dist = partial(dist, col1="x", col2="center")
    # apply it
    S["dist"] = S.apply(s_dist, axis=1)
    

