Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (19.9k points)

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!

1 Answer

0 votes
by (25.1k points)

You can do it simply by using isnan and argwhere methods together. Like this:

np.argwhere(np.isnan(x)) # Here x is Dataframe

If you want to get a deeper understanding of python you can watch this youtube video: 

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...