larray.LArray.divnot0

LArray.divnot0(self, other)[source]

Divides array by other, but returns 0.0 where other is 0.

Parameters
otherscalar or LArray

What to divide by.

Returns
LArray

Array divided by other, 0.0 where other is 0

Examples

>>> nat = Axis('nat=BE,FO')
>>> sex = Axis('sex=M,F')
>>> a = ndtest((nat, sex))
>>> a
nat\sex  M  F
     BE  0  1
     FO  2  3
>>> b = ndtest(sex)
>>> b
sex  M  F
     0  1
>>> a / b
nat\sex    M    F
     BE  nan  1.0
     FO  inf  3.0
>>> a.divnot0(b)
nat\sex    M    F
     BE  0.0  1.0
     FO  0.0  3.0