Hi all, pretty simple question but I am held back.

Let us consider the case where I have created a NumPy array which is valid.

Consider the example:

```[[1,2,3,4],
[2,3,NaN,5],
[NaN,5,2,3]]```

And now, let us say that I want to be presented with a certain list that consists of all of the index values of the missing elements. In this case, the missing elements is [(1,2),(2,0)] as you can see.

How can I go about doing this?

Appreciate all the help!

Jan 30, 2019 in Python 16,188 views

## 1 answer to this question.

Hi, it is pretty simple, to be honest. Check this out:

You will have to make use of np.isnan along with no.argwhere to achieve what you desire in this question.

The following code will help give you some clarity:

```x = np.array([[1,2,3,4],
[2,3,np.nan,5],
[np.nan,5,2,3]])
np.argwhere(np.isnan(x))```

The output for the above code is as follows:

array([[1, 2],
[2, 0]])

For more, join this course to Master Python programming.

Thanks!

• 3,560 points

## how do I check the length of an array in a python program?

lets say we have a list mylist = ...READ MORE

+1 vote

## How do I find out the sum of digits of a number in Python?

Hi, good question. If you are considering ...READ MORE

## how do i print only the last two letters in a string using regular expression in python?

\$ to match the end of the ...READ MORE

## Doubt in numpy.vstack

The vstack function in numpy will stack ...READ MORE

## Count the digits in a Numpy array

Hey, @Sourav, We can solve this with the ...READ MORE

## How to save numpy array?

Hi@akhtar, You can use numpy.save() function to save ...READ MORE