Premium problem80. Drop Sparse Rows with a Threshold

Medium Locked

Drop rows of df that have fewer than 2 non-missing (non-NaN) values across its columns. Return the remaining rows in their original order.

Input

     a    b    c
0  1.0  NaN  1.0
1  NaN  NaN  2.0
2  3.0  3.0  3.0
3  NaN  4.0  NaN

Output

     a    b    c
0  1.0  NaN  1.0
2  3.0  3.0  3.0

Premium problem

This one's part of Premium. Unlock the full Pandas track plus every other premium problem on the site.

Implement solve(...)