Closed tejalbarnwal closed 2 years ago
nonzero
works with arrays of arbitrary dtype
, so e.g., this is also valid:
>>> a = np.array(range(9), dtype=np.uint8).reshape((3,3)) - 4
>>> print(np.nonzero(a))
You can simply loop through the types like in https://github.com/v923z/micropython-ulab/blob/master/tests/2d/numpy/arange.py. Would you mind adding this, so that the test would be complete?
sure, I will update with this
sure, I will update with this
OK, thanks! Let me know when are ready. The rest of the PR is done, so as soon as you can update your test script, we could merge this into master.
I have updated the script to loop through different data types
Fantastic! Many thanks for sticking with it till the very end! I hope you enjoyed the ride, and I am looking forward to your future contributions.
Yes, sure
added following script at
ulab/tests/2d/numpy/nonzero.py
The expected output file is located at
ulab/tests/2d/numpy/nonzero.py.exp
Expected output: