diff --git a/pandag/nodes.py b/pandag/nodes.py index 3881993..f6f36dd 100644 --- a/pandag/nodes.py +++ b/pandag/nodes.py @@ -48,7 +48,10 @@ def __init__(self, _label=None, _id=None, expr=None, **kw): def update(self, df, loc): for k, v in self.kw.items(): - df.loc[loc, k] = df.eval(v) + if callable(v): + df.loc[loc, k] = df.apply(v, axis=1) + else: + df.loc[loc, k] = df.eval(v) if self.expr: # If there was an eval expression specified, update matching rows # with it.