I have a dataframe and in a particular column I want to find the index of all NA values. How can I do it?
You can get the column index from the column name in Pandas using DataFrame. columns. get_loc() method.
Extract rows/columns with missing values in specific columns/rows. You can use the isnull() or isna() method of pandas. DataFrame and Series to check if each element is a missing value or not. isnull() is an alias for isna() , whose usage is the same.
which(is.na(my.df$col.I.care.about))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With