Skip to content
Snippets Groups Projects
Commit 621e1d58 authored by David Schäfer's avatar David Schäfer
Browse files

[FIX] generic.flag generating new columns failed

parent 7be55f6e
No related branches found
No related tags found
No related merge requests found
......@@ -255,7 +255,11 @@ def flag(
if not np.issubdtype(mask.dtype, np.bool_):
raise TypeError(f"generic expression does not return a boolean array")
m = ~_isflagged(flags[field], to_mask) & mask
flags[m, field] = flag
if field not in flags:
flags[field] = pd.Series(data=UNFLAGGED, index=mask.index, name=field)
mask = ~_isflagged(flags[field], to_mask) & mask
flags[mask, field] = flag
return data, flags
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment