Filters the data based on the provided conditions.
Filters the data based on the provided conditions.
:param conditions: Dictionary containing the conditions for filtering. The keys should be the names of the data fields, and the values should be callables or expressions that return a boolean mask.
:param conditions: List of conditions as strings for filtering. The keys should be the names of the data fields, and the conditions should be in a format that can be split into key, operator, and value.
:return: Dictionary containing the filtered data.
:return: Instance of the class containing the filtered data.
"""
"""
filteredData=self.data.copy()
filteredData=self.data.copy()
mask=np.ones(len(next(iter(self.data.values()))),dtype=bool)# Initial mask allowing all elements
mask=np.ones(len(next(iter(self.data.values()))),dtype=bool)# Initial mask allowing all elements
# Applying the conditions to create the mask
# Applying the conditions to create the mask
forconditioninconditions:
forconditioninconditions:
key,op,value=condition.split()
key,op,value=condition.split(None,2)# Split by the first two spaces only