micropython-ulab/tests/2d/numpy/nonzero.py.exp
Zoltán Vörös dfed7a844a
implement nonzero (#540)
* implement nonzero for Boolean arrays

* remove axtls from build script

* extend nonzero to ndarrays of arbitrary dtype, and iterable, fix float tests

* temporarily disable circuitpython tests

* add nonzero documentation

* Added test script for np.nonzero()

Co-authored-by: Tejal Ashwini Barnwal <64950661+tejalbarnwal@users.noreply.github.com>
2022-08-03 20:56:45 +02:00

24 lines
926 B
Text

array([[0.0, 1.0, 2.0, 3.0],
[4.0, 5.0, 6.0, 7.0],
[8.0, 9.0, 10.0, 11.0],
[12.0, 13.0, 14.0, 15.0]], dtype=float64)
array([[True, True, True, True],
[True, False, False, False],
[False, False, False, False],
[False, False, False, False]], dtype=bool)
(array([0, 0, 0, 0, 1], dtype=uint16), array([0, 1, 2, 3, 0], dtype=uint16))
array([[0, 3],
[6, 9]], dtype=uint8)
(array([0, 1, 1], dtype=uint16), array([1, 0, 1], dtype=uint16))
array([[0, 3],
[6, 9]], dtype=int8)
(array([0, 1, 1], dtype=uint16), array([1, 0, 1], dtype=uint16))
array([[0, 3],
[6, 9]], dtype=uint16)
(array([0, 1, 1], dtype=uint16), array([1, 0, 1], dtype=uint16))
array([[0, 3],
[6, 9]], dtype=int16)
(array([0, 1, 1], dtype=uint16), array([1, 0, 1], dtype=uint16))
array([[0.0, 3.0],
[6.0, 9.0]], dtype=float64)
(array([0, 1, 1], dtype=uint16), array([1, 0, 1], dtype=uint16))