def not0 ( a ) : return matrix ( list ( map ( lambda x : 1 if x == 0 else x , a ) ) , a . size )
python count non zeros in matrix
Return u if u! = 0 return 1 if u == 0
def not0(a):
    """Return u if u!= 0, return 1 if u == 0"""
    return matrix(list(map(lambda x: 1 if x == 0 else x, a)), a.size)