def logarithm(value, base=math.e):
    'Filter to get logarithm of the value with a specific base.'
    try:
        return math.log(float(value), float(base))
    except (ValueError, TypeError):
        return value
Filter to get logarithm of the value with a specific base.
def logarithm(value, base=math.e):
    
    try:
        return math.log(float(value), float(base))
    except (ValueError, TypeError):
        return value