def dtype(self, expression, internal=False):
expression = _ensure_string_from_expression(expression)<EOL>if expression in self.variables:<EOL><INDENT>return np.float64(<NUM_LIT:1>).dtype<EOL><DEDENT>elif expression in self.columns.keys():<EOL><INDENT>column = self.columns[expression]<EOL>data = column[<NUM_LIT:0>:<NUM_LIT:1>]<EOL>dtype = data.dtype<EOL><DEDENT>else:<EOL><INDENT>data = self.evaluate(expression, <NUM_LIT:0>, <NUM_LIT:1>, filtered=False)<EOL>dtype = data.dtype<EOL><DEDENT>if not internal:<EOL><INDENT>if dtype != str_type:<EOL><INDENT>if dtype.kind in '<STR_LIT>':<EOL><INDENT>return str_type<EOL><DEDENT>if dtype.kind == '<STR_LIT:O>':<EOL><INDENT>if isinstance(data[<NUM_LIT:0>], six.string_types):<EOL><INDENT>return str_type<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return dtype<EOL>
Return the numpy dtype for the given expression, if not a column, the first row will be evaluated to get the dtype.