log transform each value in table

def log_trans(table):
    """
    log transform each value in table
    """
    t = []
    all = [item for sublist in table for item in sublist]
    if min(all) == 0:
        scale = min([i for i in all if i != 0]) * 10e-10
    else:
        scale = 0
    for i in table:
        t.append(np.ndarray.tolist(np.log10([j + scale for j in i])))
    return t