Skip to content
Advertisement

Alternative to irregular nested np.where clauses

I’m struggling to simplify my irregular nested np.where clauses. Is there a way to make the code more readable?

JavaScript

Advertisement

Answer

Using np.select as suggested by @sammywemmy:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement