I'd like to replace all values in a df that are between -0.5 and 0.5 with NaNs.
For just the latter condition this solution works nicely:
df[df < 0.5] = np.nan
I can't, however, figure out how to add a second condition like:
df[-0.5 < df < 0.5] = np.nan
Any help would be greatly appreciated!
Thanks.