def normalized(expression):
    """Converts the expression to the syntax necessary for Pandas'
    DataFrame.eval method.

    Args:
        expression: The expression to normalize

    Returns:
        A normalized version of the expression usable in Pandas' DataFrame.eval
        method.
    """
    return expression.replace('!', '~').replace('&&', '&').replace('||', '|')