micropython-ulab/tests/2d/numpy/methods.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

35 lines
1,019 B
Text

array([1, 2, 3, 4], dtype=int8)
array([[1, 2, 3],
[4, 5, 6],
[7, 8, 9]], dtype=int16)
array([[1.0, 2.0, 3.0],
[4.0, 5.0, 6.0],
[7.0, 8.0, 9.0]], dtype=float64)
100
array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0], dtype=float64)
1
2
1
2
8
(3,)
(3, 1)
array([[1.0, 2.0, 3.0]], dtype=float64)
3
3
bytearray(b'\x01\x02\x03')
bytearray(b'\x01\x02\x03')
(3,)
(1, 3)
array([1, 2, 3, 4, 5, 6], dtype=uint8)
array([1, 2, 3, 4, 5, 6], dtype=uint8)
array([1, 2, 3, 4, 5, 6], dtype=uint8)
array([1, 2, 3, 4, 5, 6], dtype=uint8)
array([1, 2, 3, 4, 5, 6], dtype=uint16)
array([256, 512, 768, 1024, 1280, 1536], dtype=uint16)
array([256, 512, 768, 1024, 1280, 1536], dtype=uint16)
array([256, 512, 768, 1024, 1280, 1536], dtype=uint16)
array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], dtype=float64)
array([1e-318, 1e-321, 1e-319, 1e-319, 1e-319, 1e-319], dtype=float64)
array([1e-318, 1e-321, 1e-319, 1e-319, 1e-319, 1e-319], dtype=float64)
array([1e-318, 1e-321, 1e-319, 1e-319, 1e-319, 1e-319], dtype=float64)