I need to drop rows that have a nan value in any column. As for null values with drop_nulls()
df.drop_nulls()
but for nans. I have found that the method drop_nans
exist for Series but not for DataFrames
df['A'].drop_nans()
Pandas code that I'm using:
df = pd.DataFrame(
{
'A': [0, 0, 0, 1,None, 1],
'B': [1, 2, 2, 1,1, np.nan]
}
)
df.dropna()