What does df.dropna(thresh=3) keep?
Correct answer
B. Rows containing at least three non-missing values
14 views
B. Rows containing at least three non-missing values
14 views
thresh is the minimum count of non-NA values required to keep a row or column, so thresh=3 keeps any row with three or more present values and drops the rest. It is the complement of a maximum-missing rule, and the subset argument restricts the count to chosen columns. how='all' and how='any' are the coarser alternatives.
Asked in: NTS, PPSC IT, Interviews
Not sure why the answer is B? Ask here and get an explanation.