Skip to content

Instantly share code, notes, and snippets.

@jinglescode
Created March 6, 2020 13:23
Show Gist options
  • Save jinglescode/5fc14023f48a08906ec2cd1573208c2d to your computer and use it in GitHub Desktop.
Save jinglescode/5fc14023f48a08906ec2cd1573208c2d to your computer and use it in GitHub Desktop.
from scipy.spatial.distance import cdist
distance_matrix = cdist(
mean_lat_long_by_group.values,
mean_lat_long_by_group.values
)
df_distance_matrix = pd.DataFrame(distance_matrix)
df_distance_matrix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment