Open gordonwatts opened 4 years ago
The if then else expression should be directly supported by hep_tables.
Here is an example expression:
1.0 / dx if d.x != 0 else 0.0
This is implemented as
np.where(d.x != 0, 1.0/d.x, 0.0)
np.where(d.x < 0, -1.0, 1.0)
np.where(d.x < 0, np.sin(d.x), np.cos(d.x)
np.where(d.x < 0, d.x, d.y)
It may be we can't do all of these given the way our multi-argument resolution works, but we should explore.
We can't do anything interesting here without work on #33. I was hoping to avoid that.
The if then else expression should be directly supported by hep_tables.
Here is an example expression:
This is implemented as
np.where(d.x < 0, -1.0, 1.0)
)np.where(d.x < 0, np.sin(d.x), np.cos(d.x)
np.where(d.x < 0, d.x, d.y)
It may be we can't do all of these given the way our multi-argument resolution works, but we should explore.