简体   繁体   中英

Closest, index and minimum distance between points

I have a code that calculates the distance between closest points in a list, by using cdist.

However, I would like an improved version also gives me the index of the Points .

    distance.cdist(Coordinates,Points).min(axis=1)

Use argmin instead.

( padding)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM