packages/vaex-core/vaex/dataframe.py
def evaluate(self, expression, i1=None, i2=None, out=None, selection=None, filtered=True, internal=False):
        """The local implementation of :func:`DataFrame.evaluate`"""
        expression = _ensure_string_from_expression(expression)
        selection = _ensure_strings_from_expressions(selection)
        i1 = i1 or 0
        i2 = i2 or (len(self) if (self.filtered and filtered) else self.length_unfiltered())
        mask = None

        if self.filtered and filtered:  # if we filter, i1:i2 has a different meaning
            indices = self._filtered_range_to_unfiltered_indices(i1, i2)
            i1 = indices[0]
            i2 = indices[-1] + 1  # +1 to make it inclusive
        # for both a selection or filtering we have a mask
        if selection is not None or (self.filtered and filtered):
            mask = self.evaluate_selection_mask(selection, i1, i2)
        scope = scopes._BlockScope(self, i1, i2, mask=mask, **self.variables)
        # value = value[mask]
        if out is not None:
            scope.buffers[expression] = out
        value = scope.evaluate(expression)
        if isinstance(value, ColumnString) and not internal:
            value = value.to_numpy()
        return value
def evaluate(self, expression, i1=None, i2=None, out=None, selection=None, filtered=True, internal=False):
        """The local implementation of :func:`DataFrame.evaluate`"""
        expression = _ensure_string_from_expression(expression)
        selection = _ensure_strings_from_expressions(selection)
        i1 = i1 or 0
        i2 = i2 or (len(self) if (self.filtered and filtered) else self.length_unfiltered())
        mask = None

        if self.filtered and filtered:  # if we filter, i1:i2 has a different meaning
            indices = self._filtered_range_to_unfiltered_indices(i1, i2)
            i1 = indices[0]
            i2 = indices[-1] + 1  # +1 to make it inclusive
        # for both a selection or filtering we have a mask
        if selection is not None or (self.filtered and filtered):
            mask = self.evaluate_selection_mask(selection, i1, i2)
        scope = scopes._BlockScope(self, i1, i2, mask=mask, **self.variables)
        # value = value[mask]
        if out is not None:
            scope.buffers[expression] = out
        value = scope.evaluate(expression)
        if isinstance(value, ColumnString) and not internal:
            value = value.to_numpy()
        return value
def evaluate ( self , expression , i1 = None , i2 = None , out = None , selection = None , filtered = True , internal = False ) : expression = _ensure_string_from_expression ( expression ) selection = _ensure_strings_from_expressions ( selection ) i1 = i1 or 0 i2 = i2 or ( len ( self ) if ( self . filtered and filtered ) else self . length_unfiltered ( ) ) mask = None if self . filtered and filtered : # if we filter, i1:i2 has a different meaning indices = self . _filtered_range_to_unfiltered_indices ( i1 , i2 ) i1 = indices [ 0 ] i2 = indices [ - 1 ] + 1 # +1 to make it inclusive # for both a selection or filtering we have a mask if selection is not None or ( self . filtered and filtered ) : mask = self . evaluate_selection_mask ( selection , i1 , i2 ) scope = scopes . _BlockScope ( self , i1 , i2 , mask = mask , * * self . variables ) # value = value[mask] if out is not None : scope . buffers [ expression ] = out value = scope . evaluate ( expression ) if isinstance ( value , ColumnString ) and not internal : value = value . to_numpy ( ) return value
The local implementation of :func:`DataFrame.evaluate`
The local implementation of : func : DataFrame . evaluate