Can't figure out how to drop NaN values from specific column according to another column specific value.
Part of DataFrame(df):
vol. group
1186 10,448,898 1
1187 nan 0
1188 35,047,520 1
...
8329 130,703 0
8330 241,489 1
8332 nan 1
8333 101,142 0
8334 nan 1
I need to drop nan values from vol. but only when according value in group is 1.
I tried:
df.loc[df['group'] == 1,'vol.'].dropna(inplace=True)
But df still have all values as dropna takes no effect.