I have a pandas DataFrame df1 with the following content:
Serial N year current
B 10 14
B 10 16
B 11 10
B 11
B 11 15
C 12 11
C 9
C 12 13
C 12
I would like to make a DataFrame that is based on df1 but that has any row containing an empty value removed. For example:
Serial N year current
B 10 14
B 10 16
B 11 10
B 11 15
C 12 11
C 12 13
I tried something like this
df1=df[~np.isnan(df["year"]) or ~np.isnan(df["current"])]
But I received the following error:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
What could be the problem?