ulfaslak / infostop

Python package for detecting stops in trajectory data
Other
62 stars 9 forks source link

Increase efficiency when assigning labels #1

Closed lalessan closed 5 years ago

lalessan commented 5 years ago

Hey Ulf, thanks for the awesome code. This part runs a bit slowly and it should be possible to make it faster.

     # Label all the input points and return that label vector
     coord_labels = np.ones(shape=coords.shape[0], dtype=int) * (-1)
     for gid, lab in enumerate((labels)):
         coord_labels[medoid_map == gid] = lab