File: test_sorted_nearest.py

package info (click to toggle)
sorted-nearest 0.0.39%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 324 kB
  • sloc: python: 215; sh: 20; makefile: 8
file content (14 lines) | stat: -rw-r--r-- 285 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from sorted_nearest.src.sorted_nearest import nearest

import pandas as pd
import numpy as np

l_s = np.array([3, 4, 7, 8])
l_e = np.array([4, 5, 9, 11])

r_s = np.array([1, 5, 8])
r_e = np.array([2, 6, 10])

idx_l, idx_r, dist = nearest(l_s, l_e, r_s, r_e)

print(idx_l, idx_r, dist)