The pandas help file says (for eval): As a convenience, multiple assignments can be performed by using a multi-line string.
However, I\'m finding that doesn
I can confirm that the local variables appear to only work on the first line of a multi line eval
expression. A possible work around:
df_price.eval("""mult = @mult
op = op * mult
cl = cl * mult
hi = hi * mult
lo = lo * mult""", inplace = True)
This does however have the side effect of creating an extra column.
Update:
I have submitted a Pull Request with a fix for this issue.