added comment

This commit is contained in:
Izzy Cole 2025-11-02 14:02:36 +00:00
parent 3ffddb1638
commit da7e7ab5b0

View file

@ -113,7 +113,7 @@ def get_dist_series_list(brand: str, n_locs: int):
# split the distances matrix into a list of series, which allows us to sort each row # split the distances matrix into a list of series, which allows us to sort each row
dist_series_list = [] dist_series_list = []
for i in dist_matrix: for i in dist_matrix:
dist_series_list.append(pd.Series(i).sort_values().head(n_locs+1)[1:]) dist_series_list.append(pd.Series(i).sort_values().head(n_locs+1)[1:]) #ignore the 0th element (dist to itself)
cached_series[brand] = (n_locs, dist_series_list) cached_series[brand] = (n_locs, dist_series_list)