# Argwhere problem

**URL:** <https://numba.discourse.group/t/argwhere-problem/1074>\
**Category:** Numba\
**Created:** [December 15, 2021, 6:45pm UTC](https://numba.discourse.group/t/argwhere-problem/1074 "2021-12-15T18:45:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![queency](https://avatars.discourse-cdn.com/v4/letter/q/13edae/32.png) [@queency](https://numba.discourse.group/u/queency)\
**Post date:** [December 15, 2021, 6:45pm UTC](https://numba.discourse.group/t/argwhere-problem/1074/1 "2021-12-15T18:45:44Z")

</div>

1 import numpy as np  
2 from numba import njit,jit  
3  
4 @njit  
5 def gpuu(x,y):  
6 return np.argwhere((x==y))  
7  
8  
9 a = np.array(range(10000))  
10 gpuu(50000,a)  
11  
~  
~  
create the following error

Traceback (most recent call last):  
File “gpu.py”, line 10, in   
gpuu(50000,a)  
File “/usr/lib/python3/dist-packages/numba/dispatcher.py”, line 348, in \_compile\_for\_args  
error\_rewrite(e, ‘typing’)  
File “/usr/lib/python3/dist-packages/numba/dispatcher.py”, line 315, in error\_rewrite  
reraise(type(e), e, None)  
File “/usr/lib/python3/dist-packages/numba/six.py”, line 658, in reraise  
raise value.with\_traceback(tb)  
numba.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)  
Use of unsupported NumPy function ‘numpy.argwhere’ or unsupported use of the function.

File “gpu.py”, line 6:  
def gpuu(x,y):  
return np.argwhere((x==y))  
^

[1] During: typing of get attribute at gpu.py (6)

File “gpu.py”, line 6:  
def gpuu(x,y):  
return np.argwhere((x==y))  
^

This is not usually a problem with Numba itself but instead often caused by  
the use of unsupported features or an issue in resolving types.

To see Python/NumPy features supported by the latest release of Numba visit:

and

For more information about typing errors and how to debug them visit:

If you think your code should work with Numba, please report the error message  
and traceback, along with a minimal reproducer at:

> **[Build software better, together](https://github.com/numba/numba/issues/new)**
>
> GitHub is where people build software. More than 73 million people use GitHub to discover, fork, and contribute to over 200 million projects.

can you assist ?

---

<div class="post-metadata">

**Author:** ![Rutger](https://yyz2.discourse-cdn.com/free1/user_avatar/numba.discourse.group/rutger/32/446_2.png) [@Rutger](https://numba.discourse.group/u/Rutger)\
**Post date:** [December 16, 2021, 8:13am UTC](https://numba.discourse.group/t/argwhere-problem/1074/2 "2021-12-16T08:13:30Z")

</div>

Hey,

What version of Numba are you using? I can’t replicate your result with Numba version 0.54.1.

Using:

```python
from numba import njit
import numpy as np

@njit
def numba_argwhere(x, y):
    return np.argwhere(x==y)

def numpy_argwhere(x, y):
    return np.argwhere(x==y)

x = np.array(range(10000))
y = np.random.randint(x.size)

nb_res = numba_argwhere(x, y)
np_res = numpy_argwhere(x, y)

assert np.allclose(np_res, nb_res)

```

Regards,  
Rutger

---

<div class="post-metadata">

**Author:** ![queency](https://avatars.discourse-cdn.com/v4/letter/q/13edae/32.png) [@queency](https://numba.discourse.group/u/queency)\
**Post date:** [December 19, 2021, 9:11am UTC](https://numba.discourse.group/t/argwhere-problem/1074/3 "2021-12-19T09:11:07Z")

</div>

my version is:  
0.42.0

---

<div class="post-metadata">

**Author:** ![Hannes](https://yyz2.discourse-cdn.com/free1/user_avatar/numba.discourse.group/hannes/32/188_2.png) [@Hannes](https://numba.discourse.group/u/Hannes)\
**Post date:** [December 19, 2021, 9:19am UTC](https://numba.discourse.group/t/argwhere-problem/1074/4 "2021-12-19T09:19:19Z")

</div>

Hi @queency

In that case please try updating your numba installation, that version is almost 3 years old at this point, and there are improvements and new features added to numba all the time.

---

<div class="post-metadata">

**Author:** ![queency](https://avatars.discourse-cdn.com/v4/letter/q/13edae/32.png) [@queency](https://numba.discourse.group/u/queency)\
**Post date:** [December 22, 2021, 3:33am UTC](https://numba.discourse.group/t/argwhere-problem/1074/5 "2021-12-22T03:33:38Z")

</div>

Can you direct me with upgrading numba ?  
Is there an easy way to upgrade via repository (numba only upgrade)  
Should i use the egg file or should i just download that latest and put the directory in position?

---

<div class="post-metadata">

**Author:** ![Hannes](https://yyz2.discourse-cdn.com/free1/user_avatar/numba.discourse.group/hannes/32/188_2.png) [@Hannes](https://numba.discourse.group/u/Hannes)\
**Post date:** [December 22, 2021, 7:41am UTC](https://numba.discourse.group/t/argwhere-problem/1074/6 "2021-12-22T07:41:20Z")

</div>

That depends a lot on your particular setup, but unless you are on some very obscure system, numba can be updated like any other python package.

If you don’t know how to do that, then I suggest you ping me (@HPLegion) on numba’s gitter channel ([numba/numba - Gitter](https://gitter.im/numba/numba)) and I can try to talk you through it. Gitter is better suited for quick step by step messages.
