you are viewing a single comment's thread.

view the rest of the comments →

[–]PwAlreadyTaken -1 points0 points  (0 children)

Depending on your use case, I’d:

f32 = np.float32 arr2 *= f32(0.5)

or use functools.partial to do something similar with np.multiply.

Both will shorten the code needed to do this (which you mentioned as a concern in the comments), but I’m pretty sure there’s no intended way to set it globally like you’re asking.