I have an array that looks like this:
a = [ -22 347 4448 294 835 4439 587 326]
I want to set 0 or less values to -inf. I tried the following:
a[where(a <= 0)] = -inf
when I do this, I get an error message:
OverflowError: cannot convert float infinity to integer
Any idea why this is the case and how I can fix it? the where function should return indexes of values less than or equal to 0, and assignment should simply set these values to -inf. thank.
source
share