pandas filter non nan

filtered_df = df[df['name'].notnull()]

Here is what the above code is Doing:
1. We’re creating a new DataFrame called filtered_df that contains only the rows from df where the name column is not null.
2. We’re using the notnull() method to check if the name column is not null.
3. We’re using the ~ operator to invert the notnull() method.
4. We’re using the [] operator to select only the rows from df that satisfy the condition.