I have a dataframe that looks something like this:
wavelength normalized flux lof
0 5100.00 0.948305 1
1 5100.07 0.796783 1
2 5100.14 0.696425 1
3 5100.21 0.880586 1
4 5100.28 0.836257 1
... ... ... ...
4281 5399.67 1.076449 1
4282 5399.74 1.038198 1
4283 5399.81 1.004292 1
4284 5399.88 0.946977 1
4285 5399.95 0.894559 1
If lof = -1
, I want to replace the normalized flux value with np.nan
. Otherwise, just leave the normalized flux value as is. Is there a simple way to do this?