Skip to content

Commit

Permalink
Support apply
Browse files Browse the repository at this point in the history
  • Loading branch information
bra-fsn committed Feb 23, 2022
1 parent 8863e2c commit c9e8dc5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pandag/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c9e8dc5

Please sign in to comment.