How to maintain or recover Dataframe indexing after running Pairwise Distance function?
<p>I'm using sklearn's pairwise distance function, which saved my life when computing a huge matrix, but the problem I'm having is that I lose my indices.</p>

<p>Specifically, I initially have a huge dataframe of 17000 x 300, which I break down into 4 different dataframes based on some class condition.
The 4 separate dataframes keep the original indices, but after I run the pairwise distance function on one of those dataframes, it gives me back a 2d array with correct values but the indices have been reset from 0 up.</p>

<p><strong>How do I keep or recover the original indices</strong>?</p>

<p><code>distance1 = pair.pairwise_distances(df1, metric='euclidean')</code></p>