for selection in self.selections: column_name = selection.column.get_name() value = selection.value compare_operation = selection.compare_operation if compare_operation == '=': data = data[data[column_name] == value] elif compare_operation == '!=': data = data[data[column_name] != value] elif compare_operation == '<': data = data[data[column_name] < value] elif compare_operation == '<=': data = data[data[column_name] <= value] elif compare_operation == '>': data = data[data[column_name] > value] elif compare_operation == '>': data = data[data[column_name] >= value]
Как в коде делать отборы не по одному, а все разом? Что- то типа:
data = data[data[col1] > value1 and data[col2] < value2 and data[col3] != value3]