I would like to select only those indices where value is different than 'Nan' and 0
Create Dataframe
df = pd.DataFrame({'A':[np.nan,3,0,2],
'B':[0,1,1,2]})
df = np.asarray(df)
Unfortunately below code does not work
df[np.nonzero(df) & ~np.isnan(df)]
Expected result
array(3,1,1,2,2)
Does anyone know what's wrong with it?