diff --git a/glidertools/optics.py b/glidertools/optics.py index df68f02..34a743b 100644 --- a/glidertools/optics.py +++ b/glidertools/optics.py @@ -697,7 +697,7 @@ def grad_min(depth, fluor_diff, surface_layer=5): df = pd.DataFrame(np.c_[flr, bbp], columns=["flr", "bbp"]) # get the binned averages for each batch and select the night night_ave = df.groupby([day, batch, np.around(depth)]).mean() - night_ave = night_ave.xs(False, level=0, drop_level=True) + night_ave = night_ave.dropna().xs(False, level=0, drop_level=True) # A second group where only batches are grouped grp_batch = df.groupby(batch)