File: test_isin.py

package info (click to toggle)
python-npx 0.1.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 168 kB
  • sloc: python: 330; makefile: 3
file content (19 lines) | stat: -rw-r--r-- 325 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import numpy as np

import npx


def test_isin():
    a = [[0, 3], [1, 0]]
    b = [[1, 0], [7, 12], [-1, 5]]

    out = npx.isin_rows(a, b)
    assert np.all(out == [False, True])


def test_scalar():
    a = [0, 3, 5]
    b = [-1, 6, 5, 0, 0, 0]

    out = npx.isin_rows(a, b)
    assert np.all(out == [True, False, True])