I have a basic df as below and i want to remove NaN values when they appear in both Name and Age columns and not just one. the below code i am using removes the 3rd row even though Age = 16 and is not a NaN. ideally i want to use loc method as i have other conditions
thanks
import pandas as pd
import numpy as np
data = [['tom', 10, 'male'], ['nick', 15, 'male'], [np.nan, 16, 'male']]
df = pd.DataFrame(data, columns=['Name', 'Age', 'sex'])
df_new = df.loc[((df['Name'].notnull()) & (df['Age'].notnull()))]