If statement in expression / virtual column #1804
-
I want to set a virtual column to a calculation using another column in Vaex. I need to use an if statement inside this calculation. In general I want to call
I then try to run the count function in Vaex:
When I try to execute this code I get the error How can I use a conditional for a virtual column in Vaex? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, debug tip: If you print this out (in the repr) you'll probably see what is evaluates into
you can use where instead:
Hope that helps cheers, Maarten |
Beta Was this translation helpful? Give feedback.
Hi,
debug tip: If you print this out (in the repr) you'll probably see what is evaluates into
you can use where instead:
(df['original_col']) == 0).where(df['original_col'], -4)
Hope that helps
cheers,
Maarten