Back
I am trying to remove the rows in the data frame with more than 7 null values. Please suggest something that is efficient to achieve this.
The below line of code will keep the rows which have nan's less than 7 in the dataframe, and will remove all the rows having nan's > 7.
df = df[df.isnull().sum(axis=1) < 7]
31k questions
32.8k answers
501 comments
693 users