def attribute_to_float(self, attr):
    stripped_attr = ''.join([char for char in attr if (char in ((string.digits + '.') + '-'))])
    return float(stripped_attr)
def attribute_to_float(self, attr):
    stripped_attr = .join([char for char in attr if (char in ((string.digits + '.') + '-'))])
    return float(stripped_attr)