def evaluate(self, expression, i1=None, i2=None, out=None, selection=None, filtered=True, internal=False):
expression = _ensure_string_from_expression(expression)<EOL>selection = _ensure_strings_from_expressions(selection)<EOL>i1 = i1 or <NUM_LIT:0><EOL>i2 = i2 or (len(self) if (self.filtered and filtered) else self.length_unfiltered())<EOL>mask = None<EOL>if self.filtered and filtered:  <EOL><INDENT>indices = self._filtered_range_to_unfiltered_indices(i1, i2)<EOL>i1 = indices[<NUM_LIT:0>]<EOL>i2 = indices[-<NUM_LIT:1>] + <NUM_LIT:1>  <EOL><DEDENT>if selection is not None or (self.filtered and filtered):<EOL><INDENT>mask = self.evaluate_selection_mask(selection, i1, i2)<EOL><DEDENT>scope = scopes._BlockScope(self, i1, i2, mask=mask, **self.variables)<EOL>if out is not None:<EOL><INDENT>scope.buffers[expression] = out<EOL><DEDENT>value = scope.evaluate(expression)<EOL>if isinstance(value, ColumnString) and not internal:<EOL><INDENT>value = value.to_numpy()<EOL><DEDENT>return value<EOL>
The local implementation of :func:`DataFrame.evaluate`