gordonwatts / hep_tables

Prototyping Hierarchical data, with servicex as a backend
MIT License
2 stars 0 forks source link

Translate np_where into the if else expressions #27

Open gordonwatts opened 4 years ago

gordonwatts commented 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)

It may be we can't do all of these given the way our multi-argument resolution works, but we should explore.

gordonwatts commented 4 years ago

We can't do anything interesting here without work on #33. I was hoping to avoid that.